feat(ble): supported ble log v2 hci log for NimBLE host

This commit is contained in:
Zhou Xiao
2025-12-24 17:49:08 +08:00
parent f35dd91fcd
commit f0d8014c9c
@@ -27,6 +27,9 @@
#if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED #if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
#include "ble_log/ble_log_spi_out.h" #include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED #endif // CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
#if CONFIG_BLE_LOG_ENABLED
#include "ble_log.h"
#endif /* CONFIG_BLE_LOG_ENABLED */
#define NIMBLE_VHCI_TIMEOUT_MS 2000 #define NIMBLE_VHCI_TIMEOUT_MS 2000
#define BLE_HCI_EVENT_HDR_LEN (2) #define BLE_HCI_EVENT_HDR_LEN (2)
@@ -75,6 +78,9 @@ void esp_vhci_host_send_packet_wrapper(uint8_t *data, uint16_t len)
#if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED #if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
ble_log_spi_out_hci_write(BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM, data, len); ble_log_spi_out_hci_write(BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM, data, len);
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED #endif // CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
#if CONFIG_BLE_LOG_ENABLED
ble_log_write_hex(BLE_LOG_SRC_HCI, data, len);
#endif /* CONFIG_BLE_LOG_ENABLED */
esp_vhci_host_send_packet(data, len); esp_vhci_host_send_packet(data, len);
} }
@@ -252,6 +258,9 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
#if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED #if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
ble_log_spi_out_hci_write(BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM, data, len); ble_log_spi_out_hci_write(BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM, data, len);
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED #endif // CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
#if CONFIG_BLE_LOG_ENABLED
ble_log_write_hex(BLE_LOG_SRC_HCI, data, len);
#endif /* CONFIG_BLE_LOG_ENABLED */
bt_record_hci_data(data, len); bt_record_hci_data(data, len);