Merge branch 'bugfix/ble_hci_issues_chain_mbuf_v5.0' into 'release/v5.0'

fix hci issues when chain mbuf exists

See merge request espressif/esp-idf!25533
This commit is contained in:
Island 2023-08-29 10:27:40 +08:00
commit 7065c87963
2 changed files with 2 additions and 1 deletions

View File

@ -312,6 +312,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
if (*(data) == DATA_TYPE_COMMAND) {
struct ble_hci_cmd *cmd = NULL;
cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD);
assert(cmd);
memcpy((uint8_t *)cmd, data + 1, len - 1);
ble_hci_trans_hs_cmd_tx((uint8_t *)cmd);
}

View File

@ -613,7 +613,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
int
ble_hs_rx_data(struct os_mbuf *om, void *arg)
{
uint16_t len = om->om_len + 1;
uint16_t len = OS_MBUF_PKTHDR(om)->omp_len + 1;
uint8_t *data = (uint8_t *)malloc(len);
assert(data != NULL);
data[0] = 0x02;