From 5a40f80bde619f370dcd20d9886241ba4ea352b2 Mon Sep 17 00:00:00 2001 From: shgutte Date: Tue, 30 Jan 2024 10:35:46 +0530 Subject: [PATCH 01/10] Added changes for BLE TX timeout --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index a32d46b30f2715..cce3196c840f77 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -247,6 +247,7 @@ namespace { #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value #define BLE_DEFAULT_TIMER_PERIOD_MS (1) +#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (10) TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. @@ -465,12 +466,22 @@ uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const return (conState != NULL) ? conState->mtu : 0; } +void BLEManagerImpl::OnSendIndicationTimeout(System::Layer * aLayer, void * appState) +{ + BLEManagerImpl * pBLEManagerImpl = reinterpret_cast(appState); + pBLEManagerImpl->HandleSoftTimerEvent(); +} + bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, PacketBufferHandle data) { int32_t status = 0; - status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), + status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), data->Start()); + + // start timer for light indication confirmation. Long delay for spake2 indication + DeviceLayer::SystemLayer().StartTimer(Clock::Milliseconds32(BLE_SEND_INDICATION_TIMER_PERIOD_MS), OnSendIndicationTimeout, this); + if (status != RSI_SUCCESS) { ChipLogProgress(DeviceLayer, "indication failed with error code %lx ", status); @@ -924,13 +935,20 @@ void BLEManagerImpl::HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId) ChipDeviceEvent event; event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; event.CHIPoBLEIndicateConfirm.ConId = conId; + DeviceLayer::SystemLayer().CancelTimer(BLEManagerImpl, this); PlatformMgr().PostEventOrDie(&event); } -// TODO:: Need to Implement + void BLEManagerImpl::HandleSoftTimerEvent(void) { - // TODO:: Need to Implement + ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEConnectionError; + event.CHIPoBLEConnectionError.ConId = mIndConfId[evt->data.evt_system_soft_timer.handle]; + sInstance.mIndConfId[evt->data.evt_system_soft_timer.handle] = kUnusedIndex; + event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; + PlatformMgr().PostEventOrDie(&event); } bool BLEManagerImpl::RemoveConnection(uint8_t connectionHandle) From 6b81817b0186fd39adc7d534587bc8462b8d8541 Mon Sep 17 00:00:00 2001 From: shgutte Date: Tue, 30 Jan 2024 10:39:03 +0530 Subject: [PATCH 02/10] Added changes for the BLE callback handler --- src/platform/silabs/BLEManagerImpl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index 12b3ba121886af..b9c602f16030a8 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -209,6 +209,12 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla static void DriveBLEState(intptr_t arg); static void BleAdvTimeoutHandler(TimerHandle_t xTimer); uint8_t GetTimerHandle(uint8_t connectionHandle, bool allocate); + + + #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) + protected: + static void OnSendIndicationTimeout(System::Layer * aLayer, void * appState); +#endif }; /** From 41f5afba87c0808b60a3935c6aeed034c00e5b81 Mon Sep 17 00:00:00 2001 From: shgutte Date: Tue, 30 Jan 2024 10:52:27 +0530 Subject: [PATCH 03/10] Added changes for the build error for the TX timer fix --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index cce3196c840f77..534f1371c84f1d 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -480,7 +480,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU data->Start()); // start timer for light indication confirmation. Long delay for spake2 indication - DeviceLayer::SystemLayer().StartTimer(Clock::Milliseconds32(BLE_SEND_INDICATION_TIMER_PERIOD_MS), OnSendIndicationTimeout, this); + DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(BLE_SEND_INDICATION_TIMER_PERIOD_MS), OnSendIndicationTimeout, this); if (status != RSI_SUCCESS) { @@ -935,18 +935,18 @@ void BLEManagerImpl::HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId) ChipDeviceEvent event; event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; event.CHIPoBLEIndicateConfirm.ConId = conId; - DeviceLayer::SystemLayer().CancelTimer(BLEManagerImpl, this); + DeviceLayer::SystemLayer().CancelTimer(OnSendIndicationTimeout, this); PlatformMgr().PostEventOrDie(&event); } void BLEManagerImpl::HandleSoftTimerEvent(void) { + uint8_t connHandle = 1; ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); ChipDeviceEvent event; event.Type = DeviceEventType::kCHIPoBLEConnectionError; - event.CHIPoBLEConnectionError.ConId = mIndConfId[evt->data.evt_system_soft_timer.handle]; - sInstance.mIndConfId[evt->data.evt_system_soft_timer.handle] = kUnusedIndex; + event.CHIPoBLEConnectionError.ConId = connHandle; event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; PlatformMgr().PostEventOrDie(&event); } From cfc4116fb51d89b21e04fe58beea15e6f3d3ea4b Mon Sep 17 00:00:00 2001 From: shgutte Date: Fri, 2 Feb 2024 08:52:56 +0530 Subject: [PATCH 04/10] Added changes for TX timer --- src/platform/silabs/BLEManagerImpl.h | 9 ++-- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 51 +++++++++++++++---- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index b9c602f16030a8..712d6cdb2d4e15 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -198,6 +198,9 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) void HandleRXCharWrite(rsi_ble_event_write_t * evt); + void StartBleSendIndicationTimeoutTimer(uint32_t aTimeoutInMs); + void CancelBleSendIndicationTimeoutTimer(void); + static void BleSendIndicationTimeoutHandler(TimerHandle_t xTimer); #else void HandleRXCharWrite(volatile sl_bt_msg_t * evt); #endif @@ -209,12 +212,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla static void DriveBLEState(intptr_t arg); static void BleAdvTimeoutHandler(TimerHandle_t xTimer); uint8_t GetTimerHandle(uint8_t connectionHandle, bool allocate); - - - #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) - protected: - static void OnSendIndicationTimeout(System::Layer * aLayer, void * appState); -#endif }; /** diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 534f1371c84f1d..c4c07aeb3b9378 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -250,6 +250,7 @@ namespace { #define BLE_SEND_INDICATION_TIMER_PERIOD_MS (10) TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. +TimerHandle_t sbleSendIndicationTimeoutTimer; // FreeRTOS sw timer. const uint8_t UUID_CHIPoBLEService[] = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 }; @@ -294,6 +295,13 @@ CHIP_ERROR BLEManagerImpl::_Init() BleAdvTimeoutHandler // timer callback handler ); + sbleSendIndicationTimeoutTimer = xTimerCreate("SendIndicationTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(BLE_SEND_INDICATION_TIMER_PERIOD_MS), // == default timer period + false, // no timer reload (==one-shot) + (void *) this, // init timer id = ble obj context + BleAdvTimeoutHandler // timer callback handler + ); + mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); mFlags.Set(Flags::kFastAdvertisingEnabled, true); PlatformMgr().ScheduleWork(DriveBLEState, 0); @@ -466,12 +474,6 @@ uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const return (conState != NULL) ? conState->mtu : 0; } -void BLEManagerImpl::OnSendIndicationTimeout(System::Layer * aLayer, void * appState) -{ - BLEManagerImpl * pBLEManagerImpl = reinterpret_cast(appState); - pBLEManagerImpl->HandleSoftTimerEvent(); -} - bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, PacketBufferHandle data) { @@ -479,8 +481,9 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), data->Start()); - // start timer for light indication confirmation. Long delay for spake2 indication - DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(BLE_SEND_INDICATION_TIMER_PERIOD_MS), OnSendIndicationTimeout, this); + ChipLogProgress(DeviceLayer, "StartTimer start"); + StartBleSendIndicationTimeoutTimer(BLE_SEND_INDICATION_TIMER_PERIOD_MS); + ChipLogProgress(DeviceLayer, "StartTimer Stop"); if (status != RSI_SUCCESS) { @@ -935,8 +938,8 @@ void BLEManagerImpl::HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId) ChipDeviceEvent event; event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; event.CHIPoBLEIndicateConfirm.ConId = conId; - DeviceLayer::SystemLayer().CancelTimer(OnSendIndicationTimeout, this); PlatformMgr().PostEventOrDie(&event); + CancelBleSendIndicationTimeoutTimer(); } @@ -1119,6 +1122,36 @@ void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs) } } + +void BLEManagerImpl::BleSendIndicationTimeoutHandler(TimerHandle_t xTimer) +{ + sInstance.HandleSoftTimerEvent(); +} + +void BLEManagerImpl::CancelBleSendIndicationTimeoutTimer(void) +{ + if (xTimerStop(sbleSendIndicationTimeoutTimer, pdMS_TO_TICKS(0)) == pdFAIL) + { + ChipLogError(DeviceLayer, "Failed to stop BledAdv timeout timer"); + } +} + +void BLEManagerImpl::StartBleSendIndicationTimeoutTimer(uint32_t aTimeoutInMs) +{ + if (xTimerIsTimerActive(sbleSendIndicationTimeoutTimer)) + { + CancelBleAdvTimeoutTimer(); + } + + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sbleSendIndicationTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), pdMS_TO_TICKS(100)) != pdPASS) + { + ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer"); + } +} + void BLEManagerImpl::DriveBLEState(intptr_t arg) { sInstance.DriveBLEState(); From e9a27277ea7d73980a5b38b79a4bff2a4f399dda Mon Sep 17 00:00:00 2001 From: shgutte Date: Fri, 2 Feb 2024 08:55:52 +0530 Subject: [PATCH 05/10] Added restyler changes --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index c4c07aeb3b9378..84f303412c8ddf 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -478,7 +478,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU PacketBufferHandle data) { int32_t status = 0; - status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), + status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), data->Start()); ChipLogProgress(DeviceLayer, "StartTimer start"); From 295047382340ed0fe2051371df9a38601ea0c668 Mon Sep 17 00:00:00 2001 From: shgutte Date: Fri, 2 Feb 2024 15:00:00 +0530 Subject: [PATCH 06/10] Updated the timer handlle --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 84f303412c8ddf..45a331668bcf9f 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -299,7 +299,7 @@ CHIP_ERROR BLEManagerImpl::_Init() pdMS_TO_TICKS(BLE_SEND_INDICATION_TIMER_PERIOD_MS), // == default timer period false, // no timer reload (==one-shot) (void *) this, // init timer id = ble obj context - BleAdvTimeoutHandler // timer callback handler + BleSendIndicationTimeoutHandler // timer callback handler ); mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); From 1ada11d44b1036721217764ec69cb0656d3ab045 Mon Sep 17 00:00:00 2001 From: shgutte Date: Fri, 2 Feb 2024 15:18:48 +0530 Subject: [PATCH 07/10] Updated the timer timeout --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 45a331668bcf9f..77a4611d7b128b 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -247,7 +247,7 @@ namespace { #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value #define BLE_DEFAULT_TIMER_PERIOD_MS (1) -#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (10) +#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (400) TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. TimerHandle_t sbleSendIndicationTimeoutTimer; // FreeRTOS sw timer. @@ -951,6 +951,7 @@ void BLEManagerImpl::HandleSoftTimerEvent(void) event.Type = DeviceEventType::kCHIPoBLEConnectionError; event.CHIPoBLEConnectionError.ConId = connHandle; event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; + ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); PlatformMgr().PostEventOrDie(&event); } @@ -1125,6 +1126,7 @@ void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs) void BLEManagerImpl::BleSendIndicationTimeoutHandler(TimerHandle_t xTimer) { + ChipLogProgress(DeviceLayer, "BleSendIndicationTimeoutHandler::Start"); sInstance.HandleSoftTimerEvent(); } From 0c11404a0378768b469dc4a66a063cfaffd2d538 Mon Sep 17 00:00:00 2001 From: shgutte Date: Fri, 2 Feb 2024 16:01:15 +0530 Subject: [PATCH 08/10] Updated the timeout to support all chips --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 77a4611d7b128b..1d4708d8908519 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -247,7 +247,7 @@ namespace { #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value #define BLE_DEFAULT_TIMER_PERIOD_MS (1) -#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (400) +#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (500) // Time kept to support all WiFi chips BLE (RS9116/ SiWx917 NCP/SOC) TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. TimerHandle_t sbleSendIndicationTimeoutTimer; // FreeRTOS sw timer. @@ -481,9 +481,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), data->Start()); - ChipLogProgress(DeviceLayer, "StartTimer start"); StartBleSendIndicationTimeoutTimer(BLE_SEND_INDICATION_TIMER_PERIOD_MS); - ChipLogProgress(DeviceLayer, "StartTimer Stop"); if (status != RSI_SUCCESS) { @@ -951,7 +949,6 @@ void BLEManagerImpl::HandleSoftTimerEvent(void) event.Type = DeviceEventType::kCHIPoBLEConnectionError; event.CHIPoBLEConnectionError.ConId = connHandle; event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; - ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); PlatformMgr().PostEventOrDie(&event); } From fad339dbd4a19a451fd499a1d3219f23dbb9c86d Mon Sep 17 00:00:00 2001 From: shgutte Date: Mon, 5 Feb 2024 09:18:31 +0530 Subject: [PATCH 09/10] Added req changes for send indicaiton --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 1d4708d8908519..993188fc50bdeb 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -247,7 +247,7 @@ namespace { #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value #define BLE_DEFAULT_TIMER_PERIOD_MS (1) -#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (500) // Time kept to support all WiFi chips BLE (RS9116/ SiWx917 NCP/SOC) +#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (400) // Time kept to support all WiFi chips BLE (RS9116/ SiWx917 NCP/SOC) TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. TimerHandle_t sbleSendIndicationTimeoutTimer; // FreeRTOS sw timer. @@ -1123,7 +1123,6 @@ void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs) void BLEManagerImpl::BleSendIndicationTimeoutHandler(TimerHandle_t xTimer) { - ChipLogProgress(DeviceLayer, "BleSendIndicationTimeoutHandler::Start"); sInstance.HandleSoftTimerEvent(); } @@ -1145,7 +1144,7 @@ void BLEManagerImpl::StartBleSendIndicationTimeoutTimer(uint32_t aTimeoutInMs) // timer is not active, change its period to required value (== restart). // FreeRTOS- Block for a maximum of 100 ticks if the change period command // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sbleSendIndicationTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), pdMS_TO_TICKS(100)) != pdPASS) + if (xTimerChangePeriod(sbleSendIndicationTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), pdMS_TO_TICKS(BLE_CONFIG_TIMEOUT)) != pdPASS) { ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer"); } From 05c652722ee76411f6fd3845ddf3bc2745665987 Mon Sep 17 00:00:00 2001 From: shgutte Date: Tue, 6 Feb 2024 09:59:17 +0530 Subject: [PATCH 10/10] Added req changes --- src/platform/silabs/BLEManagerImpl.h | 2 ++ src/platform/silabs/rs911x/BLEManagerImpl.cpp | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index 712d6cdb2d4e15..6d628217f91c96 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -30,6 +30,8 @@ #define BLE_MAX_CONNECTION_INTERVAL_MS 45 // 45 msec #define BLE_SLAVE_LATENCY_MS 0 #define BLE_TIMEOUT_MS 400 +#define BLE_DEFAULT_TIMER_PERIOD_MS (1) +#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (400) // Time kept to support all WiFi chips BLE (RS9116/ SiWx917 NCP/SOC) #endif // (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) #include "FreeRTOS.h" #include "timers.h" diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 993188fc50bdeb..d86a2d9a2b649c 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -246,9 +246,6 @@ namespace { #define BLE_CONFIG_MIN_CE_LENGTH (0) // Leave to min value #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value -#define BLE_DEFAULT_TIMER_PERIOD_MS (1) -#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (400) // Time kept to support all WiFi chips BLE (RS9116/ SiWx917 NCP/SOC) - TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. TimerHandle_t sbleSendIndicationTimeoutTimer; // FreeRTOS sw timer.