Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/bluedroid/gattc_demo.c - Use correct struct type (IDFGH-9899) #11214

Closed
wants to merge 1 commit into from

Conversation

ckcr4lyf
Copy link
Contributor

If the event is ESP_GATTC_DIS_SRVC_CMPL_EVT , then the struct should be gattc_dis_srvc_cmpl_evt_param as per

/**
* @brief ESP_GATTC_DIS_SRVC_CMPL_EVT
*/
struct gattc_dis_srvc_cmpl_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
} dis_srvc_cmpl; /*!< Gatt client callback param of ESP_GATTC_DIS_SRVC_CMPL_EVT */

Currently it is using gattc_cfg_mtu_evt_param , which is defined as

/**
* @brief ESP_GATTC_CFG_MTU_EVT
*/
struct gattc_cfg_mtu_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
uint16_t mtu; /*!< MTU size */
} cfg_mtu; /*!< Gatt client callback param of ESP_GATTC_CFG_MTU_EVT */

Through coincidence, it does work since in memory the field .conn_id is at the same offset. However I think it is better to use the correct struct type , so it is less confusing to someone reading the example.

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 17, 2023
@github-actions github-actions bot changed the title examples/bluedroid/gattc_demo.c - Use correct struct type examples/bluedroid/gattc_demo.c - Use correct struct type (IDFGH-9899) Apr 17, 2023
@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Apr 18, 2023
@ckcr4lyf
Copy link
Contributor Author

I keep signing the CLA, it keeps removing it. Is this a bug?

image

@esp-cjh
Copy link
Contributor

esp-cjh commented Feb 23, 2024

@ckcr4lyf We will incorporate your updates in the subsequent versions. Thanks.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress labels Sep 2, 2024
@weiyuhannnn
Copy link
Collaborator

@ckcr4lyf Thanks for your contribution. The change you suggested has been merged with the following commits:

@weiyuhannnn weiyuhannnn closed this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants