diff --git a/hal_st/middlewares/ble_middleware/CMakeLists.txt b/hal_st/middlewares/ble_middleware/CMakeLists.txt index fb002e28..a0edd2ea 100644 --- a/hal_st/middlewares/ble_middleware/CMakeLists.txt +++ b/hal_st/middlewares/ble_middleware/CMakeLists.txt @@ -1,5 +1,8 @@ add_library(hal_st.ble_middleware STATIC) -emil_build_for(hal_st.ble_middleware TARGET_MCU_FAMILY stm32wbxx PREREQUISITE_BOOL HALST_STANDALONE) +emil_build_for(hal_st.ble_middleware + TARGET_MCU_FAMILY stm32wbxx + TARGET_MCU_FAMILY stm32wbaxx + PREREQUISITE_BOOL HALST_STANDALONE) target_include_directories(hal_st.ble_middleware PUBLIC "$" @@ -11,6 +14,8 @@ target_link_libraries(hal_st.ble_middleware PUBLIC services.ble services.util services.tracer + $<$:${CMAKE_CURRENT_LIST_DIR}/../STM32_WPAN/STM32CubeWBA/ble/stack/lib/stm32wba_ble_stack_basic.a> + $<$:${CMAKE_CURRENT_LIST_DIR}/../STM32_WPAN/STM32CubeWBA/link_layer/ll_cmd_lib/lib/LinkLayer_BLE_Basic_lib.a> ) target_sources(hal_st.ble_middleware PRIVATE @@ -27,8 +32,10 @@ target_sources(hal_st.ble_middleware PRIVATE GattServerSt.cpp GattServerSt.hpp HciEventObserver.hpp - SystemTransportLayer.cpp - SystemTransportLayer.hpp + $<$:SystemTransportLayerWb.cpp> + $<$:SystemTransportLayerWb.hpp> + $<$:SystemTransportLayerWba.cpp> + $<$:SystemTransportLayerWba.hpp> TracingGapCentralSt.cpp TracingGapCentralSt.hpp TracingGapPeripheralSt.cpp @@ -37,6 +44,6 @@ target_sources(hal_st.ble_middleware PRIVATE TracingGattClientSt.hpp TracingGattServerSt.cpp TracingGattServerSt.hpp - TracingSystemTransportLayer.cpp - TracingSystemTransportLayer.hpp + $<$:TracingSystemTransportLayerWb.cpp> + $<$:TracingSystemTransportLayerWb.hpp> ) diff --git a/hal_st/middlewares/ble_middleware/SystemTransportLayer.cpp b/hal_st/middlewares/ble_middleware/SystemTransportLayerWb.cpp similarity index 85% rename from hal_st/middlewares/ble_middleware/SystemTransportLayer.cpp rename to hal_st/middlewares/ble_middleware/SystemTransportLayerWb.cpp index 4caf1511..8a431174 100644 --- a/hal_st/middlewares/ble_middleware/SystemTransportLayer.cpp +++ b/hal_st/middlewares/ble_middleware/SystemTransportLayerWb.cpp @@ -1,296 +1,293 @@ -#include "hal_st/middlewares/ble_middleware/SystemTransportLayer.hpp" -#include "infra/event/EventDispatcherWithWeakPtr.hpp" -#include - -#if defined(STM32WB) -#include "hci_tl.h" -#include "interface/patterns/ble_thread/tl/tl.h" -#include "shci.h" -#include "shci_tl.h" -#include "stm32wbxx_ll_system.h" -#endif - -extern "C" -{ - SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void* packet) - { - assert(packet != nullptr); - - auto& event = *reinterpret_cast(static_cast(packet)->data); - hal::SystemTransportLayer::Instance().HciEventHandler(event); - - return SVCCTL_UserEvtFlowEnable; - } - - void hci_notify_asynch_evt(void* data) - { - static std::atomic_bool notificationScheduled{ false }; - - if (!notificationScheduled.exchange(true)) - infra::EventDispatcher::Instance().Schedule([]() - { - notificationScheduled = false; - hci_user_evt_proc(); - }); - } - - void shci_notify_asynch_evt(void* data) - { - static std::atomic_bool notificationScheduled{ false }; - - if (!notificationScheduled.exchange(true)) - infra::EventDispatcher::Instance().Schedule([]() - { - notificationScheduled = false; - shci_user_evt_proc(); - }); - } -} - -namespace -{ - const uint32_t bleBondsStorageLength = 507; - const uint8_t bleEventQueueLength = 0x05; - const uint8_t tlBleMaxEventPayloadSize = 0xFF; - const uint16_t bleEventFrameSize = TL_EVT_HDR_SIZE + tlBleMaxEventPayloadSize; - const uint32_t poolSize = bleEventQueueLength * 4u * DIVC((sizeof(TL_PacketHeader_t) + bleEventFrameSize), 4u); - - // Buffers to be used by the mailbox to report the events - [[gnu::section("MB_MEM2")]] alignas(4) uint8_t evtPool[poolSize]; - [[gnu::section("MB_MEM2")]] alignas(4) uint8_t systemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; - [[gnu::section("MB_MEM2")]] alignas(4) uint8_t bleSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; - [[gnu::section("MB_MEM2")]] uint32_t bleBondsStorage[bleBondsStorageLength]; - - // Buffer to be used by the mailbox driver to send a BLE command - [[gnu::section("MB_MEM2")]] alignas(4) TL_CmdPacket_t systemCmdBuffer; - [[gnu::section("MB_MEM1")]] alignas(4) TL_CmdPacket_t bleCmdBuffer; - - // This is the registered callback in shci_init() to acknowledge if a system command can be - // sent. It must be used in a multi-thread application where system commands may be sent - // from different threads - void ShciCommandStatus(SHCI_TL_CmdStatus_t status) - {} - - // To be used in a multi-thread application where the BLE commands may be sent from different threads - void HciCommandStatus(HCI_TL_CmdStatus_t status) - {} - - void ShciUserEventHandler(void* payload) - { - hal::SystemTransportLayer::Instance().UserEventHandler(payload); - } - - void HciUserEventHandler(void* payload) - { - auto pParam = static_cast(payload); - auto svctlReturnStatus = SVCCTL_UserEvtRx(static_cast(&(pParam->pckt->evtserial))); - - if (svctlReturnStatus != SVCCTL_UserEvtFlowDisable) - pParam->status = HCI_TL_UserEventFlow_Enable; - else - pParam->status = HCI_TL_UserEventFlow_Disable; - } - - uint8_t ToLowSpeedClock(hal::SystemTransportLayer::RfWakeupClock rfWakeupClock) - { - if (rfWakeupClock == hal::SystemTransportLayer::RfWakeupClock::highSpeedExternal) - return SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_HSE_1024; - else - return SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE; - } - - void ShciCore2Init(const hal::SystemTransportLayer::Configuration& configuration) - { - const uint8_t maxNumberOfBleLinks = 0x01; - const uint8_t prepareWriteListSize = BLE_PREP_WRITE_X_ATT(configuration.maxAttMtuSize); - const uint8_t numberOfBleMemoryBlocks = BLE_MBLOCKS_CALC(prepareWriteListSize, configuration.maxAttMtuSize, maxNumberOfBleLinks); - const uint8_t bleStackOptions = (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO | SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2 | - SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 | SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY | SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED); - - SHCI_C2_CONFIG_Cmd_Param_t configParam = { - SHCI_C2_CONFIG_PAYLOAD_CMD_SIZE, - SHCI_C2_CONFIG_CONFIG1_BIT0_BLE_NVM_DATA_TO_SRAM, - SHCI_C2_CONFIG_EVTMASK1_BIT1_BLE_NVM_RAM_UPDATE_ENABLE, - 0, // Spare - reinterpret_cast(bleBondsStorage), - 0, // ThreadNvmRamAddress - static_cast(LL_DBGMCU_GetRevisionID()), - static_cast(LL_DBGMCU_GetDeviceID()), - }; - - if (SHCI_C2_Config(&configParam) != SHCI_Success) - std::abort(); - - SHCI_C2_Ble_Init_Cmd_Packet_t bleInitCmdPacket = { - { { 0, 0, 0 } }, // Header (unused) - { - 0x00, // BLE buffer address (unused) - 0x00, // BLE buffer size (unused) - 0x44, // Maximum number of GATT Attributes - 0x08, // Maximum number of Services that can be stored in the GATT database - 0x540, // Size of the storage area for Attribute values - maxNumberOfBleLinks, - 0x01, // Enable or disable the Extended Packet length feature - prepareWriteListSize, - numberOfBleMemoryBlocks, - configuration.maxAttMtuSize, - 0x1FA, // Sleep clock accuracy in Slave mode - 0x00, // Sleep clock accuracy in Master mode - ToLowSpeedClock(configuration.rfWakeupClock), // Source for the low speed clock for RF wake-up - 0xFFFFFFFF, // Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) - 0x148, // Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) - 0x01, // Viterbi Mode - bleStackOptions, - 0, // HW version (unused) - 32, // Maximum number of connection-oriented channels in initiator mode - -40, // Minimum transmit power in dBm supported by the Controller - 6, // Maximum transmit power in dBm supported by the Controller - SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY, - 3, // Maximum number of advertising sets. - 1650, // Maximum advertising data length (in bytes) - 0, // RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB. - 0, // RF RX Path Compensation Value (16-bit signed integer). Units: 0.1 dB. - SHCI_C2_BLE_INIT_BLE_CORE_5_3 } - }; - - if (SHCI_C2_BLE_Init(&bleInitCmdPacket) != SHCI_Success) - std::abort(); - } -} - -namespace hal -{ - SystemTransportLayer::SystemTransportLayer(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized) - : bondBlobPersistence(flashStorage, infra::MakeByteRange(bleBondsStorage)) - , bondStorageSynchronizerCreator(bondStorageSynchronizerCreator) - , configuration(configuration) - , onInitialized(onInitialized) - { - really_assert(configuration.maxAttMtuSize >= BLE_DEFAULT_ATT_MTU && configuration.maxAttMtuSize <= 251); - // BLE middleware supported maxAttMtuSize = 512. Current usage of library limits maxAttMtuSize to 251 (max HCI buffer size) - - TL_Init(); - ShciInit(); - HciInit(); - MemoryChannelInit(); - TL_Enable(); - } - - void SystemTransportLayer::HciEventHandler(hci_event_pckt& event) - { - infra::Subject::NotifyObservers([&event](auto& observer) - { - observer.HciEvent(event); - }); - } - - SystemTransportLayer::Version SystemTransportLayer::GetVersion() const - { - WirelessFwInfo_t wirelessInfo; - SHCI_GetWirelessFwInfo(&wirelessInfo); - - return { - wirelessInfo.VersionMajor, - wirelessInfo.VersionMinor, - wirelessInfo.VersionSub, - wirelessInfo.VersionReleaseType, - wirelessInfo.FusVersionMajor, - wirelessInfo.FusVersionMinor, - wirelessInfo.FusVersionSub, - }; - } - - void SystemTransportLayer::HandleErrorNotifyEvent(void* SysEvent) - {} - - void SystemTransportLayer::HandleBleNvmRamUpdateEvent(void* sysEvent) - { - bondBlobPersistence.Update(); - } - - void SystemTransportLayer::HandleUnknownEvent(void* SysEvent) - {} - - void SystemTransportLayer::UserEventHandler(void* payload) - { - auto event = reinterpret_cast((static_cast(payload)->pckt)->evtserial.evt.payload); - - switch (event->subevtcode) - { - case SHCI_SUB_EVT_CODE_READY: - HandleReadyEvent(payload); - break; - case SHCI_SUB_EVT_ERROR_NOTIF: - HandleErrorNotifyEvent(event); - break; - case SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE: - HandleBleNvmRamUpdateEvent(event); - break; - default: - HandleUnknownEvent(event); - break; - } - } - - void SystemTransportLayer::HandleWirelessFwEvent(void*) - { - ShciCore2Init(configuration); - bondStorageSynchronizerCreator.Emplace(); - - if (onInitialized) - onInitialized(*bondStorageSynchronizerCreator); - } - - void SystemTransportLayer::HandleFusFwEvent(void* payload) - { - ((tSHCI_UserEvtRxParam*)payload)->status = SHCI_TL_UserEventFlow_Disable; - } - - void SystemTransportLayer::HandleUnknwownReadyEvent(void* payload) - {} - - void SystemTransportLayer::HandleReadyEvent(void* payload) - { - auto event = reinterpret_cast((static_cast(payload)->pckt)->evtserial.evt.payload); - auto readyEvent = reinterpret_cast(event->payload); - - switch (readyEvent->sysevt_ready_rsp) - { - case WIRELESS_FW_RUNNING: - HandleWirelessFwEvent(payload); - break; - case FUS_FW_RUNNING: - HandleFusFwEvent(payload); - break; - default: - HandleUnknwownReadyEvent(payload); - break; - } - } - - void SystemTransportLayer::ShciInit() - { - SHCI_TL_HciInitConf_t config; - config.p_cmdbuffer = reinterpret_cast(&systemCmdBuffer); - config.StatusNotCallBack = ShciCommandStatus; - shci_init(ShciUserEventHandler, static_cast(&config)); - } - - void SystemTransportLayer::HciInit() - { - HCI_TL_HciInitConf_t config; - config.p_cmdbuffer = reinterpret_cast(&bleCmdBuffer); - config.StatusNotCallBack = HciCommandStatus; - hci_init(HciUserEventHandler, static_cast(&config)); - } - - void SystemTransportLayer::MemoryChannelInit() - { - TL_MM_Config_t config; - config.p_BleSpareEvtBuffer = bleSpareEvtBuffer; - config.p_SystemSpareEvtBuffer = systemSpareEvtBuffer; - config.p_AsynchEvtPool = evtPool; - config.AsynchEvtPoolSize = poolSize; - TL_MM_Init(&config); - } -} +#include "hal_st/middlewares/ble_middleware/SystemTransportLayerWb.hpp" +#include "infra/event/EventDispatcherWithWeakPtr.hpp" +#include +#include "hci_tl.h" +#include "interface/patterns/ble_thread/tl/tl.h" +#include "shci.h" +#include "shci_tl.h" +#include "stm32wbxx_ll_system.h" + +extern "C" +{ + SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void* packet) + { + assert(packet != nullptr); + + auto& event = *reinterpret_cast(static_cast(packet)->data); + hal::SystemTransportLayerWb::Instance().HciEventHandler(event); + + return SVCCTL_UserEvtFlowEnable; + } + + void hci_notify_asynch_evt(void* data) + { + static std::atomic_bool notificationScheduled{ false }; + + if (!notificationScheduled.exchange(true)) + infra::EventDispatcher::Instance().Schedule([]() + { + notificationScheduled = false; + hci_user_evt_proc(); + }); + } + + void shci_notify_asynch_evt(void* data) + { + static std::atomic_bool notificationScheduled{ false }; + + if (!notificationScheduled.exchange(true)) + infra::EventDispatcher::Instance().Schedule([]() + { + notificationScheduled = false; + shci_user_evt_proc(); + }); + } +} + +namespace +{ + const uint32_t bleBondsStorageLength = 507; + const uint8_t bleEventQueueLength = 0x05; + const uint8_t tlBleMaxEventPayloadSize = 0xFF; + const uint16_t bleEventFrameSize = TL_EVT_HDR_SIZE + tlBleMaxEventPayloadSize; + const uint32_t poolSize = bleEventQueueLength * 4u * DIVC((sizeof(TL_PacketHeader_t) + bleEventFrameSize), 4u); + + // Buffers to be used by the mailbox to report the events + [[gnu::section("MB_MEM2")]] alignas(4) uint8_t evtPool[poolSize]; + [[gnu::section("MB_MEM2")]] alignas(4) uint8_t systemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; + [[gnu::section("MB_MEM2")]] alignas(4) uint8_t bleSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; + [[gnu::section("MB_MEM2")]] uint32_t bleBondsStorage[bleBondsStorageLength]; + + // Buffer to be used by the mailbox driver to send a BLE command + [[gnu::section("MB_MEM2")]] alignas(4) TL_CmdPacket_t systemCmdBuffer; + [[gnu::section("MB_MEM1")]] alignas(4) TL_CmdPacket_t bleCmdBuffer; + + // This is the registered callback in shci_init() to acknowledge if a system command can be + // sent. It must be used in a multi-thread application where system commands may be sent + // from different threads + void ShciCommandStatus(SHCI_TL_CmdStatus_t status) + {} + + // To be used in a multi-thread application where the BLE commands may be sent from different threads + void HciCommandStatus(HCI_TL_CmdStatus_t status) + {} + + void ShciUserEventHandler(void* payload) + { + hal::SystemTransportLayerWb::Instance().UserEventHandler(payload); + } + + void HciUserEventHandler(void* payload) + { + auto pParam = static_cast(payload); + auto svctlReturnStatus = SVCCTL_UserEvtRx(static_cast(&(pParam->pckt->evtserial))); + + if (svctlReturnStatus != SVCCTL_UserEvtFlowDisable) + pParam->status = HCI_TL_UserEventFlow_Enable; + else + pParam->status = HCI_TL_UserEventFlow_Disable; + } + + uint8_t ToLowSpeedClock(hal::SystemTransportLayerWb::RfWakeupClock rfWakeupClock) + { + if (rfWakeupClock == hal::SystemTransportLayerWb::RfWakeupClock::highSpeedExternal) + return SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_HSE_1024; + else + return SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE; + } + + void ShciCore2Init(const hal::SystemTransportLayerWb::Configuration& configuration) + { + const uint8_t maxNumberOfBleLinks = 0x01; + const uint8_t prepareWriteListSize = BLE_PREP_WRITE_X_ATT(configuration.maxAttMtuSize); + const uint8_t numberOfBleMemoryBlocks = BLE_MBLOCKS_CALC(prepareWriteListSize, configuration.maxAttMtuSize, maxNumberOfBleLinks); + const uint8_t bleStackOptions = (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO | SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2 | + SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 | SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY | SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED); + + SHCI_C2_CONFIG_Cmd_Param_t configParam = { + SHCI_C2_CONFIG_PAYLOAD_CMD_SIZE, + SHCI_C2_CONFIG_CONFIG1_BIT0_BLE_NVM_DATA_TO_SRAM, + SHCI_C2_CONFIG_EVTMASK1_BIT1_BLE_NVM_RAM_UPDATE_ENABLE, + 0, // Spare + reinterpret_cast(bleBondsStorage), + 0, // ThreadNvmRamAddress + static_cast(LL_DBGMCU_GetRevisionID()), + static_cast(LL_DBGMCU_GetDeviceID()), + }; + + if (SHCI_C2_Config(&configParam) != SHCI_Success) + std::abort(); + + SHCI_C2_Ble_Init_Cmd_Packet_t bleInitCmdPacket = { + { { 0, 0, 0 } }, // Header (unused) + { + 0x00, // BLE buffer address (unused) + 0x00, // BLE buffer size (unused) + 0x44, // Maximum number of GATT Attributes + 0x08, // Maximum number of Services that can be stored in the GATT database + 0x540, // Size of the storage area for Attribute values + maxNumberOfBleLinks, + 0x01, // Enable or disable the Extended Packet length feature + prepareWriteListSize, + numberOfBleMemoryBlocks, + configuration.maxAttMtuSize, + 0x1FA, // Sleep clock accuracy in Slave mode + 0x00, // Sleep clock accuracy in Master mode + ToLowSpeedClock(configuration.rfWakeupClock), // Source for the low speed clock for RF wake-up + 0xFFFFFFFF, // Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) + 0x148, // Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) + 0x01, // Viterbi Mode + bleStackOptions, + 0, // HW version (unused) + 32, // Maximum number of connection-oriented channels in initiator mode + -40, // Minimum transmit power in dBm supported by the Controller + 6, // Maximum transmit power in dBm supported by the Controller + SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY, + 3, // Maximum number of advertising sets. + 1650, // Maximum advertising data length (in bytes) + 0, // RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB. + 0, // RF RX Path Compensation Value (16-bit signed integer). Units: 0.1 dB. + SHCI_C2_BLE_INIT_BLE_CORE_5_3 } + }; + + if (SHCI_C2_BLE_Init(&bleInitCmdPacket) != SHCI_Success) + std::abort(); + } +} + +namespace hal +{ + SystemTransportLayerWb::SystemTransportLayerWb(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized) + : bondBlobPersistence(flashStorage, infra::MakeByteRange(bleBondsStorage)) + , bondStorageSynchronizerCreator(bondStorageSynchronizerCreator) + , configuration(configuration) + , onInitialized(onInitialized) + { + really_assert(configuration.maxAttMtuSize >= BLE_DEFAULT_ATT_MTU && configuration.maxAttMtuSize <= 251); + // BLE middleware supported maxAttMtuSize = 512. Current usage of library limits maxAttMtuSize to 251 (max HCI buffer size) + + TL_Init(); + ShciInit(); + HciInit(); + MemoryChannelInit(); + TL_Enable(); + } + + void SystemTransportLayerWb::HciEventHandler(hci_event_pckt& event) + { + infra::Subject::NotifyObservers([&event](auto& observer) + { + observer.HciEvent(event); + }); + } + + SystemTransportLayerWb::Version SystemTransportLayerWb::GetVersion() const + { + WirelessFwInfo_t wirelessInfo; + SHCI_GetWirelessFwInfo(&wirelessInfo); + + return { + wirelessInfo.VersionMajor, + wirelessInfo.VersionMinor, + wirelessInfo.VersionSub, + wirelessInfo.VersionReleaseType, + wirelessInfo.FusVersionMajor, + wirelessInfo.FusVersionMinor, + wirelessInfo.FusVersionSub, + }; + } + + void SystemTransportLayerWb::HandleErrorNotifyEvent(void* SysEvent) + {} + + void SystemTransportLayerWb::HandleBleNvmRamUpdateEvent(void* sysEvent) + { + bondBlobPersistence.Update(); + } + + void SystemTransportLayerWb::HandleUnknownEvent(void* SysEvent) + {} + + void SystemTransportLayerWb::UserEventHandler(void* payload) + { + auto event = reinterpret_cast((static_cast(payload)->pckt)->evtserial.evt.payload); + + switch (event->subevtcode) + { + case SHCI_SUB_EVT_CODE_READY: + HandleReadyEvent(payload); + break; + case SHCI_SUB_EVT_ERROR_NOTIF: + HandleErrorNotifyEvent(event); + break; + case SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE: + HandleBleNvmRamUpdateEvent(event); + break; + default: + HandleUnknownEvent(event); + break; + } + } + + void SystemTransportLayerWb::HandleWirelessFwEvent(void*) + { + ShciCore2Init(configuration); + bondStorageSynchronizerCreator.Emplace(); + + if (onInitialized) + onInitialized(*bondStorageSynchronizerCreator); + } + + void SystemTransportLayerWb::HandleFusFwEvent(void* payload) + { + ((tSHCI_UserEvtRxParam*)payload)->status = SHCI_TL_UserEventFlow_Disable; + } + + void SystemTransportLayerWb::HandleUnknwownReadyEvent(void* payload) + {} + + void SystemTransportLayerWb::HandleReadyEvent(void* payload) + { + auto event = reinterpret_cast((static_cast(payload)->pckt)->evtserial.evt.payload); + auto readyEvent = reinterpret_cast(event->payload); + + switch (readyEvent->sysevt_ready_rsp) + { + case WIRELESS_FW_RUNNING: + HandleWirelessFwEvent(payload); + break; + case FUS_FW_RUNNING: + HandleFusFwEvent(payload); + break; + default: + HandleUnknwownReadyEvent(payload); + break; + } + } + + void SystemTransportLayerWb::ShciInit() + { + SHCI_TL_HciInitConf_t config; + config.p_cmdbuffer = reinterpret_cast(&systemCmdBuffer); + config.StatusNotCallBack = ShciCommandStatus; + shci_init(ShciUserEventHandler, static_cast(&config)); + } + + void SystemTransportLayerWb::HciInit() + { + HCI_TL_HciInitConf_t config; + config.p_cmdbuffer = reinterpret_cast(&bleCmdBuffer); + config.StatusNotCallBack = HciCommandStatus; + hci_init(HciUserEventHandler, static_cast(&config)); + } + + void SystemTransportLayerWb::MemoryChannelInit() + { + TL_MM_Config_t config; + config.p_BleSpareEvtBuffer = bleSpareEvtBuffer; + config.p_SystemSpareEvtBuffer = systemSpareEvtBuffer; + config.p_AsynchEvtPool = evtPool; + config.AsynchEvtPoolSize = poolSize; + TL_MM_Init(&config); + } +} diff --git a/hal_st/middlewares/ble_middleware/SystemTransportLayer.hpp b/hal_st/middlewares/ble_middleware/SystemTransportLayerWb.hpp similarity index 79% rename from hal_st/middlewares/ble_middleware/SystemTransportLayer.hpp rename to hal_st/middlewares/ble_middleware/SystemTransportLayerWb.hpp index 88ee1fd6..a86be296 100644 --- a/hal_st/middlewares/ble_middleware/SystemTransportLayer.hpp +++ b/hal_st/middlewares/ble_middleware/SystemTransportLayerWb.hpp @@ -1,78 +1,78 @@ -#ifndef HAL_ST_SYSTEM_TRANSPORT_LAYER_HPP -#define HAL_ST_SYSTEM_TRANSPORT_LAYER_HPP - -#include "ble/ble.h" -#include "hal_st/middlewares/ble_middleware/HciEventObserver.hpp" -#include "infra/util/Function.hpp" -#include "infra/util/InterfaceConnector.hpp" -#include "infra/util/ProxyCreator.hpp" -#include "services/ble/BondBlobPersistence.hpp" -#include "services/ble/BondStorageSynchronizer.hpp" - -namespace hal -{ - class SystemTransportLayer - : public infra::InterfaceConnector - , public HciEventSource - { - public: - enum class RfWakeupClock : uint8_t - { - highSpeedExternal, - lowSpeedExternal, - }; - - struct Configuration - { - uint16_t maxAttMtuSize; - RfWakeupClock rfWakeupClock; - }; - - struct Version - { - uint8_t firmwareMajor; - uint8_t firmwareMinor; - uint8_t firmwareSub; - uint8_t firmwareReleaseType; - - uint8_t fusMajor; - uint8_t fusMinor; - uint8_t fusSub; - }; - - public: - using BondStorageSynchronizerCreator = infra::CreatorBase; - - SystemTransportLayer(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized); - - Version GetVersion() const; - - // Implementation of HciEventSource - void HciEventHandler(hci_event_pckt& event) override; - - virtual void UserEventHandler(void* payload); - - protected: - virtual void HandleReadyEvent(void* payload); - virtual void HandleErrorNotifyEvent(void* event); - virtual void HandleBleNvmRamUpdateEvent(void* sysEvent); - virtual void HandleUnknownEvent(void* event); - - virtual void HandleWirelessFwEvent(void* payload); - virtual void HandleFusFwEvent(void* payload); - virtual void HandleUnknwownReadyEvent(void* payload); - - private: - void ShciInit(); - void HciInit(); - void MemoryChannelInit(); - - private: - services::BondBlobPersistence bondBlobPersistence; - infra::DelayedProxyCreator bondStorageSynchronizerCreator; - Configuration configuration; - infra::AutoResetFunction onInitialized; - }; -} - -#endif +#ifndef HAL_ST_SYSTEM_TRANSPORT_LAYER_WB_HPP +#define HAL_ST_SYSTEM_TRANSPORT_LAYER_WB_HPP + +#include "ble/ble.h" +#include "hal_st/middlewares/ble_middleware/HciEventObserver.hpp" +#include "infra/util/Function.hpp" +#include "infra/util/InterfaceConnector.hpp" +#include "infra/util/ProxyCreator.hpp" +#include "services/ble/BondBlobPersistence.hpp" +#include "services/ble/BondStorageSynchronizer.hpp" + +namespace hal +{ + class SystemTransportLayerWb + : public infra::InterfaceConnector + , public HciEventSource + { + public: + enum class RfWakeupClock : uint8_t + { + highSpeedExternal, + lowSpeedExternal, + }; + + struct Configuration + { + uint16_t maxAttMtuSize; + RfWakeupClock rfWakeupClock; + }; + + struct Version + { + uint8_t firmwareMajor; + uint8_t firmwareMinor; + uint8_t firmwareSub; + uint8_t firmwareReleaseType; + + uint8_t fusMajor; + uint8_t fusMinor; + uint8_t fusSub; + }; + + public: + using BondStorageSynchronizerCreator = infra::CreatorBase; + + SystemTransportLayerWb(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized); + + Version GetVersion() const; + + // Implementation of HciEventSource + void HciEventHandler(hci_event_pckt& event) override; + + virtual void UserEventHandler(void* payload); + + protected: + virtual void HandleReadyEvent(void* payload); + virtual void HandleErrorNotifyEvent(void* event); + virtual void HandleBleNvmRamUpdateEvent(void* sysEvent); + virtual void HandleUnknownEvent(void* event); + + virtual void HandleWirelessFwEvent(void* payload); + virtual void HandleFusFwEvent(void* payload); + virtual void HandleUnknwownReadyEvent(void* payload); + + private: + void ShciInit(); + void HciInit(); + void MemoryChannelInit(); + + private: + services::BondBlobPersistence bondBlobPersistence; + infra::DelayedProxyCreator bondStorageSynchronizerCreator; + Configuration configuration; + infra::AutoResetFunction onInitialized; + }; +} + +#endif diff --git a/hal_st/middlewares/ble_middleware/SystemTransportLayerWba.cpp b/hal_st/middlewares/ble_middleware/SystemTransportLayerWba.cpp new file mode 100644 index 00000000..7bd8e706 --- /dev/null +++ b/hal_st/middlewares/ble_middleware/SystemTransportLayerWba.cpp @@ -0,0 +1,95 @@ +#include "hal_st/middlewares/ble_middleware/SystemTransportLayerWba.hpp" +#include +extern "C" +{ +#include "ble_common.h" +#include "ble_bufsize.h" +#include "blestack.h" +} + +extern "C" +{ + SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void* packet) + { + assert(packet != nullptr); + + auto& event = *reinterpret_cast(static_cast(packet)->data); + hal::SystemTransportLayerWba::Instance().HciEventHandler(event); + + return SVCCTL_UserEvtFlowEnable; + } + + tBleStatus ProcessEventPacket(const uint8_t* data) + { + SVCCTL_UserEvtRx(const_cast(data)); + return BLE_STATUS_SUCCESS; + } + + tBleStatus BLECB_Indication(const uint8_t* data, uint16_t, const uint8_t*, uint16_t) + { + if (data[0] == HCI_EVENT_PKT_TYPE) + return ProcessEventPacket(data); + else if (data[0] == HCI_ACLDATA_PKT_TYPE) + return BLE_STATUS_SUCCESS; + + return BLE_STATUS_FAILED; + } +} + +namespace +{ + const uint8_t maxNumberOfBleLinks = 0x01; + const uint8_t numAttrRecord = 0x44; + const uint8_t numAttrServ = 0x08; + const uint16_t attrValueArrSize = 0x540; + const uint8_t maxNumberOfConnectionOrientedChannels = 32; + const std::size_t mblockCount = (BLE_MBLOCKS_CALC(BLE_DEFAULT_PREP_WRITE_LIST_SIZE, 251, maxNumberOfBleLinks) + 0x15); + const std::size_t bufferSize = BLE_TOTAL_BUFFER_SIZE(maxNumberOfBleLinks, mblockCount); + const std::size_t gattBufferSize = BLE_TOTAL_BUFFER_SIZE_GATT(numAttrRecord, numAttrServ, attrValueArrSize); + std::array bleBuffer; + std::array bleGattBuffer; + const uint8_t bleStackOptions = 0; + + constexpr uint8_t PrepareWriteListSize(uint16_t maxAttMtuSize) + { + return static_cast(BLE_PREP_WRITE_X_ATT(maxAttMtuSize)); + } +} + +namespace hal +{ + SystemTransportLayerWba::SystemTransportLayerWba(uint16_t maxAttMtuSize) + { + really_assert(maxAttMtuSize >= BLE_DEFAULT_ATT_MTU && maxAttMtuSize <= 251); + // BLE middleware supported maxAttMtuSize = 512. Current usage of library limits maxAttMtuSize to 251 (max HCI buffer size) + + BleStack_init_t bleStackInitParameters = { + reinterpret_cast(bleBuffer.begin()), + bufferSize, + reinterpret_cast(bleGattBuffer.begin()), + gattBufferSize, + numAttrRecord, + numAttrServ, + attrValueArrSize, + maxNumberOfBleLinks, + PrepareWriteListSize(maxAttMtuSize), + mblockCount, + maxAttMtuSize, + 248, + 64, + maxNumberOfConnectionOrientedChannels, + bleStackOptions, + 0U + }; + + really_assert(BleStack_Init(&bleStackInitParameters) == BLE_STATUS_SUCCESS); + } + + void SystemTransportLayerWba::HciEventHandler(hci_event_pckt& event) + { + infra::Subject::NotifyObservers([&event](auto& observer) + { + observer.HciEvent(event); + }); + } +} diff --git a/hal_st/middlewares/ble_middleware/SystemTransportLayerWba.hpp b/hal_st/middlewares/ble_middleware/SystemTransportLayerWba.hpp new file mode 100644 index 00000000..b6692244 --- /dev/null +++ b/hal_st/middlewares/ble_middleware/SystemTransportLayerWba.hpp @@ -0,0 +1,21 @@ +#ifndef HAL_ST_SYSTEM_TRANSPORT_LAYER_WBA_HPP +#define HAL_ST_SYSTEM_TRANSPORT_LAYER_WBA_HPP + +#include "hal_st/middlewares/ble_middleware/HciEventObserver.hpp" +#include "infra/util/InterfaceConnector.hpp" + +namespace hal +{ + class SystemTransportLayerWba + : public infra::InterfaceConnector + , public HciEventSource + { + public: + explicit SystemTransportLayerWba(uint16_t maxAttMtuSize); + + // Implementation of HciEventSource + void HciEventHandler(hci_event_pckt& event) override; + }; +} + +#endif diff --git a/hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.cpp b/hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.cpp deleted file mode 100644 index 555ef9fb..00000000 --- a/hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.hpp" -#include "shci.h" -#include "shci_tl.h" - -namespace hal -{ - TracingSystemTransportLayer::TracingSystemTransportLayer(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized, services::Tracer& tracer) - : SystemTransportLayer(flashStorage, bondStorageSynchronizerCreator, configuration, onInitialized) - , tracer(tracer) - {} - - void TracingSystemTransportLayer::UserEventHandler(void* pPayload) - { - SystemTransportLayer::UserEventHandler(pPayload); - } - - void TracingSystemTransportLayer::HandleReadyEvent(void* pPayload) - { - const auto transportLayerVersion = GetVersion(); - - tracer.Trace() << "Wireless Firmware version: " << transportLayerVersion.firmwareMajor << "." << transportLayerVersion.firmwareMinor << "." << transportLayerVersion.firmwareSub; - tracer.Trace() << "Wireless Firmware build: " << transportLayerVersion.firmwareReleaseType; - tracer.Trace() << "FUS version: " << transportLayerVersion.fusMajor << "." << transportLayerVersion.fusMinor << "." << transportLayerVersion.fusSub; - tracer.Trace() << "SystemTransportLayer::UserEventHandler: SHCI_SUB_EVT_CODE_READY"; - - SystemTransportLayer::HandleReadyEvent(pPayload); - } - - void TracingSystemTransportLayer::HandleErrorNotifyEvent(void* sysEvent) - { - tracer.Trace() << "SystemTransportLayer::UserEventHandler: SHCI_SUB_EVT_ERROR_NOTIF"; - SystemTransportLayer::HandleErrorNotifyEvent(sysEvent); - } - - void TracingSystemTransportLayer::HandleBleNvmRamUpdateEvent(void* sysEvent) - { - auto& bleNvmRamUpdateEvent = *reinterpret_cast(reinterpret_cast(sysEvent)->payload); - tracer.Trace() << "SystemTransportLayer::UserEventHandler: SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE : size: " << bleNvmRamUpdateEvent.Size << ", address: 0x" << infra::hex << bleNvmRamUpdateEvent.StartAddress; - SystemTransportLayer::HandleBleNvmRamUpdateEvent(sysEvent); - } - - void TracingSystemTransportLayer::HandleUnknownEvent(void* sysEvent) - { - auto subEventCode = reinterpret_cast(sysEvent)->subevtcode; - tracer.Trace() << "SystemTransportLayer::UserEventHandler: Unsupported event found (" << subEventCode << ")"; - SystemTransportLayer::HandleUnknownEvent(sysEvent); - } - - void TracingSystemTransportLayer::HandleWirelessFwEvent(void* pPayload) - { - tracer.Trace() << "SystemTransportLayer::HandleReadyEvent: WIRELESS_FW_RUNNING"; - SystemTransportLayer::HandleWirelessFwEvent(pPayload); - } - - void TracingSystemTransportLayer::HandleFusFwEvent(void* pPayload) - { - tracer.Trace() << "SystemTransportLayer::HandleReadyEvent: FUS_FW_RUNNING"; - SystemTransportLayer::HandleFusFwEvent(pPayload); - } - - void TracingSystemTransportLayer::HandleUnknwownReadyEvent(void* pPayload) - { - auto pSysEvent = reinterpret_cast((static_cast(pPayload)->pckt)->evtserial.evt.payload); - auto pSysReadyEvent = reinterpret_cast(pSysEvent->payload); - tracer.Trace() << "SystemTransportLayer::HandleReadyEvent: Unsupported event found (" << pSysReadyEvent->sysevt_ready_rsp << ")"; - SystemTransportLayer::HandleUnknwownReadyEvent(pPayload); - } -} diff --git a/hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.cpp b/hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.cpp new file mode 100644 index 00000000..2652c50b --- /dev/null +++ b/hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.cpp @@ -0,0 +1,68 @@ +#include "hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.hpp" +#include "shci.h" +#include "shci_tl.h" + +namespace hal +{ + TracingSystemTransportLayerWb::TracingSystemTransportLayerWb(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized, services::Tracer& tracer) + : SystemTransportLayerWb(flashStorage, bondStorageSynchronizerCreator, configuration, onInitialized) + , tracer(tracer) + {} + + void TracingSystemTransportLayerWb::UserEventHandler(void* pPayload) + { + SystemTransportLayerWb::UserEventHandler(pPayload); + } + + void TracingSystemTransportLayerWb::HandleReadyEvent(void* pPayload) + { + const auto transportLayerVersion = GetVersion(); + + tracer.Trace() << "Wireless Firmware version: " << transportLayerVersion.firmwareMajor << "." << transportLayerVersion.firmwareMinor << "." << transportLayerVersion.firmwareSub; + tracer.Trace() << "Wireless Firmware build: " << transportLayerVersion.firmwareReleaseType; + tracer.Trace() << "FUS version: " << transportLayerVersion.fusMajor << "." << transportLayerVersion.fusMinor << "." << transportLayerVersion.fusSub; + tracer.Trace() << "SystemTransportLayerWb::UserEventHandler: SHCI_SUB_EVT_CODE_READY"; + + SystemTransportLayerWb::HandleReadyEvent(pPayload); + } + + void TracingSystemTransportLayerWb::HandleErrorNotifyEvent(void* sysEvent) + { + tracer.Trace() << "SystemTransportLayerWb::UserEventHandler: SHCI_SUB_EVT_ERROR_NOTIF"; + SystemTransportLayerWb::HandleErrorNotifyEvent(sysEvent); + } + + void TracingSystemTransportLayerWb::HandleBleNvmRamUpdateEvent(void* sysEvent) + { + auto& bleNvmRamUpdateEvent = *reinterpret_cast(reinterpret_cast(sysEvent)->payload); + tracer.Trace() << "SystemTransportLayerWb::UserEventHandler: SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE : size: " << bleNvmRamUpdateEvent.Size << ", address: 0x" << infra::hex << bleNvmRamUpdateEvent.StartAddress; + SystemTransportLayerWb::HandleBleNvmRamUpdateEvent(sysEvent); + } + + void TracingSystemTransportLayerWb::HandleUnknownEvent(void* sysEvent) + { + auto subEventCode = reinterpret_cast(sysEvent)->subevtcode; + tracer.Trace() << "SystemTransportLayerWb::UserEventHandler: Unsupported event found (" << subEventCode << ")"; + SystemTransportLayerWb::HandleUnknownEvent(sysEvent); + } + + void TracingSystemTransportLayerWb::HandleWirelessFwEvent(void* pPayload) + { + tracer.Trace() << "SystemTransportLayerWb::HandleReadyEvent: WIRELESS_FW_RUNNING"; + SystemTransportLayerWb::HandleWirelessFwEvent(pPayload); + } + + void TracingSystemTransportLayerWb::HandleFusFwEvent(void* pPayload) + { + tracer.Trace() << "SystemTransportLayerWb::HandleReadyEvent: FUS_FW_RUNNING"; + SystemTransportLayerWb::HandleFusFwEvent(pPayload); + } + + void TracingSystemTransportLayerWb::HandleUnknwownReadyEvent(void* pPayload) + { + auto pSysEvent = reinterpret_cast((static_cast(pPayload)->pckt)->evtserial.evt.payload); + auto pSysReadyEvent = reinterpret_cast(pSysEvent->payload); + tracer.Trace() << "SystemTransportLayerWb::HandleReadyEvent: Unsupported event found (" << pSysReadyEvent->sysevt_ready_rsp << ")"; + SystemTransportLayerWb::HandleUnknwownReadyEvent(pPayload); + } +} diff --git a/hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.hpp b/hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.hpp similarity index 57% rename from hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.hpp rename to hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.hpp index c0b62199..3e643950 100644 --- a/hal_st/middlewares/ble_middleware/TracingSystemTransportLayer.hpp +++ b/hal_st/middlewares/ble_middleware/TracingSystemTransportLayerWb.hpp @@ -1,31 +1,31 @@ -#ifndef HAL_ST_TRACING_SYSTEM_TRANSPORT_LAYER_HPP -#define HAL_ST_TRACING_SYSTEM_TRANSPORT_LAYER_HPP - -#include "hal_st/middlewares/ble_middleware/SystemTransportLayer.hpp" -#include "services/tracer/Tracer.hpp" - -namespace hal -{ - class TracingSystemTransportLayer - : public SystemTransportLayer - { - public: - TracingSystemTransportLayer(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized, services::Tracer& tracer); - - protected: - void UserEventHandler(void* pPayload) override; - void HandleReadyEvent(void* pPayload) override; - void HandleErrorNotifyEvent(void* sysEvent) override; - void HandleBleNvmRamUpdateEvent(void* sysEvent) override; - void HandleUnknownEvent(void* sysEvent) override; - - void HandleWirelessFwEvent(void* pPayload) override; - void HandleFusFwEvent(void* pPayload) override; - void HandleUnknwownReadyEvent(void* pPayload) override; - - private: - services::Tracer& tracer; - }; -} - -#endif +#ifndef HAL_ST_TRACING_SYSTEM_TRANSPORT_LAYER_WB_HPP +#define HAL_ST_TRACING_SYSTEM_TRANSPORT_LAYER_WB_HPP + +#include "hal_st/middlewares/ble_middleware/SystemTransportLayerWb.hpp" +#include "services/tracer/Tracer.hpp" + +namespace hal +{ + class TracingSystemTransportLayerWb + : public SystemTransportLayerWb + { + public: + TracingSystemTransportLayerWb(services::ConfigurationStoreAccess flashStorage, BondStorageSynchronizerCreator& bondStorageSynchronizerCreator, Configuration configuration, const infra::Function& onInitialized, services::Tracer& tracer); + + protected: + void UserEventHandler(void* pPayload) override; + void HandleReadyEvent(void* pPayload) override; + void HandleErrorNotifyEvent(void* sysEvent) override; + void HandleBleNvmRamUpdateEvent(void* sysEvent) override; + void HandleUnknownEvent(void* sysEvent) override; + + void HandleWirelessFwEvent(void* pPayload) override; + void HandleFusFwEvent(void* pPayload) override; + void HandleUnknwownReadyEvent(void* pPayload) override; + + private: + services::Tracer& tracer; + }; +} + +#endif