Skip to content

Commit

Permalink
Merge branch 'bufix/fix_assert_while_stack_deinit_v4.4' into 'release…
Browse files Browse the repository at this point in the history
…/v4.4'

fix(nimble): Fix assert due to controller event while stack deinit (v4.4)

See merge request espressif/esp-idf!24622
  • Loading branch information
rahult-github committed Jul 7, 2023
2 parents 962621e + 4258c40 commit e57938a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const static char *TAG = "NimBLE";

int os_msys_buf_alloc(void);
void os_msys_buf_free(void);
extern uint8_t ble_hs_enabled_state;

void ble_hci_trans_cfg_hs(ble_hci_trans_rx_cmd_fn *cmd_cb,
void *cmd_arg,
Expand Down Expand Up @@ -340,6 +341,11 @@ static void controller_rcv_pkt_ready(void)
*/
static int host_rcv_pkt(uint8_t *data, uint16_t len)
{
if(!ble_hs_enabled_state) {
/* If host is not enabled, drop the packet */
ESP_LOGE(TAG, "Host not enabled. Dropping the packet!");
return 0;
}

if (data[0] == BLE_HCI_UART_H4_EVT) {
uint8_t *evbuf;
Expand Down

0 comments on commit e57938a

Please sign in to comment.