From fbf55f90eb1eb308ddf0ec2b4a7d8eafc7f67c9b Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Wed, 10 Jun 2020 12:07:12 +0100 Subject: [PATCH] change fake chci into custom chci to resolve naming issues --- .../stack/controller/sources/common/chci/chci_tr.c | 8 ++++---- .../{fake_lhci_drv.cpp => custom_chci_tr.cpp} | 12 +++++++++--- .../{fake_lhci_drv.h => custom_chci_tr.h} | 12 +++++++----- .../TARGET_NRF5x/NRFCordioHCIDriver.cpp | 2 +- .../TARGET_NRF5x/NRFCordioHCITransportDriver.cpp | 4 ++-- 5 files changed, 23 insertions(+), 15 deletions(-) rename features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/{fake_lhci_drv.cpp => custom_chci_tr.cpp} (84%) rename features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/{fake_lhci_drv.h => custom_chci_tr.h} (82%) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c b/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c index 391e9d69ac..e3c3c3de21 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c @@ -39,8 +39,8 @@ #if (CHCI_TR_CUSTOM == 1) /* Custom transport */ -extern void ChciTrInit(uint16_t maxAclLen, uint16_t maxIsoSduLen); -extern void ChciTrWrite(uint8_t prot, uint8_t type, uint16_t len, uint8_t *pData); +extern void CustomChciTrInit(uint16_t maxAclLen, uint16_t maxIsoSduLen); +extern void CustomChciTrWrite(uint8_t prot, uint8_t type, uint16_t len, uint8_t *pData); #endif /************************************************************************************************** @@ -430,7 +430,7 @@ static void chciTrWrite(uint8_t prot, uint8_t type, uint16_t len, uint8_t *pData #endif #if (CHCI_TR_CUSTOM == 1) - ChciTrWrite(prot, type, len, pData); + CustomChciTrWrite(prot, type, len, pData); #endif } @@ -508,7 +508,7 @@ void ChciTrHandlerInit(wsfHandlerId_t handlerId, uint16_t maxAclLen, uint16_t ma /* Start receiver. */ chciRxPacketSM(); #elif (CHCI_TR_CUSTOM == 1) - ChciTrInit(maxAclLen, maxIsoSduLen); + CustomChciTrInit(maxAclLen, maxIsoSduLen); #else (void)chciRxPacketSM; (void)chciTxComplete; diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/fake_lhci_drv.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp similarity index 84% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/fake_lhci_drv.cpp rename to features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp index 1db93a7e34..a145b0835b 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/fake_lhci_drv.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp @@ -15,7 +15,7 @@ */ #include "mbed.h" -#include "fake_lhci_drv.h" +#include "custom_chci_tr.h" #include "chci_tr.h" #include "chci_api.h" #include "hci_defs.h" @@ -25,7 +25,7 @@ extern "C" { #endif -uint16_t FakeChciTrRead(uint8_t prot, uint8_t hci_type, uint16_t len, uint8_t *pData) +uint16_t CustomChciTrRead(uint8_t prot, uint8_t hci_type, uint16_t len, uint8_t *pData) { uint8_t controller_type; switch (hci_type) { @@ -49,7 +49,7 @@ uint16_t FakeChciTrRead(uint8_t prot, uint8_t hci_type, uint16_t len, uint8_t *p return len; } -uint16_t FakeChciTrWrite(uint8_t prot, uint8_t controller_type, uint16_t len, uint8_t *pData) +uint16_t CustomChciTrWrite(uint8_t prot, uint8_t controller_type, uint16_t len, uint8_t *pData) { uint8_t hci_type; switch (controller_type) { @@ -72,6 +72,12 @@ uint16_t FakeChciTrWrite(uint8_t prot, uint8_t controller_type, uint16_t len, ui return ControllerToHostWrite(prot, hci_type, len, pData); } +void CustomChciTrInit(uint16_t maxAclLen, uint16_t maxIsoSduLen) +{ + (void)maxAclLen; + (void)maxIsoSduLen; +} + #ifdef __cplusplus }; #endif diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/fake_lhci_drv.h b/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h similarity index 82% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/fake_lhci_drv.h rename to features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h index 3d572f4e03..c237b4c4a3 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/fake_lhci_drv.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FAKE_LHCI_DRV_H_ -#define FAKE_LHCI_DRV_H_ +#ifndef CUSTOM_CHCI_TR_H_ +#define CUSTOM_CHCI_TR_H_ #ifdef __cplusplus extern "C" { @@ -41,7 +41,7 @@ uint16_t ControllerToHostWrite(uint8_t prot, uint8_t hci_type, uint16_t len, uin * @param pData Data to be sent. * @return Number of bytes processed. */ -uint16_t FakeChciTrRead(uint8_t prot, uint8_t hci_type, uint16_t len, uint8_t *pData); +uint16_t CustomChciTrRead(uint8_t prot, uint8_t hci_type, uint16_t len, uint8_t *pData); /** * Send bytes from controller to host. @@ -52,10 +52,12 @@ uint16_t FakeChciTrRead(uint8_t prot, uint8_t hci_type, uint16_t len, uint8_t *p * @param pData Data to be sent. * @return Number of bytes processed. */ -uint16_t FakeChciTrWrite(uint8_t prot, uint8_t controller_type, uint16_t len, uint8_t *pData); +uint16_t CustomChciTrWrite(uint8_t prot, uint8_t controller_type, uint16_t len, uint8_t *pData); + +void CustomChciTrInit(uint16_t maxAclLen, uint16_t maxIsoSduLen); #ifdef __cplusplus }; #endif -#endif /* FAKE_LHCI_DRV_H_ */ +#endif /* CUSTOM_CHCI_TR_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp index 1ce335e670..b06d2a08f6 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp @@ -27,7 +27,7 @@ // Cordio Includes #include "ll_init_api.h" #include "ll_defs.h" -#include "fake_lhci_drv.h" +#include "custom_chci_tr.h" #include "pal_bb.h" #include "pal_cfg.h" #include "lhci_api.h" diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp index ff52bfe460..b367ada564 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp @@ -23,7 +23,7 @@ #include "wsf_math.h" #include "chci_api.h" #include "chci_tr.h" -#include "fake_lhci_drv.h" +#include "custom_chci_tr.h" #include "hci_defs.h" #include @@ -47,7 +47,7 @@ void NRFCordioHCITransportDriver::terminate() uint16_t NRFCordioHCITransportDriver::write(uint8_t hci_type, uint16_t len, uint8_t *pData) { /* ownership of the WSF buffer is transferred to the controller (zero copy HCI) */ - return FakeChciTrRead(CHCI_TR_PROT_BLE, hci_type, len, pData); + return CustomChciTrRead(CHCI_TR_PROT_BLE, hci_type, len, pData); } extern "C" void chciDrvInit(void)