From 5ecdcb6071d7bfc93589b75f49b1fede6a73c8e9 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Wed, 31 Aug 2022 13:51:51 +0530 Subject: [PATCH] Added check to not include VHCI buffer handling code if controller support is disabled --- nimble/host/src/ble_hs_hci_cmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nimble/host/src/ble_hs_hci_cmd.c b/nimble/host/src/ble_hs_hci_cmd.c index 2decd6054..69fa16702 100644 --- a/nimble/host/src/ble_hs_hci_cmd.c +++ b/nimble/host/src/ble_hs_hci_cmd.c @@ -57,13 +57,15 @@ ble_hs_hci_cmd_transport(struct ble_hci_cmd *cmd) static int ble_hs_hci_cmd_send(uint16_t opcode, uint8_t len, const void *cmddata) { + struct ble_hci_cmd *cmd; uint8_t *buf; int rc; cmd = ble_transport_alloc_cmd(); BLE_HS_DBG_ASSERT(cmd != NULL); -#if !(SOC_ESP_NIMBLE_CONTROLLER) + buf = (uint8_t *)cmd; +#if !(SOC_ESP_NIMBLE_CONTROLLER) && !CONFIG_BT_CONTROLLER_DISABLED /* Hack for avoiding memcpy while handling tx pkt to VHCI, * keep one byte for type field*/ buf++; @@ -80,7 +82,7 @@ ble_hs_hci_cmd_send(uint16_t opcode, uint8_t len, const void *cmddata) BLE_HS_LOG(DEBUG, "\n"); #endif -#if !(SOC_ESP_NIMBLE_CONTROLLER) +#if !(SOC_ESP_NIMBLE_CONTROLLER) && !CONFIG_BT_CONTROLLER_DISABLED buf--; #endif