Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] Adding Queue for the ble events and removing the semaphore #35522

Merged
merged 19 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions src/platform/silabs/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#include <rsi_ble.h>
#include <rsi_ble_apis.h>
#include <rsi_bt_common.h>
#include "wfx_sl_ble_init.h"
#ifdef __cplusplus
}
#endif // __cplusplus
Expand All @@ -58,12 +56,14 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla
void HandleBootEvent(void);

#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
void HandleConnectEvent(void);
void HandleConnectionCloseEvent(uint16_t reason);
void HandleWriteEvent(rsi_ble_event_write_t evt);
void UpdateMtu(rsi_ble_event_mtu_t evt);
// Used for posting the event in the BLE queue
void BlePostEvent(SilabsBleWrapper::BleEvent_t * event);
void HandleConnectEvent(SilabsBleWrapper::sl_wfx_msg_t * evt);
void HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * evt);
void HandleWriteEvent(SilabsBleWrapper::sl_wfx_msg_t * evt);
void UpdateMtu(SilabsBleWrapper::sl_wfx_msg_t * evt);
void HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId);
void HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt);
void HandleTXCharCCCDWrite(SilabsBleWrapper::sl_wfx_msg_t * evt);
void HandleSoftTimerEvent(void);
int32_t SendBLEAdvertisementCommand(void);
#else
Expand All @@ -80,7 +80,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla

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

#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
// rs91x BLE task handling
osMessageQueueId_t sBleEventQueue = NULL;
static void sl_ble_event_handling_task(void * args);
void sl_ble_init();
void ProcessEvent(SilabsBleWrapper::BleEvent_t inEvent);
#endif

// ===== Members that implement the BLEManager internal interface.

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

#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
void HandleRXCharWrite(rsi_ble_event_write_t * evt);
void HandleRXCharWrite(SilabsBleWrapper::sl_wfx_msg_t * evt);
#else
void HandleRXCharWrite(volatile sl_bt_msg_t * evt);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static_library("SiWx917") {
"../../SingletonConfigurationManager.cpp",
"../rs911x/BLEManagerImpl.cpp",
"../rs911x/rsi_ble_config.h",
"../rs911x/wfx_sl_ble_init.c",
"../rs911x/wfx_sl_ble_init.cpp",
"../rs911x/wfx_sl_ble_init.h",
]

Expand Down
2 changes: 1 addition & 1 deletion src/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static_library("efr32") {
sources += [
"../rs911x/BLEManagerImpl.cpp",
"../rs911x/rsi_ble_config.h",
"../rs911x/wfx_sl_ble_init.c",
"../rs911x/wfx_sl_ble_init.cpp",
"../rs911x/wfx_sl_ble_init.h",
]
} else {
Expand Down
Loading
Loading