mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Component/bt: fix service change event params error
This commit is contained in:
parent
da27816314
commit
f5d581421e
@ -1837,7 +1837,10 @@ BOOLEAN bta_gattc_process_srvc_chg_ind(UINT16 conn_id,
|
|||||||
}
|
}
|
||||||
/* notify applicationf or service change */
|
/* notify applicationf or service change */
|
||||||
if (p_clrcb->p_cback != NULL) {
|
if (p_clrcb->p_cback != NULL) {
|
||||||
(* p_clrcb->p_cback)(BTA_GATTC_SRVC_CHG_EVT, (tBTA_GATTC *)p_srcb->server_bda);
|
tBTA_GATTC_SERVICE_CHANGE srvc_chg= {0};
|
||||||
|
memcpy(srvc_chg.remote_bda, p_srcb->server_bda, sizeof(BD_ADDR));
|
||||||
|
srvc_chg.conn_id = conn_id;
|
||||||
|
(* p_clrcb->p_cback)(BTA_GATTC_SRVC_CHG_EVT, (tBTA_GATTC *)&srvc_chg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -387,27 +387,30 @@ typedef struct {
|
|||||||
BD_ADDR remote_bda;
|
BD_ADDR remote_bda;
|
||||||
} tBTA_GATTC_DISCONNECT;
|
} tBTA_GATTC_DISCONNECT;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT16 conn_id;
|
||||||
|
BD_ADDR remote_bda;
|
||||||
|
} tBTA_GATTC_SERVICE_CHANGE;
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
tBTA_GATT_STATUS status;
|
tBTA_GATT_STATUS status;
|
||||||
|
|
||||||
tBTA_GATTC_SEARCH_CMPL search_cmpl; /* discovery complete */
|
tBTA_GATTC_SEARCH_CMPL search_cmpl; /* discovery complete */
|
||||||
tBTA_GATTC_SRVC_RES srvc_res; /* discovery result */
|
tBTA_GATTC_SRVC_RES srvc_res; /* discovery result */
|
||||||
tBTA_GATTC_REG reg_oper; /* registration data */
|
tBTA_GATTC_REG reg_oper; /* registration data */
|
||||||
tBTA_GATTC_OPEN open;
|
tBTA_GATTC_OPEN open;
|
||||||
tBTA_GATTC_CONNECT connect;
|
tBTA_GATTC_CONNECT connect;
|
||||||
tBTA_GATTC_CLOSE close;
|
tBTA_GATTC_CLOSE close;
|
||||||
tBTA_GATTC_DISCONNECT disconnect;
|
tBTA_GATTC_DISCONNECT disconnect;
|
||||||
tBTA_GATTC_READ read; /* read attribute/descriptor data */
|
tBTA_GATTC_READ read; /* read attribute/descriptor data */
|
||||||
tBTA_GATTC_WRITE write; /* write complete data */
|
tBTA_GATTC_WRITE write; /* write complete data */
|
||||||
tBTA_GATTC_EXEC_CMPL exec_cmpl; /* execute complete */
|
tBTA_GATTC_EXEC_CMPL exec_cmpl; /* execute complete */
|
||||||
tBTA_GATTC_NOTIFY notify; /* notification/indication event data */
|
tBTA_GATTC_NOTIFY notify; /* notification/indication event data */
|
||||||
tBTA_GATTC_ENC_CMPL_CB enc_cmpl;
|
tBTA_GATTC_ENC_CMPL_CB enc_cmpl;
|
||||||
BD_ADDR remote_bda; /* service change event */
|
|
||||||
tBTA_GATTC_CFG_MTU cfg_mtu; /* configure MTU operation */
|
tBTA_GATTC_CFG_MTU cfg_mtu; /* configure MTU operation */
|
||||||
tBTA_GATTC_CONGEST congest;
|
tBTA_GATTC_CONGEST congest;
|
||||||
tBTA_GATTC_QUEUE_FULL queue_full;
|
tBTA_GATTC_QUEUE_FULL queue_full;
|
||||||
|
tBTA_GATTC_SERVICE_CHANGE srvc_chg; /* service change event */
|
||||||
} tBTA_GATTC;
|
} tBTA_GATTC;
|
||||||
|
|
||||||
/* GATTC enable callback function */
|
/* GATTC enable callback function */
|
||||||
|
@ -913,8 +913,10 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BTA_GATTC_SRVC_CHG_EVT: {
|
case BTA_GATTC_SRVC_CHG_EVT: {
|
||||||
memcpy(param.srvc_chg.remote_bda, arg->remote_bda, sizeof(esp_bd_addr_t));
|
tBTA_GATTC_SERVICE_CHANGE *srvc_change = &arg->srvc_chg;
|
||||||
btc_gattc_cb_to_app(ESP_GATTC_SRVC_CHG_EVT, ESP_GATT_IF_NONE, ¶m);
|
gattc_if = BTC_GATT_GET_GATT_IF(srvc_change->conn_id);
|
||||||
|
memcpy(param.srvc_chg.remote_bda, srvc_change->remote_bda, sizeof(esp_bd_addr_t));
|
||||||
|
btc_gattc_cb_to_app(ESP_GATTC_SRVC_CHG_EVT, gattc_if, ¶m);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BTA_GATTC_QUEUE_FULL_EVT: {
|
case BTA_GATTC_QUEUE_FULL_EVT: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user