mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-06 05:14:45 +00:00
feat(nimble): Add BLE HCI logging support for ESP Insights
fix(nimble): Simplify esp insight ble logging
This commit is contained in:
@@ -845,6 +845,9 @@ ble_hs_rx_data(struct os_mbuf *om, void *arg)
|
||||
data[0] = 0x02;
|
||||
os_mbuf_copydata(om, 0, len, &data[1]);
|
||||
bt_hci_log_record_hci_data(HCI_LOG_DATA_TYPE_C2H_ACL, &data[1], len);
|
||||
#if BT_HCI_INSIGHTS_INCLUDED
|
||||
bt_hci_log_record_insights(HCI_LOG_DATA_TYPE_C2H_ACL, &data[1], len);
|
||||
#endif
|
||||
}
|
||||
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
||||
|
||||
@@ -881,7 +884,10 @@ ble_hs_tx_data(struct os_mbuf *om)
|
||||
uint8_t data[BLE_HS_HCI_LOG_BUF_SIZE];
|
||||
data[0] = 0x02;
|
||||
os_mbuf_copydata(om, 0, pkt_len, &data[1]);
|
||||
bt_hci_log_record_hci_data(data[0], &data[1], pkt_len);
|
||||
bt_hci_log_record_hci_data(HCI_LOG_DATA_TYPE_H2C_ACL, &data[1], pkt_len);
|
||||
#if BT_HCI_INSIGHTS_INCLUDED
|
||||
bt_hci_log_record_insights(HCI_LOG_DATA_TYPE_H2C_ACL, &data[1], pkt_len);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -706,8 +706,14 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
|
||||
uint16_t len = hci_ev[1] + 3;
|
||||
if (host_recv_adv_packet(hci_ev)) {
|
||||
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &hci_ev[1], len - 2);
|
||||
#if BT_HCI_INSIGHTS_INCLUDED
|
||||
bt_hci_log_record_insights(HCI_LOG_DATA_TYPE_ADV, &hci_ev[1], len - 2);
|
||||
#endif
|
||||
} else {
|
||||
bt_hci_log_record_hci_data(0x04, &hci_ev[0], len - 1);
|
||||
#if BT_HCI_INSIGHTS_INCLUDED
|
||||
bt_hci_log_record_insights(0x04, &hci_ev[0], len - 1);
|
||||
#endif
|
||||
}
|
||||
#endif // #if (BT_HCI_LOG_INCLUDED == TRUE)
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#if (BT_HCI_LOG_INCLUDED == TRUE)
|
||||
#include "hci_log/bt_hci_log.h"
|
||||
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
||||
|
||||
|
||||
/*
|
||||
* HCI Command Header
|
||||
*
|
||||
@@ -102,6 +100,9 @@ ble_hs_hci_cmd_send(uint16_t opcode, uint8_t len, const void *cmddata)
|
||||
|
||||
#if ((BT_HCI_LOG_INCLUDED == TRUE) && SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED)
|
||||
bt_hci_log_record_hci_data(0x01, (uint8_t *)buf, len + BLE_HCI_CMD_HDR_LEN);
|
||||
#if BT_HCI_INSIGHTS_INCLUDED
|
||||
bt_hci_log_record_insights(0x01, (uint8_t *)buf, len + BLE_HCI_CMD_HDR_LEN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
rc = ble_hs_hci_cmd_transport((void *) buf);
|
||||
|
||||
Reference in New Issue
Block a user