Merge branch 'bugfix/blufi_notify_v4.4' into 'release/v4.4'

BluFi : Fixed hdr getting free twice (v4.4)

See merge request espressif/esp-idf!22449
This commit is contained in:
Jiang Jiang Jian 2023-02-26 16:11:22 +08:00
commit f89eedd2dc
2 changed files with 8 additions and 6 deletions

View File

@ -385,8 +385,6 @@ void esp_blufi_send_encap(void *arg)
retry:
if (blufi_env.is_connected == false) {
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
osi_free(hdr);
hdr = NULL;
return;
}
if (esp_ble_get_cur_sendable_packets_num(BTC_GATT_GET_CONN_ID(blufi_env.conn_id)) > 0) {

View File

@ -427,9 +427,15 @@ void esp_blufi_send_notify(void *arg)
struct pkt_info *pkts = (struct pkt_info *) arg;
struct os_mbuf *om;
om = ble_hs_mbuf_from_flat(pkts->pkt, pkts->pkt_len);
if (om == NULL) {
ESP_LOGE(TAG, "Error in allocating memory");
return;
}
int rc = 0;
rc = ble_gattc_notify_custom(conn_handle, gatt_values[1].val_handle, om);
assert(rc == 0);
rc = ble_gatts_notify_custom(blufi_env.conn_id, gatt_values[1].val_handle, om);
if (rc != 0) {
ESP_LOGE(TAG, "Error in sending notification");
}
}
void esp_blufi_disconnect(void)
@ -444,8 +450,6 @@ void esp_blufi_send_encap(void *arg)
struct blufi_hdr *hdr = (struct blufi_hdr *)arg;
if (blufi_env.is_connected == false) {
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
osi_free(hdr);
hdr = NULL;
return;
}
btc_blufi_send_notify((uint8_t *)hdr,