Skip to content

Commit e8554de

Browse files
chirag-silabsrestyled-commits
andauthoredSep 25, 2024··
[Silabs] Adding Queue for the ble events and removing the semaphore (#35522)
* adding queue logic to the semaphore * removing the extern keyword for the queue * cleanup of ble defines and variables * Restyled by whitespace * restyling the PR * removing the temp change * restyling the PR * reverting BLEManagerImpl.h to fix * fixing the build for the 91x ncp * addressing review comments * Restyled by whitespace * Restyled by clang-format * modifying the file to have classes * restyling the PR * Restyled by whitespace * cleanup the unused from the .h file and fixing build * Addressing review comments --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 6f93ec2 commit e8554de

File tree

7 files changed

+301
-391
lines changed

7 files changed

+301
-391
lines changed
 

‎src/platform/silabs/BLEManagerImpl.h

+18-10
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
#ifdef __cplusplus
3131
extern "C" {
3232
#endif // __cplusplus
33-
#include <rsi_ble.h>
34-
#include <rsi_ble_apis.h>
35-
#include <rsi_bt_common.h>
33+
#include "wfx_sl_ble_init.h"
3634
#ifdef __cplusplus
3735
}
3836
#endif // __cplusplus
@@ -58,12 +56,14 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla
5856
void HandleBootEvent(void);
5957

6058
#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
61-
void HandleConnectEvent(void);
62-
void HandleConnectionCloseEvent(uint16_t reason);
63-
void HandleWriteEvent(rsi_ble_event_write_t evt);
64-
void UpdateMtu(rsi_ble_event_mtu_t evt);
59+
// Used for posting the event in the BLE queue
60+
void BlePostEvent(SilabsBleWrapper::BleEvent_t * event);
61+
void HandleConnectEvent(SilabsBleWrapper::sl_wfx_msg_t * evt);
62+
void HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * evt);
63+
void HandleWriteEvent(SilabsBleWrapper::sl_wfx_msg_t * evt);
64+
void UpdateMtu(SilabsBleWrapper::sl_wfx_msg_t * evt);
6565
void HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId);
66-
void HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt);
66+
void HandleTXCharCCCDWrite(SilabsBleWrapper::sl_wfx_msg_t * evt);
6767
void HandleSoftTimerEvent(void);
6868
int32_t SendBLEAdvertisementCommand(void);
6969
#else
@@ -80,7 +80,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla
8080

8181
#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
8282
#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
83-
static void HandleC3ReadRequest(rsi_ble_read_req_t * rsi_ble_read_req);
83+
static void HandleC3ReadRequest(SilabsBleWrapper::sl_wfx_msg_t * rsi_ble_read_req);
8484
#else
8585
#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
8686
static void HandleC3ReadRequest(volatile sl_bt_msg_t * evt);
@@ -93,6 +93,14 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla
9393
// the implementation methods provided by this class.
9494
friend BLEManager;
9595

96+
#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
97+
// rs91x BLE task handling
98+
osMessageQueueId_t sBleEventQueue = NULL;
99+
static void sl_ble_event_handling_task(void * args);
100+
void sl_ble_init();
101+
void ProcessEvent(SilabsBleWrapper::BleEvent_t inEvent);
102+
#endif
103+
96104
// ===== Members that implement the BLEManager internal interface.
97105

98106
CHIP_ERROR _Init(void);
@@ -186,7 +194,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla
186194
#endif
187195

188196
#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
189-
void HandleRXCharWrite(rsi_ble_event_write_t * evt);
197+
void HandleRXCharWrite(SilabsBleWrapper::sl_wfx_msg_t * evt);
190198
#else
191199
void HandleRXCharWrite(volatile sl_bt_msg_t * evt);
192200
#endif

‎src/platform/silabs/SiWx917/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static_library("SiWx917") {
6464
"../../SingletonConfigurationManager.cpp",
6565
"../rs911x/BLEManagerImpl.cpp",
6666
"../rs911x/rsi_ble_config.h",
67-
"../rs911x/wfx_sl_ble_init.c",
67+
"../rs911x/wfx_sl_ble_init.cpp",
6868
"../rs911x/wfx_sl_ble_init.h",
6969
]
7070

‎src/platform/silabs/efr32/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static_library("efr32") {
7070
sources += [
7171
"../rs911x/BLEManagerImpl.cpp",
7272
"../rs911x/rsi_ble_config.h",
73-
"../rs911x/wfx_sl_ble_init.c",
73+
"../rs911x/wfx_sl_ble_init.cpp",
7474
"../rs911x/wfx_sl_ble_init.h",
7575
]
7676
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.