Skip to content

Commit

Permalink
Added changes according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shgutte committed Jul 12, 2023
1 parent c3481d0 commit 94fa5fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/platform/silabs/rs911x/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ extern "C" {
#include <setup_payload/AdditionalDataPayloadGenerator.h>
#endif

extern uint16_t rsi_ble_measurement_hndl;
extern rsi_ble_event_conn_status_t conn_event_to_app;
extern sl_wfx_msg_t event_msg;

StaticTask_t rsiBLETaskStruct;
Expand Down Expand Up @@ -96,9 +94,6 @@ void sl_ble_init()
// initializing the application events map
rsi_ble_app_init_events();
memcpy(randomAddrBLE, &randomAddr, 6);
ChipLogError(DeviceLayer, "%s: BLE : randomAddr %" PRIu64 "\n", __func__, randomAddr);
ChipLogError(DeviceLayer, "%s: BLE : MAC %02x:%02x:%02x %02x:%02x:%02x", __func__, randomAddrBLE[0], randomAddrBLE[1],
randomAddrBLE[2], randomAddrBLE[3], randomAddrBLE[4], randomAddrBLE[5]);
rsi_ble_set_random_address_with_value(randomAddrBLE);
chip::DeviceLayer::Internal::BLEMgrImpl().HandleBootEvent();
}
Expand All @@ -116,8 +111,13 @@ void sl_ble_event_handling_task(void)
// Application event map
while (1)
{
//! This semaphore is waiting for next ble event task
event_id = rsi_ble_app_get_event();
if (event_id == RSI_FAILURE)
{
//! This semaphore is waiting for next ble event task
rsi_semaphore_wait(&sl_ble_event_sem, 0);
continue;
}
switch (event_id)
{
case RSI_BLE_CONN_EVENT: {
Expand Down Expand Up @@ -155,7 +155,6 @@ void sl_ble_event_handling_task(void)
}
break;
default:
rsi_semaphore_wait(&sl_ble_event_sem, 0);
break;
}
}
Expand Down Expand Up @@ -606,8 +605,6 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void)

rsi_ble_set_scan_response_data(responseData, index);

// err = MapBLEError(result);

ChipLogProgress(DeviceLayer, "ConfigureAdvertisingData End");
exit:
return CHIP_NO_ERROR;
Expand Down Expand Up @@ -826,11 +823,9 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt)
bleConnState->subscribed = 1;
// Post an event to the CHIP queue to process either a CHIPoBLE Subscribe or Unsubscribe based on
// whether the client is enabling or disabling indications.
{
event.Type = DeviceEventType::kCHIPoBLESubscribe;
event.CHIPoBLESubscribe.ConId = 1; // TODO:: To be replaced by device mac address
err = PlatformMgr().PostEvent(&event);
}
event.Type = DeviceEventType::kCHIPoBLESubscribe;
event.CHIPoBLESubscribe.ConId = 1; // TODO:: To be replaced by device mac address
err = PlatformMgr().PostEvent(&event);
}
}
else
Expand Down
5 changes: 5 additions & 0 deletions src/platform/silabs/rs911x/rsi_ble_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
* * Macros
* ******************************************************/
//! application event list
#ifndef RSI_FAILURE
// failure return value
#define RSI_FAILURE -1
#endif

#define RSI_BLE_CONN_EVENT (0x01)
#define RSI_BLE_DISCONN_EVENT (0x02)
#define RSI_BLE_GATT_WRITE_EVENT (0x03)
Expand Down

0 comments on commit 94fa5fc

Please sign in to comment.