@@ -68,6 +68,13 @@ extern "C" {
68
68
#include < setup_payload/AdditionalDataPayloadGenerator.h>
69
69
#endif
70
70
71
+ #define BLE_MIN_CONNECTION_INTERVAL_MS 45 // 45 msec
72
+ #define BLE_MAX_CONNECTION_INTERVAL_MS 45 // 45 msec
73
+ #define BLE_SLAVE_LATENCY_MS 0
74
+ #define BLE_TIMEOUT_MS 400
75
+ #define BLE_DEFAULT_TIMER_PERIOD_MS (1 )
76
+ #define BLE_SEND_INDICATION_TIMER_PERIOD_MS (5000 ) // Time kept to support all WiFi chips BLE (RS9116/ SiWx917 NCP/SOC)
77
+
71
78
extern sl_wfx_msg_t event_msg;
72
79
73
80
StaticTask_t rsiBLETaskStruct;
@@ -292,7 +299,7 @@ CHIP_ERROR BLEManagerImpl::_Init()
292
299
BleAdvTimeoutHandler // timer callback handler
293
300
);
294
301
295
- sbleSendIndicationTimeoutTimer = xTimerCreate (" SendIndicationTimer " , // Just a text name, not used by the RTOS kernel
302
+ sbleSendIndicationTimeoutTimer = xTimerCreate (" SendIndicationTimeoutTimer " , // Just a text name, not used by the RTOS kernel
296
303
pdMS_TO_TICKS (BLE_SEND_INDICATION_TIMER_PERIOD_MS), // == default timer period
297
304
false , // no timer reload (==one-shot)
298
305
(void *) this , // init timer id = ble obj context
@@ -478,7 +485,12 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU
478
485
status = rsi_ble_indicate_value (event_msg.resp_enh_conn .dev_addr , event_msg.rsi_ble_measurement_hndl , (data->DataLength ()),
479
486
data->Start ());
480
487
481
- StartBleSendIndicationTimeoutTimer (BLE_SEND_INDICATION_TIMER_PERIOD_MS);
488
+ if (xTimerStart (sbleSendIndicationTimeoutTimer, 0 ) != pdPASS)
489
+ {
490
+ /* The timer could not be set into the Active
491
+ state. */
492
+ ChipLogError (DeviceLayer, " Failed to start send Indication timeout timer" );
493
+ }
482
494
483
495
if (status != RSI_SUCCESS)
484
496
{
@@ -1126,22 +1138,6 @@ void BLEManagerImpl::CancelBleSendIndicationTimeoutTimer(void)
1126
1138
}
1127
1139
}
1128
1140
1129
- void BLEManagerImpl::StartBleSendIndicationTimeoutTimer (uint32_t aTimeoutInMs)
1130
- {
1131
- if (xTimerIsTimerActive (sbleSendIndicationTimeoutTimer))
1132
- {
1133
- CancelBleAdvTimeoutTimer ();
1134
- }
1135
-
1136
- // timer is not active, change its period to required value (== restart).
1137
- // FreeRTOS- Block for a maximum of 100 ticks if the change period command
1138
- // cannot immediately be sent to the timer command queue.
1139
- if (xTimerChangePeriod (sbleSendIndicationTimeoutTimer, pdMS_TO_TICKS (aTimeoutInMs), pdMS_TO_TICKS (BLE_CONFIG_TIMEOUT)) != pdPASS)
1140
- {
1141
- ChipLogError (DeviceLayer, " Failed to start BledAdv timeout timer" );
1142
- }
1143
- }
1144
-
1145
1141
void BLEManagerImpl::DriveBLEState (intptr_t arg)
1146
1142
{
1147
1143
sInstance .DriveBLEState ();
0 commit comments