mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
BluFi : Fixed hdr getting free twice
Closes IDFGH-9378
This commit is contained in:
@ -385,8 +385,6 @@ void esp_blufi_send_encap(void *arg)
|
|||||||
retry:
|
retry:
|
||||||
if (blufi_env.is_connected == false) {
|
if (blufi_env.is_connected == false) {
|
||||||
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
|
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
|
||||||
osi_free(hdr);
|
|
||||||
hdr = NULL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (esp_ble_get_cur_sendable_packets_num(BTC_GATT_GET_CONN_ID(blufi_env.conn_id)) > 0) {
|
if (esp_ble_get_cur_sendable_packets_num(BTC_GATT_GET_CONN_ID(blufi_env.conn_id)) > 0) {
|
||||||
|
@ -427,9 +427,15 @@ void esp_blufi_send_notify(void *arg)
|
|||||||
struct pkt_info *pkts = (struct pkt_info *) arg;
|
struct pkt_info *pkts = (struct pkt_info *) arg;
|
||||||
struct os_mbuf *om;
|
struct os_mbuf *om;
|
||||||
om = ble_hs_mbuf_from_flat(pkts->pkt, pkts->pkt_len);
|
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;
|
int rc = 0;
|
||||||
rc = ble_gattc_notify_custom(conn_handle, gatt_values[1].val_handle, om);
|
rc = ble_gatts_notify_custom(blufi_env.conn_id, gatt_values[1].val_handle, om);
|
||||||
assert(rc == 0);
|
if (rc != 0) {
|
||||||
|
ESP_LOGE(TAG, "Error in sending notification");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void esp_blufi_disconnect(void)
|
void esp_blufi_disconnect(void)
|
||||||
@ -444,8 +450,6 @@ void esp_blufi_send_encap(void *arg)
|
|||||||
struct blufi_hdr *hdr = (struct blufi_hdr *)arg;
|
struct blufi_hdr *hdr = (struct blufi_hdr *)arg;
|
||||||
if (blufi_env.is_connected == false) {
|
if (blufi_env.is_connected == false) {
|
||||||
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
|
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
|
||||||
osi_free(hdr);
|
|
||||||
hdr = NULL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btc_blufi_send_notify((uint8_t *)hdr,
|
btc_blufi_send_notify((uint8_t *)hdr,
|
||||||
|
Reference in New Issue
Block a user