mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'bugfix/btdm_fix_multi_open_evt_and_clear_blufi_prepare_write_len' into 'release/v4.0'
component/bt: fix multi open evt and clear blufi prepare write len(backport v4.0) See merge request espressif/esp-idf!7324
This commit is contained in:
@ -745,6 +745,8 @@ void bta_gattc_conncback(tBTA_GATTC_RCB *p_rcb, tBTA_GATTC_DATA *p_data)
|
|||||||
void bta_gattc_disconncback(tBTA_GATTC_RCB *p_rcb, tBTA_GATTC_DATA *p_data)
|
void bta_gattc_disconncback(tBTA_GATTC_RCB *p_rcb, tBTA_GATTC_DATA *p_data)
|
||||||
{
|
{
|
||||||
if (p_rcb) {
|
if (p_rcb) {
|
||||||
|
// Clear up the notification registration information by BD_ADDR
|
||||||
|
bta_gattc_clear_notif_registration_by_bda(p_rcb, p_data->int_conn.remote_bda);
|
||||||
bta_gattc_send_disconnect_cback(p_rcb,
|
bta_gattc_send_disconnect_cback(p_rcb,
|
||||||
p_data->int_conn.reason,
|
p_data->int_conn.reason,
|
||||||
p_data->int_conn.remote_bda,
|
p_data->int_conn.remote_bda,
|
||||||
|
@ -596,6 +596,30 @@ void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, UINT16 conn_id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function bta_gattc_clear_notif_registration_by_bda
|
||||||
|
**
|
||||||
|
** Description Clear up the notification registration information by BD_ADDR.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns None.
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void bta_gattc_clear_notif_registration_by_bda(tBTA_GATTC_RCB *p_clrcb, BD_ADDR remote_bda)
|
||||||
|
{
|
||||||
|
if(p_clrcb == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (uint8_t i = 0 ; i < BTA_GATTC_NOTIF_REG_MAX; i ++) {
|
||||||
|
if (p_clrcb->notif_reg[i].in_use &&
|
||||||
|
!bdcmp(p_clrcb->notif_reg[i].remote_bda, remote_bda))
|
||||||
|
{
|
||||||
|
memset(&p_clrcb->notif_reg[i], 0, sizeof(tBTA_GATTC_NOTIF_REG));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_gattc_mark_bg_conn
|
** Function bta_gattc_mark_bg_conn
|
||||||
|
@ -501,6 +501,7 @@ extern BOOLEAN bta_gattc_mark_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR_PTR rem
|
|||||||
extern BOOLEAN bta_gattc_check_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR remote_bda, UINT8 role);
|
extern BOOLEAN bta_gattc_check_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR remote_bda, UINT8 role);
|
||||||
extern UINT8 bta_gattc_num_reg_app(void);
|
extern UINT8 bta_gattc_num_reg_app(void);
|
||||||
extern void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, UINT16 conn_id, UINT16 start_handle, UINT16 end_handle);
|
extern void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, UINT16 conn_id, UINT16 start_handle, UINT16 end_handle);
|
||||||
|
extern void bta_gattc_clear_notif_registration_by_bda(tBTA_GATTC_RCB *p_clrcb, BD_ADDR remote_bda);
|
||||||
extern tBTA_GATTC_SERV * bta_gattc_find_srvr_cache(BD_ADDR bda);
|
extern tBTA_GATTC_SERV * bta_gattc_find_srvr_cache(BD_ADDR bda);
|
||||||
|
|
||||||
/* discovery functions */
|
/* discovery functions */
|
||||||
|
@ -151,6 +151,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
|||||||
|
|
||||||
if (blufi_env.prepare_buf == NULL) {
|
if (blufi_env.prepare_buf == NULL) {
|
||||||
blufi_env.prepare_buf = osi_malloc(BLUFI_PREPAIR_BUF_MAX_SIZE);
|
blufi_env.prepare_buf = osi_malloc(BLUFI_PREPAIR_BUF_MAX_SIZE);
|
||||||
|
blufi_env.prepare_len = 0;
|
||||||
if (blufi_env.prepare_buf == NULL) {
|
if (blufi_env.prepare_buf == NULL) {
|
||||||
BLUFI_TRACE_ERROR("Blufi prep no mem\n");
|
BLUFI_TRACE_ERROR("Blufi prep no mem\n");
|
||||||
status = GATT_NO_RESOURCES;
|
status = GATT_NO_RESOURCES;
|
||||||
@ -178,6 +179,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
|||||||
if (blufi_env.prepare_buf) {
|
if (blufi_env.prepare_buf) {
|
||||||
osi_free(blufi_env.prepare_buf);
|
osi_free(blufi_env.prepare_buf);
|
||||||
blufi_env.prepare_buf = NULL;
|
blufi_env.prepare_buf = NULL;
|
||||||
|
blufi_env.prepare_len = 0;
|
||||||
}
|
}
|
||||||
BLUFI_TRACE_ERROR("write data error , error code 0x%x\n", status);
|
BLUFI_TRACE_ERROR("write data error , error code 0x%x\n", status);
|
||||||
return;
|
return;
|
||||||
@ -213,6 +215,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
|||||||
if (blufi_env.prepare_buf) {
|
if (blufi_env.prepare_buf) {
|
||||||
osi_free(blufi_env.prepare_buf);
|
osi_free(blufi_env.prepare_buf);
|
||||||
blufi_env.prepare_buf = NULL;
|
blufi_env.prepare_buf = NULL;
|
||||||
|
blufi_env.prepare_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user