diff --git a/src/platform/silabs/SiWx917/BLEManagerImpl.cpp b/src/platform/silabs/SiWx917/BLEManagerImpl.cpp
index bb9074dd5477be..7d148716a8aa1e 100644
--- a/src/platform/silabs/SiWx917/BLEManagerImpl.cpp
+++ b/src/platform/silabs/SiWx917/BLEManagerImpl.cpp
@@ -103,6 +103,7 @@ void sl_ble_event_handling_task(void)
//! This semaphore is waiting for wifi module initialization.
rsi_semaphore_wait(&sl_rs_ble_init_sem, 0);
+ // Initialize BLE and starts BLE Advertisement
sl_ble_init();
// Application event map
@@ -174,19 +175,19 @@ namespace Internal {
namespace {
-#define CHIP_ADV_DATA_TYPE_FLAGS 0x01
-#define CHIP_ADV_DATA_TYPE_UUID 0x03
-#define CHIP_ADV_DATA_TYPE_NAME 0x09
-#define CHIP_ADV_DATA_TYPE_SERVICE_DATA 0x16
+#define CHIP_ADV_DATA_TYPE_FLAGS (0x01)
+#define CHIP_ADV_DATA_TYPE_UUID (0x03)
+#define CHIP_ADV_DATA_TYPE_NAME (0x09)
+#define CHIP_ADV_DATA_TYPE_SERVICE_DATA (0x16)
-#define CHIP_ADV_DATA_FLAGS 0x06
+#define CHIP_ADV_DATA_FLAGS (0x06)
-#define CHIP_ADV_DATA 0
-#define CHIP_ADV_SCAN_RESPONSE_DATA 1
-#define CHIP_ADV_SHORT_UUID_LEN 2
+#define CHIP_ADV_DATA (0)
+#define CHIP_ADV_SCAN_RESPONSE_DATA (1)
+#define CHIP_ADV_SHORT_UUID_LEN (2)
-#define MAX_RESPONSE_DATA_LEN 31
-#define MAX_ADV_DATA_LEN 31
+#define MAX_RESPONSE_DATA_LEN (31)
+#define MAX_ADV_DATA_LEN (31)
// Timer Frequency used.
#define TIMER_CLK_FREQ ((uint32_t) 32768)
@@ -212,7 +213,7 @@ 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 1
+#define BLE_DEFAULT_TIMER_PERIOD_MS (1)
TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer.
@@ -251,7 +252,7 @@ CHIP_ERROR BLEManagerImpl::_Init()
// Create FreeRTOS sw timer for BLE timeouts and interval change.
sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer", // Just a text name, not used by the RTOS kernel
- pdMS_TO_TICKS(BLE_DEFAULT_TIMER_PERIOD), // == default timer period
+ pdMS_TO_TICKS(BLE_DEFAULT_TIMER_PERIOD_MS), // == default timer period
false, // no timer reload (==one-shot)
(void *) this, // init timer id = ble obj context
BleAdvTimeoutHandler // timer callback handler
@@ -314,7 +315,7 @@ CHIP_ERROR BLEManagerImpl::_SetAdvertisingMode(BLEAdvertisingMode mode)
return CHIP_NO_ERROR;
}
-CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize)
+CHIP_ERROR BLEManagerImpl::_GetDeviceName(char *buf, size_t bufSize)
{
if (strlen(mDeviceName) >= bufSize)
{
@@ -324,7 +325,7 @@ CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize)
return CHIP_NO_ERROR;
}
-CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName)
+CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char *deviceName)
{
ChipLogProgress(DeviceLayer, "_SetDeviceName Started");
if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported)
@@ -353,7 +354,7 @@ CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName)
return CHIP_NO_ERROR;
}
-void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
+void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent *event)
{
switch (event->Type)
{
@@ -398,13 +399,13 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
}
}
-bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId)
+bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SubscribeCharacteristic() not supported");
return false;
}
-bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId)
+bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::UnsubscribeCharacteristic() not supported");
return false;
@@ -430,7 +431,7 @@ uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const
return (conState != NULL) ? conState->mtu : 0;
}
-bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId,
+bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId,
PacketBufferHandle data)
{
int32_t status = 0;
@@ -439,21 +440,21 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU
data->Start());
if (status != RSI_SUCCESS)
{
- ChipLogProgress(DeviceLayer, "indication %d failed with error code %lx ", status);
+ ChipLogProgress(DeviceLayer, "indication failed with error code %lx ", status);
return false;
}
return true;
}
-bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId,
+bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId,
PacketBufferHandle pBuf)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendWriteRequest() not supported");
return false;
}
-bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId,
+bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId,
PacketBufferHandle pBuf)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadRequest() not supported");
@@ -461,7 +462,7 @@ bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleU
}
bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext,
- const ChipBleUUID * svcId, const ChipBleUUID * charId)
+ const ChipBleUUID *svcId, const ChipBleUUID *charId)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadResponse() not supported");
return false;
@@ -469,7 +470,7 @@ bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQU
void BLEManagerImpl::NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId)
{
- // Nothing to do
+ // Nothing to do : Placeholder
}
CHIP_ERROR BLEManagerImpl::MapBLEError(int bleErr)
@@ -493,12 +494,11 @@ CHIP_ERROR BLEManagerImpl::MapBLEError(int bleErr)
void BLEManagerImpl::DriveBLEState(void)
{
-
ChipLogProgress(DeviceLayer, "DriveBLEState starting");
CHIP_ERROR err = CHIP_NO_ERROR;
// Check if BLE stack is initialized
- // VerifyOrExit(mFlags.Has(Flags::kEFRBLEStackInitialized), /* */);
+ // VerifyOrExit(mFlags.Has(Flags::kEFRBLEStackInitialized),);
ChipLogProgress(DeviceLayer, "Start advertising if needed...");
// Start advertising if needed...
@@ -768,7 +768,7 @@ void BLEManagerImpl::HandleWriteEvent(rsi_ble_event_write_t evt)
}
// TODO:: Need to implement this
-void BLEManagerImpl::HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt)
+void BLEManagerImpl::HandleTXCharCCCDWrite(rsi_ble_event_write_t *evt)
{
CHIP_ERROR err = CHIP_NO_ERROR;
bool isIndicationEnabled = false;
@@ -800,7 +800,7 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt)
}
}
-void BLEManagerImpl::HandleRXCharWrite(rsi_ble_event_write_t * evt)
+void BLEManagerImpl::HandleRXCharWrite(rsi_ble_event_write_t *evt)
{
uint8_t conId = 1;
CHIP_ERROR err = CHIP_NO_ERROR;
@@ -860,7 +860,7 @@ bool BLEManagerImpl::RemoveConnection(uint8_t connectionHandle)
void BLEManagerImpl::AddConnection(uint8_t connectionHandle, uint8_t bondingHandle)
{
- CHIPoBLEConState * bleConnState = GetConnectionState(connectionHandle, true);
+ CHIPoBLEConState *bleConnState = GetConnectionState(connectionHandle, true);
if (bleConnState != NULL)
{
@@ -935,10 +935,10 @@ CHIP_ERROR BLEManagerImpl::EncodeAdditionalDataTlv()
return err;
}
-// TODO:: Need the
+// TODO:: Need to do the correct implementation
void BLEManagerImpl::HandleC3ReadRequest(void)
{
-
+ // TODO
// if (ret != SL_STATUS_OK)
// {
// ChipLogDetail(DeviceLayer, "Failed to send read response, err:%ld", ret);
diff --git a/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h b/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h
index 078a050f470cc6..7b257895fd1d84 100644
--- a/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h
+++ b/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h
@@ -24,76 +24,76 @@
* * Macros
* ******************************************************/
//! application event list
-#define RSI_BLE_CONN_EVENT 0x01
-#define RSI_BLE_DISCONN_EVENT 0x02
-#define RSI_BLE_GATT_WRITE_EVENT 0x03
-#define RSI_BLE_MTU_EVENT 0x04
-#define RSI_BLE_GATT_INDICATION_CONFIRMATION 0x05
-#define RSI_BLE_RESP_ATT_VALUE 0x06
-#define RSI_SSID 0x0D
-#define RSI_SECTYPE 0x0E
-#define RSI_BLE_WLAN_DISCONN_NOTIFY 0x0F
-#define RSI_WLAN_ALREADY 0x10
-#define RSI_WLAN_NOT_ALREADY 0x11
-#define RSI_BLE_WLAN_TIMEOUT_NOTIFY 0x12
-#define RSI_BLE_WLAN_JOIN_STATUS 0x15
-#define RSI_APP_FW_VERSION 0x13
-#define RSI_BLE_WLAN_DISCONNECT_STATUS 0x14
-
-#define RSI_REM_DEV_ADDR_LEN 18
-#define RSI_REM_DEV_NAME_LEN 31
+#define RSI_BLE_CONN_EVENT (0x01)
+#define RSI_BLE_DISCONN_EVENT (0x02)
+#define RSI_BLE_GATT_WRITE_EVENT (0x03)
+#define RSI_BLE_MTU_EVENT (0x04)
+#define RSI_BLE_GATT_INDICATION_CONFIRMATION (0x05)
+#define RSI_BLE_RESP_ATT_VALUE (0x06)
+#define RSI_SSID (0x0D)
+#define RSI_SECTYPE (0x0E)
+#define RSI_BLE_WLAN_DISCONN_NOTIFY (0x0F)
+#define RSI_WLAN_ALREADY (0x10)
+#define RSI_WLAN_NOT_ALREADY (0x11)
+#define RSI_BLE_WLAN_TIMEOUT_NOTIFY (0x12)
+#define RSI_BLE_WLAN_JOIN_STATUS (0x15)
+#define RSI_APP_FW_VERSION (0x13)
+#define RSI_BLE_WLAN_DISCONNECT_STATUS (0x14)
+
+#define RSI_REM_DEV_ADDR_LEN (18)
+#define RSI_REM_DEV_NAME_LEN (31)
#define RSI_BLE_DEV_NAME "CCP_DEVICE"
#define RSI_BLE_SET_RAND_ADDR "00:23:A7:12:34:56"
-#define CLEAR_WHITELIST 0x00
-#define ADD_DEVICE_TO_WHITELIST 0x01
-#define DELETE_DEVICE_FROM_WHITELIST 0x02
+#define CLEAR_WHITELIST (0x00)
+#define ADD_DEVICE_TO_WHITELIST (0x01)
+#define DELETE_DEVICE_FROM_WHITELIST (0x02)
-#define ALL_PHYS 0x00
+#define ALL_PHYS (0x00)
-#define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE 0
+#define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE (0)
-#define RSI_OPERMODE_WLAN_BLE 13
+#define RSI_OPERMODE_WLAN_BLE (13)
/***********************************************************************************************************************************************/
//! Characteristic Presenatation Format Fields
/***********************************************************************************************************************************************/
-#define RSI_BLE_UINT8_FORMAT 0x04
-#define RSI_BLE_EXPONENT 0x00
-#define RSI_BLE_PERCENTAGE_UNITS_UUID 0x27AD
-#define RSI_BLE_NAME_SPACE 0x01
-#define RSI_BLE_DESCRIPTION 0x010B
+#define RSI_BLE_UINT8_FORMAT (0x04)
+#define RSI_BLE_EXPONENT (0x00)
+#define RSI_BLE_PERCENTAGE_UNITS_UUID (0x27AD)
+#define RSI_BLE_NAME_SPACE (0x01)
+#define RSI_BLE_DESCRIPTION (0x010B)
//! BLE characteristic custom service uuid
-#define RSI_BLE_CUSTOM_SERVICE_UUID 0xFFF6
-#define RSI_BLE_CUSTOM_LEVEL_UUID 0x1FF1
+#define RSI_BLE_CUSTOM_SERVICE_UUID (0xFFF6)
+#define RSI_BLE_CUSTOM_LEVEL_UUID (0x1FF1)
#ifdef RSI_M4_INTERFACE
-#define RSI_BLE_MAX_NBR_ATT_REC 20
-#define RSI_BLE_MAX_NBR_SLAVES 1
-#define RSI_BLE_NUM_CONN_EVENTS 2
+#define RSI_BLE_MAX_NBR_ATT_REC (20)
+#define RSI_BLE_MAX_NBR_SLAVES (1)
+#define RSI_BLE_NUM_CONN_EVENTS (2)
#else
-#define RSI_BLE_MAX_NBR_ATT_REC 80
-#define RSI_BLE_MAX_NBR_SLAVES 3
-#define RSI_BLE_NUM_CONN_EVENTS 20
+#define RSI_BLE_MAX_NBR_ATT_REC (80)
+#define RSI_BLE_MAX_NBR_SLAVES (3)
+#define RSI_BLE_NUM_CONN_EVENTS (20)
#endif
-#define RSI_BLE_MAX_NBR_ATT_SERV 10
+#define RSI_BLE_MAX_NBR_ATT_SERV (10)
-#define RSI_BLE_MAX_NBR_MASTERS 1
-#define RSI_BLE_GATT_ASYNC_ENABLE 1
-#define RSI_BLE_GATT_INIT 0
+#define RSI_BLE_MAX_NBR_MASTERS (1)
+#define RSI_BLE_GATT_ASYNC_ENABLE (1)
+#define RSI_BLE_GATT_INIT (0)
-#define RSI_BLE_START_SCAN 0x01
-#define RSI_BLE_STOP_SCAN 0x00
+#define RSI_BLE_START_SCAN (0x01)
+#define RSI_BLE_STOP_SCAN (0x00)
#define RSI_BLE_SCAN_TYPE SCAN_TYPE_ACTIVE
#define RSI_BLE_SCAN_FILTER_TYPE SCAN_FILTER_TYPE_ALL
/* Number of BLE GATT RECORD SIZE IN (n*16 BYTES), eg:(0x40*16)=1024 bytes */
-#define RSI_BLE_NUM_REC_BYTES 0x40
+#define RSI_BLE_NUM_REC_BYTES (0x40)
-#define RSI_BLE_INDICATE_CONFIRMATION_FROM_HOST 0
+#define RSI_BLE_INDICATE_CONFIRMATION_FROM_HOST (0)
/*=======================================================================*/
//! Advertising command parameters
@@ -105,25 +105,25 @@
#define RSI_BLE_ADV_DIR_ADDR "00:15:83:6A:64:17"
//! Reduced the BLE adv interval time to match with EFR BLE
-#define RSI_BLE_ADV_INT_MIN 0x20
-#define RSI_BLE_ADV_INT_MAX 0x20
+#define RSI_BLE_ADV_INT_MIN (0x20)
+#define RSI_BLE_ADV_INT_MAX (0x20)
-#define RSI_BLE_ADV_CHANNEL_MAP 0x07
+#define RSI_BLE_ADV_CHANNEL_MAP (0x07)
//! Advertise status
//! Start the advertising process
-#define RSI_BLE_START_ADV 0x01
+#define RSI_BLE_START_ADV (0x01)
//! Stop the advertising process
-#define RSI_BLE_STOP_ADV 0x00
+#define RSI_BLE_STOP_ADV (0x00)
//! BLE Tx Power Index On Air
-#define RSI_BLE_PWR_INX 30
+#define RSI_BLE_PWR_INX (30)
//! BLE Active H/w Pwr Features
-#define BLE_DISABLE_DUTY_CYCLING 0
-#define BLE_DUTY_CYCLING 1
-#define BLR_DUTY_CYCLING 2
-#define BLE_4X_PWR_SAVE_MODE 4
+#define BLE_DISABLE_DUTY_CYCLING (0)
+#define BLE_DUTY_CYCLING (1)
+#define BLR_DUTY_CYCLING (2)
+#define BLE_4X_PWR_SAVE_MODE (4)
#define RSI_BLE_PWR_SAVE_OPTIONS BLE_DISABLE_DUTY_CYCLING
//! Advertise types
@@ -131,61 +131,61 @@
/* Advertising will be visible(discoverable) to all the devices.
* Scanning/Connection is also accepted from all devices
* */
-#define UNDIR_CONN 0x80
+#define UNDIR_CONN (0x80)
/* Advertising will be visible(discoverable) to the particular device
* mentioned in RSI_BLE_ADV_DIR_ADDR only.
* Scanning and Connection will be accepted from that device only.
* */
-#define DIR_CONN 0x81
+#define DIR_CONN (0x81)
/* Advertising will be visible(discoverable) to all the devices.
* Scanning will be accepted from all the devices.
* Connection will be not be accepted from any device.
* */
-#define UNDIR_SCAN 0x82
+#define UNDIR_SCAN (0x82)
/* Advertising will be visible(discoverable) to all the devices.
* Scanning and Connection will not be accepted from any device
* */
-#define UNDIR_NON_CONN 0x83
+#define UNDIR_NON_CONN (0x83)
/* Advertising will be visible(discoverable) to the particular device
* mentioned in RSI_BLE_ADV_DIR_ADDR only.
* Scanning and Connection will be accepted from that device only.
* */
-#define DIR_CONN_LOW_DUTY_CYCLE 0x84
+#define DIR_CONN_LOW_DUTY_CYCLE (0x84)
//! Advertising flags
-#define LE_LIMITED_DISCOVERABLE 0x01
-#define LE_GENERAL_DISCOVERABLE 0x02
-#define LE_BR_EDR_NOT_SUPPORTED 0x04
+#define LE_LIMITED_DISCOVERABLE (0x01)
+#define LE_GENERAL_DISCOVERABLE (0x02)
+#define LE_BR_EDR_NOT_SUPPORTED (0x04)
//! Advertise filters
-#define ALLOW_SCAN_REQ_ANY_CONN_REQ_ANY 0x00
-#define ALLOW_SCAN_REQ_WHITE_LIST_CONN_REQ_ANY 0x01
-#define ALLOW_SCAN_REQ_ANY_CONN_REQ_WHITE_LIST 0x02
-#define ALLOW_SCAN_REQ_WHITE_LIST_CONN_REQ_WHITE_LIST 0x03
+#define ALLOW_SCAN_REQ_ANY_CONN_REQ_ANY (0x00)
+#define ALLOW_SCAN_REQ_WHITE_LIST_CONN_REQ_ANY (0x01)
+#define ALLOW_SCAN_REQ_ANY_CONN_REQ_WHITE_LIST (0x02)
+#define ALLOW_SCAN_REQ_WHITE_LIST_CONN_REQ_WHITE_LIST (0x03)
//! Address types
-#define LE_PUBLIC_ADDRESS 0x00
-#define LE_RANDOM_ADDRESS 0x01
-#define LE_RESOLVABLE_PUBLIC_ADDRESS 0x02
-#define LE_RESOLVABLE_RANDOM_ADDRESS 0x03
+#define LE_PUBLIC_ADDRESS (0x00)
+#define LE_RANDOM_ADDRESS (0x01)
+#define LE_RESOLVABLE_PUBLIC_ADDRESS (0x02)
+#define LE_RESOLVABLE_RANDOM_ADDRESS (0x03)
/*=======================================================================*/
/*=======================================================================*/
//! Connection parameters
/*=======================================================================*/
-#define LE_SCAN_INTERVAL 0x0100
-#define LE_SCAN_WINDOW 0x0050
+#define LE_SCAN_INTERVAL (0x0100)
+#define LE_SCAN_WINDOW (0x0050)
-#define CONNECTION_INTERVAL_MIN 0x00A0
-#define CONNECTION_INTERVAL_MAX 0x00A0
+#define CONNECTION_INTERVAL_MIN (0x00A0)
+#define CONNECTION_INTERVAL_MAX (0x00A0)
-#define CONNECTION_LATENCY 0x0000
-#define SUPERVISION_TIMEOUT 0x07D0 // 2000
+#define CONNECTION_LATENCY (0x0000)
+#define SUPERVISION_TIMEOUT (0x07D0) // 2000
/*=======================================================================*/
@@ -197,56 +197,36 @@
#define SL_WFX_BLE_SCAN_FILTER_TYPE SCAN_FILTER_TYPE_ALL
//! Scan status
-#define SL_WFX_BLE_START_SCAN 0x01
-#define SL_WFX_BLE_STOP_SCAN 0x00
+#define SL_WFX_BLE_START_SCAN (0x01)
+#define SL_WFX_BLE_STOP_SCAN (0x00)
//! Scan types
-#define SCAN_TYPE_ACTIVE 0x01
-#define SCAN_TYPE_PASSIVE 0x00
+#define SCAN_TYPE_ACTIVE (0x01)
+#define SCAN_TYPE_PASSIVE (0x00)
//! Scan filters
-#define SCAN_FILTER_TYPE_ALL 0x00
-#define SCAN_FILTER_TYPE_ONLY_WHITE_LIST 0x01
+#define SCAN_FILTER_TYPE_ALL (0x00)
+#define SCAN_FILTER_TYPE_ONLY_WHITE_LIST (0x01)
-#define SL_WFX_SEL_INTERNAL_ANTENNA 0x00
-#define SL_WFX_SEL_EXTERNAL_ANTENNA 0x01
+#define SL_WFX_SEL_INTERNAL_ANTENNA (0x00)
+#define SL_WFX_SEL_EXTERNAL_ANTENNA (0x01)
-#define SL_WFX_BT_CTRL_REMOTE_USER_TERMINATED 0x4E13
-#define SL_WFX_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES 0x4E14
-#define SL_WFX_BT_CTRL_REMOTE_POWERING_OFF 0x4E15
-#define SL_WFX_BT_CTRL_TERMINATED_MIC_FAILURE 0x4E3D
-#define SL_WFX_BT_FAILED_TO_ESTABLISH_CONN 0x4E3E
-#define SL_WFX_BT_INVALID_RANGE 0x4E60
+#define SL_WFX_BT_CTRL_REMOTE_USER_TERMINATED (0x4E13)
+#define SL_WFX_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES (0x4E14)
+#define SL_WFX_BT_CTRL_REMOTE_POWERING_OFF (0x4E15)
+#define SL_WFX_BT_CTRL_TERMINATED_MIC_FAILURE (0x4E3D)
+#define SL_WFX_BT_FAILED_TO_ESTABLISH_CONN (0x4E3E)
+#define SL_WFX_BT_INVALID_RANGE (0x4E60)
/***********************************************************************************************************************************************/
//! RS9116 Firmware Configurations
/***********************************************************************************************************************************************/
-
-/*=======================================================================*/
-//! Opermode command parameters
-/*=======================================================================*/
-/*
-#define RSI_FEATURE_BIT_MAP \
- (FEAT_ULP_GPIO_BASED_HANDSHAKE | FEAT_DEV_TO_HOST_ULP_GPIO_1) //! To set wlan feature select bit map
-#define RSI_TCP_IP_BYPASS RSI_DISABLE //! TCP IP BYPASS feature check
-#define RSI_TCP_IP_FEATURE_BIT_MAP \
- (TCP_IP_FEAT_DHCPV4_CLIENT) //! TCP/IP feature select bitmap for selecting TCP/IP features
-#define RSI_EXT_TCPIP_FEATURE_BITMAP 0
-
-#define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map
-
-#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE | EXT_FEAT_384K_MODE)
-
-#define RSI_BT_FEATURE_BITMAP (BT_RF_TYPE | ENABLE_BLE_PROTOCOL)
-*/
/*=======================================================================*/
//! Power save command parameters
/*=======================================================================*/
-//! set handshake type of power mode
-//#define RSI_HAND_SHAKE_TYPE GPIO_BASED
-#define BLE_ATT_REC_SIZE 500
-#define NO_OF_VAL_ATT 5 //! Attribute value count
+#define BLE_ATT_REC_SIZE (500)
+#define NO_OF_VAL_ATT (5) //! Attribute value count
/***********************************************************************************************************************************************/
//! user defined structure
@@ -268,4 +248,4 @@ typedef struct rsi_ble_s
rsi_ble_att_list_t att_rec_list[NO_OF_VAL_ATT];
} rsi_ble_t;
-#endif
\ No newline at end of file
+#endif
diff --git a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c
index cf7f580ce0adbb..f1fb8fc14548b8 100644
--- a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c
+++ b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c
@@ -1,38 +1,23 @@
-/*******************************************************************************
- * @file wfx_sl_ble_init.c
- * @brief
- *******************************************************************************
- * # License
- * Copyright 2021 Silicon Laboratories Inc. www.silabs.com
- *******************************************************************************
+/*
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * Copyright (c) 2022 Project CHIP Authors
*
- ******************************************************************************/
-/*************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
-/*================================================================================
-* @brief : This file contains example application for Wlan Station BLE
-* Provisioning
-* @section Description :
-* This application explains how to get the WLAN connection functionality using
-* BLE provisioning.
-* Silicon Labs Module starts advertising and with BLE Provisioning the Access Point
-* details are fetched.
-* Silicon Labs device is configured as a WiFi station and connects to an Access Point.
-=================================================================================*/
-
#include "wfx_sl_ble_init.h"
#include "rsi_ble_config.h"
-// application defines
+// Global Variables
rsi_ble_event_conn_status_t conn_event_to_app;
rsi_ble_t att_list;
sl_wfx_msg_t event_msg;
@@ -86,7 +71,7 @@ void rsi_ble_app_clear_event(uint32_t event_num)
* @section description
* This callback function is invoked when mtu exhange event is received
*/
-void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu)
+void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t *rsi_ble_mtu)
{
SILABS_LOG("%s: starting", __func__);
memcpy(&event_msg.rsi_ble_mtu, rsi_ble_mtu, sizeof(rsi_ble_event_mtu_t));
@@ -103,7 +88,7 @@ void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu)
* @section description
* This callback function is invoked when write/notify/indication events are received
*/
-void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write)
+void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write)
{
SILABS_LOG("%s: starting", __func__);
event_msg.event_id = event_id;
@@ -120,7 +105,7 @@ void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_
* @section description
* This callback function indicates the status of the connection
*/
-void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn)
+void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t *resp_enh_conn)
{
SILABS_LOG("%s: starting", __func__);
event_msg.connectionHandle = 1;
@@ -139,7 +124,7 @@ void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t *
* @section description
* This callback function indicates disconnected device information and status
*/
-void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason)
+void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t *resp_disconnect, uint16_t reason)
{
SILABS_LOG("%s: starting", __func__);
event_msg.reason = reason;
@@ -155,7 +140,7 @@ void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, u
* @return none
* @section description
*/
-void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp)
+void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp)
{
SILABS_LOG("%s: starting", __func__);
event_msg.resp_status = resp_status;
@@ -219,7 +204,7 @@ void rsi_ble_app_set_event(uint32_t event_num)
* @section description
* This function is used to store all attribute records
*/
-void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t data_len, uint8_t * data, uuid_t uuid,
+void rsi_gatt_add_attribute_to_list(rsi_ble_t *p_val, uint16_t handle, uint16_t data_len, uint8_t *data, uuid_t uuid,
uint8_t char_prop)
{
if ((p_val->DATA_ix + data_len) >= BLE_ATT_REC_SIZE)
@@ -254,7 +239,7 @@ void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t
* @section description
* This function is used at application to add characteristic attribute
*/
-void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle, uuid_t att_val_uuid)
+void rsi_ble_add_char_serv_att(void *serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle, uuid_t att_val_uuid)
{
rsi_ble_req_add_att_t new_att = { 0 };
@@ -302,7 +287,7 @@ void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val
* This function is used at application to create new service.
*/
-void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t * data,
+void rsi_ble_add_char_val_att(void *serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t *data,
uint8_t data_len, uint8_t auth_read)
{
rsi_ble_req_add_att_t new_att = { 0 };
@@ -316,7 +301,9 @@ void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_t
new_att.property = val_prop;
if (data != NULL)
+ {
memcpy(new_att.data, data, RSI_MIN(sizeof(new_att.data), data_len));
+ }
//! preparing the attribute value
new_att.data_len = data_len;
@@ -420,4 +407,4 @@ uint32_t rsi_ble_add_matter_service(void)
memset(&data, 0, sizeof(data));
return 0;
-}
\ No newline at end of file
+}
diff --git a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h
index e52e1553de540d..7263923b5213bb 100644
--- a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h
+++ b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h
@@ -1,30 +1,23 @@
-/*******************************************************************************
- * @file wfx_sl_ble_init.h
- * @brief
- *******************************************************************************
- * # License
- * Copyright 2021 Silicon Laboratories Inc. www.silabs.com
- *******************************************************************************
+/*
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * Copyright (c) 2022 Project CHIP Authors
*
- ******************************************************************************/
-/*************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-/**
- * Include files
- * */
-
#ifndef WFX_SL_BLE_INIT
#define WFX_SL_BLE_INIT
-#define RSI_BLE_ENABLE 1
+#define RSI_BLE_ENABLE (1)
// BLE include file to refer BLE APIs
#include "FreeRTOS.h"
@@ -64,7 +57,7 @@ typedef struct sl_wfx_msg_s
rsi_ble_event_mtu_t rsi_ble_mtu;
rsi_ble_event_write_t rsi_ble_write;
rsi_ble_event_enhance_conn_status_t resp_enh_conn;
- rsi_ble_event_disconnect_t * resp_disconnect;
+ rsi_ble_event_disconnect_t *resp_disconnect;
rsi_ble_set_att_resp_t rsi_ble_event_set_att_rsp;
uint32_t ble_app_event_map;
uint32_t ble_app_event_mask;
@@ -74,51 +67,51 @@ typedef struct sl_wfx_msg_s
} sl_wfx_msg_t;
-#define ATT_REC_IN_HOST 0
+#define ATT_REC_IN_HOST (0)
-#define RSI_BT_CTRL_REMOTE_USER_TERMINATED 0x4E13
-#define RSI_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES 0x4E14
-#define RSI_BT_CTRL_REMOTE_POWERING_OFF 0x4E15
-#define RSI_BT_CTRL_TERMINATED_MIC_FAILURE 0x4E3D
-#define RSI_BT_FAILED_TO_ESTABLISH_CONN 0x4E3E
-#define RSI_BT_INVALID_RANGE 0x4E60
+#define RSI_BT_CTRL_REMOTE_USER_TERMINATED (0x4E13)
+#define RSI_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES (0x4E14)
+#define RSI_BT_CTRL_REMOTE_POWERING_OFF (0x4E15)
+#define RSI_BT_CTRL_TERMINATED_MIC_FAILURE (0x4E3D)
+#define RSI_BT_FAILED_TO_ESTABLISH_CONN (0x4E3E)
+#define RSI_BT_INVALID_RANGE (0x4E60)
-#define RSI_BLE_MATTER_CUSTOM_SERVICE_UUID 0
-#define RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE 2
-#define RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16 0xFFF6
-#define RSI_BLE_MATTER_CUSTOM_SERVICE_DATA 0x00
+#define RSI_BLE_MATTER_CUSTOM_SERVICE_UUID (0)
+#define RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE (2)
+#define RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16 (0xFFF6)
+#define RSI_BLE_MATTER_CUSTOM_SERVICE_DATA (0x00)
-#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE 16
+#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE (16)
#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED 0x00, 0x00, 0x00
#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_1 0x18EE2EF5
#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_2 0x263D
#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_3 0x4559
#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_4 0x9F, 0x95, 0x9C, 0x4F, 0x11, 0x9D, 0x9F, 0x42
-#define RSI_BLE_CHARACTERISTIC_RX_ATTRIBUTE_HANDLE_LOCATION 1
-#define RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION 2
+#define RSI_BLE_CHARACTERISTIC_RX_ATTRIBUTE_HANDLE_LOCATION (1)
+#define RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION (2)
-#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_SIZE 16
+#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_SIZE (16)
#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_RESERVED 0x00, 0x00, 0x00
#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_1 0x18EE2EF5
#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_2 0x263D
#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_3 0x4559
#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_4 0x9F, 0x95, 0x9C, 0x4F, 0x12, 0x9D, 0x9F, 0x42
-#define RSI_BLE_CHARACTERISTIC_TX_ATTRIBUTE_HANDLE_LOCATION 3
-#define RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION 4
-#define RSI_BLE_CHARACTERISTIC_TX_GATT_SERVER_CLIENT_HANDLE_LOCATION 5
+#define RSI_BLE_CHARACTERISTIC_TX_ATTRIBUTE_HANDLE_LOCATION (3)
+#define RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION (4)
+#define RSI_BLE_CHARACTERISTIC_TX_GATT_SERVER_CLIENT_HANDLE_LOCATION (5)
// ALL Ble functions
-void rsi_ble_on_connect_event(rsi_ble_event_conn_status_t * resp_conn);
-void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason);
-void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn);
-void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write);
-void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu);
-void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp);
-void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t data_len, uint8_t * data, uuid_t uuid,
+void rsi_ble_on_connect_event(rsi_ble_event_conn_status_t *resp_conn);
+void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t *resp_disconnect, uint16_t reason);
+void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t *resp_enh_conn);
+void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write);
+void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t *rsi_ble_mtu);
+void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp);
+void rsi_gatt_add_attribute_to_list(rsi_ble_t *p_val, uint16_t handle, uint16_t data_len, uint8_t *data, uuid_t uuid,
uint8_t char_prop);
-void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle,
+void rsi_ble_add_char_serv_att(void *serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle,
uuid_t att_val_uuid);
-void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t * data,
+void rsi_ble_add_char_val_att(void *serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t *data,
uint8_t data_len, uint8_t auth_read);
uint32_t rsi_ble_add_matter_service(void);
void rsi_ble_app_set_event(uint32_t event_num);
@@ -127,4 +120,4 @@ void rsi_ble_app_clear_event(uint32_t event_num);
void rsi_ble_app_init_events();
void rsi_ble_event_handling_task(void);
-#endif
\ No newline at end of file
+#endif
diff --git a/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp b/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp
index e45f38bcaeaf8e..c3a6e8aa656529 100644
--- a/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp
+++ b/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp
@@ -30,7 +30,7 @@
#include "FreeRTOS.h"
#include "event_groups.h"
-#define MAX_DHCP_TRIES 4
+#define MAX_DHCP_TRIES (4)
#define NETIF_IPV4_ADDRESS(X, Y) (((X) >> (8 * Y)) & 0xFF)
/* Station IP address */
@@ -77,9 +77,9 @@ void dhcpclient_set_link_state(int link_up)
* Don't need a task here. We get polled every 250ms
* @return None
************************************************************************************/
-uint8_t dhcpclient_poll(void * arg)
+uint8_t dhcpclient_poll(void *arg)
{
- struct netif * netif = (struct netif *) arg;
+ struct netif *netif = (struct netif *) arg;
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gw;
diff --git a/src/platform/silabs/SiWx917/wifi/dhcp_client.h b/src/platform/silabs/SiWx917/wifi/dhcp_client.h
index 3040f7112fb954..4ee9d2f5d0d68d 100644
--- a/src/platform/silabs/SiWx917/wifi/dhcp_client.h
+++ b/src/platform/silabs/SiWx917/wifi/dhcp_client.h
@@ -23,12 +23,12 @@ extern "C" {
#endif
// DHCP client states
-#define DHCP_OFF (uint8_t) 0
-#define DHCP_START (uint8_t) 1
-#define DHCP_WAIT_ADDRESS (uint8_t) 2
-#define DHCP_ADDRESS_ASSIGNED (uint8_t) 3
-#define DHCP_TIMEOUT (uint8_t) 4
-#define DHCP_LINK_DOWN (uint8_t) 5
+#define DHCP_OFF ((uint8_t) 0)
+#define DHCP_START ((uint8_t) 1)
+#define DHCP_WAIT_ADDRESS ((uint8_t) 2)
+#define DHCP_ADDRESS_ASSIGNED ((uint8_t) 3)
+#define DHCP_TIMEOUT ((uint8_t) 4)
+#define DHCP_LINK_DOWN ((uint8_t) 5)
/*****************************************************************************
* @fn void dhcpclient_set_link_state(int link_up)
diff --git a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp
index 13cc843d0e705d..59e932c28bd8c2 100644
--- a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp
+++ b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp
@@ -71,7 +71,7 @@ uint32_t gOverrunCount = 0;
* @return
* None
******************************************************************************/
-static void low_level_init(struct netif * netif)
+static void low_level_init(struct netif *netif)
{
/* set netif MAC hardware address length */
netif->hwaddr_len = ETH_HWADDR_LEN;
@@ -108,7 +108,7 @@ static void low_level_init(struct netif * netif)
* @return
* None
************************************************************************************/
-static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
+static void low_level_input(struct netif *netif, uint8_t *b, uint16_t len)
{
struct pbuf *p, *q;
uint32_t bufferoffset;
@@ -123,8 +123,8 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
}
/* Drop packets originated from the same interface and is not destined for the said interface */
- const uint8_t * src_mac = b + netif->hwaddr_len;
- const uint8_t * dst_mac = b;
+ const uint8_t *src_mac = b + netif->hwaddr_len;
+ const uint8_t *dst_mac = b;
if (!(ip6_addr_ispreferred(netif_ip6_addr_state(netif, 0))) && (memcmp(netif->hwaddr, src_mac, netif->hwaddr_len) == 0) &&
(memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0))
@@ -190,10 +190,10 @@ static SemaphoreHandle_t ethout_sem;
* @return
* ERR_OK if successful
******************************************************************************/
-static err_t low_level_output(struct netif * netif, struct pbuf * p)
+static err_t low_level_output(struct netif *netif, struct pbuf *p)
{
- void * rsipkt;
- struct pbuf * q;
+ void *rsipkt;
+ struct pbuf *q;
uint16_t framelength;
if (xSemaphoreTake(ethout_sem, portMAX_DELAY) != pdTRUE)
@@ -268,9 +268,9 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
* @return
* None
******************************************************************************/
-void wfx_host_received_sta_frame_cb(uint8_t * buf, int len)
+void wfx_host_received_sta_frame_cb(uint8_t *buf, int len)
{
- struct netif * ifp;
+ struct netif *ifp;
/* get the network interface for STATION interface,
* and forward the received frame buffer to LWIP
@@ -291,7 +291,7 @@ void wfx_host_received_sta_frame_cb(uint8_t * buf, int len)
* @return
* ERR_OK if successful
******************************************************************************/
-err_t sta_ethernetif_init(struct netif * netif)
+err_t sta_ethernetif_init(struct netif *netif)
{
LWIP_ASSERT("netif != NULL", (netif != NULL));
diff --git a/src/platform/silabs/SiWx917/wifi/ethernetif.h b/src/platform/silabs/SiWx917/wifi/ethernetif.h
index bac51b9258cd85..60010bffe53b68 100644
--- a/src/platform/silabs/SiWx917/wifi/ethernetif.h
+++ b/src/platform/silabs/SiWx917/wifi/ethernetif.h
@@ -30,7 +30,7 @@ extern "C" {
* @param netif the lwip network interface structure
* @returns ERR_OK if successful
******************************************************************************/
-err_t sta_ethernetif_init(struct netif * netif);
+err_t sta_ethernetif_init(struct netif *netif);
/***************************************************************************
* @fn err_t ap_ethernetif_init(struct netif *netif
@@ -40,9 +40,9 @@ err_t sta_ethernetif_init(struct netif * netif);
* @param netif the lwip network interface structure
* @returns ERR_OK if successful
******************************************************************************/
-err_t ap_ethernetif_init(struct netif * netif);
+err_t ap_ethernetif_init(struct netif *netif);
-void wfx_host_received_sta_frame_cb(uint8_t * buf, int len);
+void wfx_host_received_sta_frame_cb(uint8_t *buf, int len);
#ifdef __cplusplus
}
diff --git a/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp b/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp
index a2610ef97f600d..718a278b75f900 100644
--- a/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp
+++ b/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp
@@ -47,7 +47,7 @@ static struct netif ap_netif;
* @param[in] ap_if:
* @return None
*****************************************************************************/
-static void netif_config(struct netif * sta_if, struct netif * ap_if)
+static void netif_config(struct netif *sta_if, struct netif *ap_if)
{
if (sta_if != NULL)
{
@@ -134,7 +134,7 @@ void wfx_lwip_start(void)
* @param[in] interface:
* @return None
*****************************************************************************/
-struct netif * wfx_get_netif(sl_wfx_interface_t interface)
+struct netif* wfx_get_netif(sl_wfx_interface_t interface)
{
if (interface == SL_WFX_STA_INTERFACE)
{
diff --git a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h
index 2b0903ad8a5f25..de6f68f206857e 100644
--- a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h
+++ b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h
@@ -20,13 +20,6 @@
#include "stdbool.h"
#include "wfx_msgs.h"
-/* Wi-Fi events*/
-#define SL_WFX_STARTUP_IND_ID 1
-#define SL_WFX_CONNECT_IND_ID 2
-#define SL_WFX_DISCONNECT_IND_ID 3
-#define SL_WFX_SCAN_COMPLETE_ID 4
-#define WFX_RSI_SSID_SIZE 64
-
/* LwIP includes. */
#include "lwip/apps/httpd.h"
#include "lwip/ip_addr.h"
@@ -34,6 +27,15 @@
#include "lwip/netifapi.h"
#include "lwip/tcpip.h"
+#include "sl_status.h"
+
+/* Wi-Fi events*/
+#define SL_WFX_STARTUP_IND_ID (1)
+#define SL_WFX_CONNECT_IND_ID (2)
+#define SL_WFX_DISCONNECT_IND_ID (3)
+#define SL_WFX_SCAN_COMPLETE_ID (4)
+#define WFX_RSI_SSID_SIZE (64)
+
/* Wi-Fi bitmask events - for the task */
#define SL_WFX_CONNECT (1 << 1)
#define SL_WFX_DISCONNECT (1 << 2)
@@ -43,12 +45,10 @@
#define SL_WFX_SCAN_COMPLETE (1 << 6)
#define SL_WFX_RETRY_CONNECT (1 << 7)
-#include "sl_status.h"
-
-#define WLAN_TASK_STACK_SIZE 1024
-#define WLAN_TASK_PRIORITY 3
-#define WLAN_DRIVER_TASK_PRIORITY 2
-#define MAX_JOIN_RETRIES_COUNT 5
+#define WLAN_TASK_STACK_SIZE (1024)
+#define WLAN_TASK_PRIORITY (3)
+#define WLAN_DRIVER_TASK_PRIORITY (2)
+#define MAX_JOIN_RETRIES_COUNT (5)
// WLAN retry time intervals in milli seconds
#define WLAN_MAX_RETRY_TIMER_MS 30000
@@ -57,77 +57,77 @@
#define CONVERT_MS_TO_SEC(TimeInMS) (TimeInMS / 1000)
// WLAN related Macros
-#define ETH_FRAME 0
-#define CMP_SUCCESS 0
-#define BSSID_MAX_STR_LEN 6
-#define MAC_ADDRESS_FIRST_OCTET 6
-#define AP_START_SUCCESS 0
-#define BITS_TO_WAIT 0
-#define CONNECTION_STATUS_SUCCESS 1
-#define IP_STATUS_FAIL 0
-#define GET_IPV6_SUCCESS 1
-#define GET_IPV6_FAIL 0
-#define BEACON_1 0
-#define CHANNEL_LIST (const uint8_t *) 0
-#define CHANNEL_COUNT 0
-#define IE_DATA (const uint8_t *) 0
-#define IE_DATA_LENGTH 0
-#define BSSID_SCAN (const uint8_t *) 0
-#define CHANNEL_0 0
-#define PREVENT_ROAMING 1
-#define DISABLE_PMF_MODE 0
-#define STA_IP_FAIL 0
-#define IP_STATUS_SUCCESS 1
-#define ACTIVE_CHANNEL_TIME_100 100
-#define PASSIVE_CHANNEL_TIME_0 0
-#define PROBE_NUM_REQ_1 1
-
-#define PINOUT_CLEAR_STATUS 0
-#define TICKS_TO_WAIT_0 0
-#define TICKS_TO_WAIT_3 3
-#define TICKS_TO_WAIT_1 1
-#define TICKS_TO_WAIT_500 500
+#define ETH_FRAME (0)
+#define CMP_SUCCESS (0)
+#define BSSID_MAX_STR_LEN (6)
+#define MAC_ADDRESS_FIRST_OCTET (6)
+#define AP_START_SUCCESS (0)
+#define BITS_TO_WAIT (0)
+#define CONNECTION_STATUS_SUCCESS (1)
+#define IP_STATUS_FAIL (0)
+#define GET_IPV6_SUCCESS (1)
+#define GET_IPV6_FAIL (0)
+#define BEACON_1 (0)
+#define CHANNEL_LIST ((const uint8_t *) 0)
+#define CHANNEL_COUNT (0)
+#define IE_DATA ((const uint8_t *) 0)
+#define IE_DATA_LENGTH (0)
+#define BSSID_SCAN ((const uint8_t *) 0)
+#define CHANNEL_0 (0)
+#define PREVENT_ROAMING (1)
+#define DISABLE_PMF_MODE (0)
+#define STA_IP_FAIL (0)
+#define IP_STATUS_SUCCESS (1)
+#define ACTIVE_CHANNEL_TIME_100 (100)
+#define PASSIVE_CHANNEL_TIME_0 (0)
+#define PROBE_NUM_REQ_1 (1)
+
+#define PINOUT_CLEAR_STATUS (0)
+#define TICKS_TO_WAIT_0 (0)
+#define TICKS_TO_WAIT_3 (3)
+#define TICKS_TO_WAIT_1 (1)
+#define TICKS_TO_WAIT_500 (500)
// TASK and Interrupt Macros
-#define SUCCESS_STATUS 1
-#define LINK_UP 1
-#define LINK_DOWN 0
-#define MAC_48_BIT_SET 1
-#define STRUCT_PBUF (struct pbuf *) 0
-#define PRIORITY_0 0
-#define HEX_VALUE_FF 0XFF
+#define SUCCESS_STATUS (1)
+#define LINK_UP (1)
+#define LINK_DOWN (0)
+#define MAC_48_BIT_SET (1)
+#define STRUCT_PBUF ((struct pbuf *) 0)
+#define PRIORITY_0 (0)
+#define HEX_VALUE_FF (0XFF)
// Timer Delay
-#define MAX_XLEN 16
-#define MIN_XLEN 0
-#define PINOUT_CLEAR 0
-#define PINOUT_SET 1
-#define WFX_SPI_NVIC_PRIORITY 5
-#define WFX_GPIO_NVIC_PRIORITY 5
-#define CB_VALUE (DMADRV_Callback_t) 0
+#define MAX_XLEN (16)
+#define MIN_XLEN (0)
+#define PINOUT_CLEAR (0)
+#define PINOUT_SET (1)
+#define WFX_SPI_NVIC_PRIORITY (5)
+#define WFX_GPIO_NVIC_PRIORITY (5)
+#define CB_VALUE ((DMADRV_Callback_t) 0)
/* TIMER_TICKS_TO_WAIT Specifies the time, in ticks, that the calling task should
* be held in the Blocked state to wait for the start command to be successfully
* sent to the timer command queue.
*/
-#define TIMER_TICKS_TO_WAIT_0 pdMS_TO_TICKS(0)
+#define TIMER_TICKS_TO_WAIT_0 (pdMS_TO_TICKS(0))
-#define CONVERT_SEC_TO_MSEC 1000
+#define CONVERT_SEC_TO_MSEC (1000)
#define CONVERT_USEC_TO_MSEC (1 / 1000)
-#define RSI_RESPONSE_MAX_SIZE 28
-#define RSI_RESPONSE_HOLD_BUFF_SIZE 128
-#define RSI_DRIVER_STATUS 0
-#define OPER_MODE_0 0
-#define COEX_MODE_0 0
-#define RESP_BUFF_SIZE 6
-#define AP_CHANNEL_NO_0 0
-#define SCAN_BITMAP_OPTN_1 1
-#define IP_CONF_RSP_BUFF_LENGTH_4 4
-#define STATION 0
-#define BG_SCAN_RES_SIZE 500
+#define RSI_RESPONSE_MAX_SIZE (28)
+#define RSI_RESPONSE_HOLD_BUFF_SIZE (128)
+#define RSI_DRIVER_STATUS (0)
+#define OPER_MODE_0 (0)
+#define COEX_MODE_0 (0)
+#define RESP_BUFF_SIZE (6)
+#define AP_CHANNEL_NO_0 (0)
+#define SCAN_BITMAP_OPTN_1 (1)
+#define IP_CONF_RSP_BUFF_LENGTH_4 (4)
+#define STATION (0)
+#define BG_SCAN_RES_SIZE (500)
-#define SPI_CONFIG_SUCCESS 0
+#define SPI_CONFIG_SUCCESS (0)
typedef enum
{
@@ -201,12 +201,12 @@ extern "C" {
sl_status_t wfx_wifi_start(void);
void wfx_enable_sta_mode(void);
-void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr);
-void wfx_set_wifi_provision(wfx_wifi_provision_t * wifiConfig);
-bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig);
+void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t *addr);
+void wfx_set_wifi_provision(wfx_wifi_provision_t *wifiConfig);
+bool wfx_get_wifi_provision(wfx_wifi_provision_t *wifiConfig);
bool wfx_is_sta_mode_enabled(void);
-int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap);
-int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info);
+int32_t wfx_get_ap_info(wfx_wifi_scan_result_t *ap);
+int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t *extra_info);
int32_t wfx_reset_counts();
int32_t wfx_rsi_platform();
@@ -220,34 +220,34 @@ bool wfx_have_ipv4_addr(sl_wfx_interface_t);
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
bool wfx_have_ipv6_addr(sl_wfx_interface_t);
wifi_mode_t wfx_get_wifi_mode(void);
-bool wfx_start_scan(char * ssid, void (*scan_cb)(wfx_wifi_scan_result_t *)); /* true returned if successfully started */
+bool wfx_start_scan(char *ssid, void (*scan_cb)(wfx_wifi_scan_result_t *)); /* true returned if successfully started */
void wfx_cancel_scan(void);
/*
* Call backs into the Matter Platform code
*/
void wfx_started_notify(void);
-void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t * ap);
+void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t *ap);
void wfx_disconnected_notify(int32_t status);
/* Implemented for LWIP */
-void wfx_host_received_sta_frame_cb(uint8_t * buf, int len);
+void wfx_host_received_sta_frame_cb(uint8_t *buf, int len);
void wfx_lwip_set_sta_link_up(void);
void wfx_lwip_set_sta_link_down(void);
void wfx_lwip_start(void);
-struct netif * wfx_get_netif(sl_wfx_interface_t interface);
-#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
-void wfx_dhcp_got_ipv4(uint32_t);
-#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
+struct netif* wfx_get_netif(sl_wfx_interface_t interface);
bool wfx_hw_ready(void);
+
#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
+void wfx_dhcp_got_ipv4(uint32_t);
void wfx_ip_changed_notify(int got_ip);
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
+
void wfx_ipv6_notify(int got_ip);
/* RSI for LWIP */
void * wfx_rsi_alloc_pkt(void);
-void wfx_rsi_pkt_add_data(void * p, uint8_t * buf, uint16_t len, uint16_t off);
-int32_t wfx_rsi_send_data(void * p, uint16_t len);
+void wfx_rsi_pkt_add_data(void *p, uint8_t *buf, uint16_t len, uint16_t off);
+int32_t wfx_rsi_send_data(void *p, uint16_t len);
void wfx_retry_interval_handler(bool is_wifi_disconnection_event, uint16_t retryJoin);
diff --git a/src/platform/silabs/SiWx917/wifi/wfx_msgs.h b/src/platform/silabs/SiWx917/wifi/wfx_msgs.h
index edf0aec5828fa7..44ff525a56a347 100644
--- a/src/platform/silabs/SiWx917/wifi/wfx_msgs.h
+++ b/src/platform/silabs/SiWx917/wifi/wfx_msgs.h
@@ -62,29 +62,7 @@ typedef struct __attribute__((__packed__)) sl_wfx_startup_ind_body_s
uint32_t
status; ///< Initialization status. A value of zero indicates the boot is completed successfully (see enum sl_wfx_status_t)
uint16_t hardware_id; ///<=RO misc_read_reg7 register value
-#if 0 /* Not used in RS911x for now - use stuff here for the port */
- uint8_t opn[SL_WFX_OPN_SIZE]; ///<=OTP part_OPN
- uint8_t uid[SL_WFX_UID_SIZE]; ///<=OTP UID
- uint16_t num_inp_ch_bufs; ///= bufSize)
{
@@ -327,7 +328,7 @@ CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize)
return CHIP_NO_ERROR;
}
-CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName)
+CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char *deviceName)
{
ChipLogProgress(DeviceLayer, "_SetDeviceName Started");
if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported)
@@ -355,7 +356,7 @@ CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName)
return CHIP_NO_ERROR;
}
-void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
+void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent *event)
{
switch (event->Type)
{
@@ -400,13 +401,13 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
}
}
-bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId)
+bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SubscribeCharacteristic() not supported");
return false;
}
-bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId)
+bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::UnsubscribeCharacteristic() not supported");
return false;
@@ -428,7 +429,7 @@ bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId)
uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const
{
- CHIPoBLEConState * conState = const_cast(this)->GetConnectionState(conId);
+ CHIPoBLEConState *conState = const_cast(this)->GetConnectionState(conId);
return (conState != NULL) ? conState->mtu : 0;
}
@@ -436,26 +437,26 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU
PacketBufferHandle data)
{
int32_t status = 0;
- WFX_RSI_LOG("In send indication");
+ SILABS_LOG("In send indication");
status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()),
data->Start());
if (status != RSI_SUCCESS)
{
- WFX_RSI_LOG("indication %d failed with error code %lx ", status);
+ SILABS_LOG("indication %d failed with error code %lx ", status);
return false;
}
return true;
}
-bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId,
+bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId,
PacketBufferHandle pBuf)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendWriteRequest() not supported");
return false;
}
-bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId,
+bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID *svcId, const ChipBleUUID *charId,
PacketBufferHandle pBuf)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadRequest() not supported");
@@ -463,7 +464,7 @@ bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleU
}
bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext,
- const ChipBleUUID * svcId, const ChipBleUUID * charId)
+ const ChipBleUUID *svcId, const ChipBleUUID *charId)
{
ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadResponse() not supported");
return false;
@@ -684,7 +685,7 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void)
void BLEManagerImpl::UpdateMtu(rsi_ble_event_mtu_t evt)
{
- CHIPoBLEConState * bleConnState = GetConnectionState(event_msg.connectionHandle);
+ CHIPoBLEConState *bleConnState = GetConnectionState(event_msg.connectionHandle);
if (bleConnState != NULL)
{
// bleConnState->MTU is a 10-bit field inside a uint16_t. We're
@@ -727,17 +728,17 @@ void BLEManagerImpl::HandleConnectionCloseEvent(uint16_t reason)
status = rsi_bt_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP);
if (status != RSI_SUCCESS)
{
- WFX_RSI_LOG("BT Powersave Config Failed, Error Code : 0x%lX", status);
+ SILABS_LOG("BT Powersave Config Failed, Error Code : 0x%lX", status);
return;
}
status = rsi_wlan_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP);
if (status != RSI_SUCCESS)
{
- WFX_RSI_LOG("WLAN Powersave Config Failed, Error Code : 0x%lX", status);
+ SILABS_LOG("WLAN Powersave Config Failed, Error Code : 0x%lX", status);
return;
}
- WFX_RSI_LOG("Powersave Config Success");
+ SILABS_LOG("Powersave Config Success");
#endif
if (RemoveConnection(connHandle))
@@ -776,11 +777,11 @@ void BLEManagerImpl::HandleWriteEvent(rsi_ble_event_write_t evt)
ChipLogProgress(DeviceLayer, "Char Write Req, packet type %d", evt.pkt_type);
// uint8_t attribute = (uint8_t) event_msg.rsi_ble_measurement_hndl;
- WFX_RSI_LOG("event_msg.rsi_ble_gatt_server_client_config_hndl = %d", event_msg.rsi_ble_gatt_server_client_config_hndl);
+ SILABS_LOG("event_msg.rsi_ble_gatt_server_client_config_hndl = %d", event_msg.rsi_ble_gatt_server_client_config_hndl);
if (evt.handle[0] == (uint8_t) event_msg.rsi_ble_gatt_server_client_config_hndl) // TODO:: compare the handle exactly
{
- WFX_RSI_LOG("Inside HandleTXCharCCCDWrite ");
+ SILABS_LOG("Inside HandleTXCharCCCDWrite ");
HandleTXCharCCCDWrite(&evt);
}
else
@@ -821,7 +822,7 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt)
}
}
-void BLEManagerImpl::HandleRXCharWrite(rsi_ble_event_write_t * evt)
+void BLEManagerImpl::HandleRXCharWrite(rsi_ble_event_write_t *evt)
{
uint8_t conId = 1;
CHIP_ERROR err = CHIP_NO_ERROR;
diff --git a/src/platform/silabs/efr32/rs911x/rsi_ble_config.h b/src/platform/silabs/efr32/rs911x/rsi_ble_config.h
index e2bf5b05b36158..b52edb739565ea 100644
--- a/src/platform/silabs/efr32/rs911x/rsi_ble_config.h
+++ b/src/platform/silabs/efr32/rs911x/rsi_ble_config.h
@@ -20,6 +20,7 @@
#include "rsi_ble_apis.h"
#include
+
/******************************************************
* * Macros
* ******************************************************/
@@ -256,7 +257,7 @@ typedef struct rsi_ble_att_list_s
uint16_t value_len;
uint16_t max_value_len;
uint8_t char_val_prop;
- void * value;
+ void *value;
} rsi_ble_att_list_t;
typedef struct rsi_ble_s
{
@@ -266,4 +267,4 @@ typedef struct rsi_ble_s
rsi_ble_att_list_t att_rec_list[NO_OF_VAL_ATT];
} rsi_ble_t;
-#endif
\ No newline at end of file
+#endif
diff --git a/src/platform/silabs/efr32/rs911x/wfx_sl_ble_init.c b/src/platform/silabs/efr32/rs911x/wfx_sl_ble_init.c
index b2323e13980a69..20a6f93e567e57 100644
--- a/src/platform/silabs/efr32/rs911x/wfx_sl_ble_init.c
+++ b/src/platform/silabs/efr32/rs911x/wfx_sl_ble_init.c
@@ -53,7 +53,7 @@ const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF };
*/
void rsi_ble_app_init_events()
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.ble_app_event_map = 0;
event_msg.ble_app_event_mask = 0xFFFFFFFF;
event_msg.ble_app_event_mask = event_msg.ble_app_event_mask; // To suppress warning while compiling
@@ -71,7 +71,7 @@ void rsi_ble_app_init_events()
*/
void rsi_ble_app_clear_event(uint32_t event_num)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.event_num = event_num;
event_msg.ble_app_event_map &= ~BIT(event_num);
return;
@@ -86,9 +86,9 @@ void rsi_ble_app_clear_event(uint32_t event_num)
* @section description
* This callback function is invoked when mtu exhange event is received
*/
-void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu)
+void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t *rsi_ble_mtu)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
memcpy(&event_msg.rsi_ble_mtu, rsi_ble_mtu, sizeof(rsi_ble_event_mtu_t));
rsi_ble_app_set_event(RSI_BLE_MTU_EVENT);
}
@@ -103,9 +103,9 @@ void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu)
* @section description
* This callback function is invoked when write/notify/indication events are received
*/
-void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write)
+void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.event_id = event_id;
memcpy(&event_msg.rsi_ble_write, rsi_ble_write, sizeof(rsi_ble_event_write_t));
rsi_ble_app_set_event(RSI_BLE_GATT_WRITE_EVENT);
@@ -120,9 +120,9 @@ void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_
* @section description
* This callback function indicates the status of the connection
*/
-void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn)
+void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t *resp_enh_conn)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.connectionHandle = 1;
event_msg.bondingHandle = 255;
memcpy(event_msg.resp_enh_conn.dev_addr, resp_enh_conn->dev_addr, RSI_DEV_ADDR_LEN);
@@ -139,9 +139,9 @@ void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t *
* @section description
* This callback function indicates disconnected device information and status
*/
-void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason)
+void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t *resp_disconnect, uint16_t reason)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.reason = reason;
rsi_ble_app_set_event(RSI_BLE_DISCONN_EVENT);
}
@@ -155,9 +155,9 @@ void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, u
* @return none
* @section description
*/
-void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp)
+void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.resp_status = resp_status;
memcpy(&event_msg.rsi_ble_event_set_att_rsp, rsi_ble_event_set_att_rsp, sizeof(rsi_ble_set_att_resp_t));
rsi_ble_app_set_event(RSI_BLE_GATT_INDICATION_CONFIRMATION);
@@ -200,7 +200,7 @@ int32_t rsi_ble_app_get_event(void)
*/
void rsi_ble_app_set_event(uint32_t event_num)
{
- WFX_RSI_LOG("%s: starting", __func__);
+ SILABS_LOG("%s: starting", __func__);
event_msg.ble_app_event_map |= BIT(event_num);
rsi_semaphore_post(&sl_ble_event_sem);
return;
@@ -219,7 +219,7 @@ void rsi_ble_app_set_event(uint32_t event_num)
* @section description
* This function is used to store all attribute records
*/
-void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t data_len, uint8_t * data, uuid_t uuid,
+void rsi_gatt_add_attribute_to_list(rsi_ble_t *p_val, uint16_t handle, uint16_t data_len, uint8_t *data, uuid_t uuid,
uint8_t char_prop)
{
if ((p_val->DATA_ix + data_len) >= BLE_ATT_REC_SIZE)
@@ -254,7 +254,7 @@ void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t
* @section description
* This function is used at application to add characteristic attribute
*/
-void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle, uuid_t att_val_uuid)
+void rsi_ble_add_char_serv_att(void *serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle, uuid_t att_val_uuid)
{
rsi_ble_req_add_att_t new_att = { 0 };
@@ -302,7 +302,7 @@ void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val
* This function is used at application to create new service.
*/
-void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t * data,
+void rsi_ble_add_char_val_att(void *serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t *data,
uint8_t data_len, uint8_t auth_read)
{
rsi_ble_req_add_att_t new_att = { 0 };
@@ -419,4 +419,4 @@ uint32_t rsi_ble_add_matter_service(void)
memset(&data, 0, sizeof(data));
return 0;
-}
\ No newline at end of file
+}
diff --git a/src/platform/silabs/efr32/wifi/dhcp_client.cpp b/src/platform/silabs/efr32/wifi/dhcp_client.cpp
index 15c678515a0e62..7f6e3abc919946 100644
--- a/src/platform/silabs/efr32/wifi/dhcp_client.cpp
+++ b/src/platform/silabs/efr32/wifi/dhcp_client.cpp
@@ -83,13 +83,13 @@ void dhcpclient_set_link_state(int link_up)
* Don't need a task here. We get polled every 250ms
* @return None
************************************************************************************/
-uint8_t dhcpclient_poll(void * arg)
+uint8_t dhcpclient_poll(void *arg)
{
- struct netif * netif = (struct netif *) arg;
+ struct netif *netif = (struct netif *) arg;
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gw;
- struct dhcp * dhcp;
+ struct dhcp *dhcp;
switch (dhcp_state)
{
diff --git a/src/platform/silabs/efr32/wifi/dhcp_client.h b/src/platform/silabs/efr32/wifi/dhcp_client.h
index 3040f7112fb954..21f23d63f52dee 100644
--- a/src/platform/silabs/efr32/wifi/dhcp_client.h
+++ b/src/platform/silabs/efr32/wifi/dhcp_client.h
@@ -23,12 +23,12 @@ extern "C" {
#endif
// DHCP client states
-#define DHCP_OFF (uint8_t) 0
-#define DHCP_START (uint8_t) 1
-#define DHCP_WAIT_ADDRESS (uint8_t) 2
-#define DHCP_ADDRESS_ASSIGNED (uint8_t) 3
-#define DHCP_TIMEOUT (uint8_t) 4
-#define DHCP_LINK_DOWN (uint8_t) 5
+#define DHCP_OFF ((uint8_t) 0)
+#define DHCP_START ((uint8_t) 1)
+#define DHCP_WAIT_ADDRESS ((uint8_t) 2)
+#define DHCP_ADDRESS_ASSIGNED ((uint8_t) 3)
+#define DHCP_TIMEOUT ((uint8_t) 4)
+#define DHCP_LINK_DOWN ((uint8_t) 5)
/*****************************************************************************
* @fn void dhcpclient_set_link_state(int link_up)
@@ -37,7 +37,7 @@ extern "C" {
* @param link_up link status
******************************************************************************/
void dhcpclient_set_link_state(int link_up);
-uint8_t dhcpclient_poll(void * arg);
+uint8_t dhcpclient_poll(void *arg);
#ifdef __cplusplus
}
#endif
diff --git a/src/platform/silabs/efr32/wifi/ethernetif.cpp b/src/platform/silabs/efr32/wifi/ethernetif.cpp
index d1fcc01f3c4f9b..a4e200371edc5c 100644
--- a/src/platform/silabs/efr32/wifi/ethernetif.cpp
+++ b/src/platform/silabs/efr32/wifi/ethernetif.cpp
@@ -77,7 +77,7 @@ uint32_t gOverrunCount = 0;
* @return
* None
******************************************************************************/
-static void low_level_init(struct netif * netif)
+static void low_level_init(struct netif *netif)
{
/* set netif MAC hardware address length */
netif->hwaddr_len = ETH_HWADDR_LEN;
@@ -114,7 +114,7 @@ static void low_level_init(struct netif * netif)
* @return
* None
************************************************************************************/
-static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
+static void low_level_input(struct netif *netif, uint8_t *b, uint16_t len)
{
struct pbuf *p, *q;
uint32_t bufferoffset;
@@ -129,8 +129,8 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
}
/* Drop packets originated from the same interface and is not destined for the said interface */
- const uint8_t * src_mac = b + netif->hwaddr_len;
- const uint8_t * dst_mac = b;
+ const uint8_t *src_mac = b + netif->hwaddr_len;
+ const uint8_t *dst_mac = b;
if (!(ip6_addr_ispreferred(netif_ip6_addr_state(netif, 0))) && (memcmp(netif->hwaddr, src_mac, netif->hwaddr_len) == 0) &&
(memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0))
@@ -197,9 +197,9 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
* ERR_OK if successful
******************************************************************************/
#ifdef WF200_WIFI
-static err_t low_level_output(struct netif * netif, struct pbuf * p)
+static err_t low_level_output(struct netif *netif, struct pbuf *p)
{
- struct pbuf * q;
+ struct pbuf *q;
sl_wfx_send_frame_req_t * tx_buffer;
uint8_t * buffer;
uint32_t framelength, asize;
@@ -278,9 +278,9 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
* @return
* None
******************************************************************************/
-void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t * rx_buffer)
+void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t *rx_buffer)
{
- struct netif * netif;
+ struct netif *netif;
/* Check packet interface to send to AP or STA interface */
if ((rx_buffer->header.info & SL_WFX_MSG_INFO_INTERFACE_MASK) == (SL_WFX_STA_INTERFACE << SL_WFX_MSG_INFO_INTERFACE_OFFSET))
@@ -331,10 +331,10 @@ static SemaphoreHandle_t ethout_sem;
* @return
* ERR_OK if successful
******************************************************************************/
-static err_t low_level_output(struct netif * netif, struct pbuf * p)
+static err_t low_level_output(struct netif *netif, struct pbuf *p)
{
- void * rsipkt;
- struct pbuf * q;
+ void *rsipkt;
+ struct pbuf *q;
uint16_t framelength;
if (xSemaphoreTake(ethout_sem, portMAX_DELAY) != pdTRUE)
@@ -360,7 +360,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
}
#ifdef WIFI_DEBUG_ENABLED
- uint8_t * b = (uint8_t *) p->payload;
+ uint8_t *b = (uint8_t *) p->payload;
SILABS_LOG("EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0], b[1], b[2], b[3],
b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13]);
#endif
@@ -409,9 +409,9 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
* @return
* None
******************************************************************************/
-void wfx_host_received_sta_frame_cb(uint8_t * buf, int len)
+void wfx_host_received_sta_frame_cb(uint8_t *buf, int len)
{
- struct netif * ifp;
+ struct netif *ifp;
/* get the network interface for STATION interface,
* and forward the received frame buffer to LWIP
@@ -434,7 +434,7 @@ void wfx_host_received_sta_frame_cb(uint8_t * buf, int len)
* @return
* ERR_OK if successful
******************************************************************************/
-err_t sta_ethernetif_init(struct netif * netif)
+err_t sta_ethernetif_init(struct netif *netif)
{
LWIP_ASSERT("netif != NULL", (netif != NULL));
diff --git a/src/platform/silabs/efr32/wifi/ethernetif.h b/src/platform/silabs/efr32/wifi/ethernetif.h
index dfea1ea6ad3540..9c4818214ff562 100644
--- a/src/platform/silabs/efr32/wifi/ethernetif.h
+++ b/src/platform/silabs/efr32/wifi/ethernetif.h
@@ -30,7 +30,7 @@ extern "C" {
* @param netif the lwip network interface structure
* @returns ERR_OK if successful
******************************************************************************/
-err_t sta_ethernetif_init(struct netif * netif);
+err_t sta_ethernetif_init(struct netif *netif);
/***************************************************************************
* @fn err_t ap_ethernetif_init(struct netif *netif
@@ -40,12 +40,12 @@ err_t sta_ethernetif_init(struct netif * netif);
* @param netif the lwip network interface structure
* @returns ERR_OK if successful
******************************************************************************/
-err_t ap_ethernetif_init(struct netif * netif);
+err_t ap_ethernetif_init(struct netif *netif);
#ifdef WF200_WIFI
-void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t * rx_buffer);
+void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t *rx_buffer);
#else
-void wfx_host_received_sta_frame_cb(uint8_t * buf, int len);
+void wfx_host_received_sta_frame_cb(uint8_t *buf, int len);
#endif /* WF200_WIFI */
#ifdef __cplusplus
}
diff --git a/src/platform/silabs/efr32/wifi/lwip_netif.cpp b/src/platform/silabs/efr32/wifi/lwip_netif.cpp
index ac91ad7a14ed75..7673b11ca75509 100644
--- a/src/platform/silabs/efr32/wifi/lwip_netif.cpp
+++ b/src/platform/silabs/efr32/wifi/lwip_netif.cpp
@@ -53,7 +53,7 @@ static struct netif ap_netif;
* @param[in] ap_if:
* @return None
*****************************************************************************/
-static void netif_config(struct netif * sta_if, struct netif * ap_if)
+static void netif_config(struct netif *sta_if, struct netif *ap_if)
{
if (sta_if != NULL)
{
@@ -140,7 +140,7 @@ void wfx_lwip_start(void)
* @param[in] interface:
* @return None
*****************************************************************************/
-struct netif * wfx_get_netif(sl_wfx_interface_t interface)
+struct netif* wfx_get_netif(sl_wfx_interface_t interface)
{
if (interface == SL_WFX_STA_INTERFACE)
{
diff --git a/src/platform/silabs/efr32/wifi/wfx_host_events.h b/src/platform/silabs/efr32/wifi/wfx_host_events.h
index 1d41c750517c82..895601f2100208 100644
--- a/src/platform/silabs/efr32/wifi/wfx_host_events.h
+++ b/src/platform/silabs/efr32/wifi/wfx_host_events.h
@@ -308,13 +308,13 @@ void sl_wfx_host_gpio_init(void);
sl_status_t wfx_wifi_start(void);
void wfx_enable_sta_mode(void);
sl_wfx_state_t wfx_get_wifi_state(void);
-void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr);
-void wfx_set_wifi_provision(wfx_wifi_provision_t * wifiConfig);
-bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig);
+void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t *addr);
+void wfx_set_wifi_provision(wfx_wifi_provision_t *wifiConfig);
+bool wfx_get_wifi_provision(wfx_wifi_provision_t *wifiConfig);
bool wfx_is_sta_provisioned(void);
bool wfx_is_sta_mode_enabled(void);
-int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap);
-int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info);
+int32_t wfx_get_ap_info(wfx_wifi_scan_result_t *ap);
+int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t *extra_info);
int32_t wfx_reset_counts();
void wfx_clear_wifi_provision(void);
@@ -327,21 +327,21 @@ bool wfx_have_ipv4_addr(sl_wfx_interface_t);
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
bool wfx_have_ipv6_addr(sl_wfx_interface_t);
wifi_mode_t wfx_get_wifi_mode(void);
-bool wfx_start_scan(char * ssid, void (*scan_cb)(wfx_wifi_scan_result_t *)); /* true returned if successfuly started */
+bool wfx_start_scan(char *ssid, void (*scan_cb)(wfx_wifi_scan_result_t *)); /* true returned if successfuly started */
void wfx_cancel_scan(void);
/*
* Call backs into the Matter Platform code
*/
void wfx_started_notify(void);
-void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t * ap);
+void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t *ap);
void wfx_disconnected_notify(int32_t status);
/* Implemented for LWIP */
-void wfx_host_received_sta_frame_cb(uint8_t * buf, int len);
+void wfx_host_received_sta_frame_cb(uint8_t *buf, int len);
void wfx_lwip_set_sta_link_up(void);
void wfx_lwip_set_sta_link_down(void);
void wfx_lwip_start(void);
-struct netif * wfx_get_netif(sl_wfx_interface_t interface);
+struct netif* wfx_get_netif(sl_wfx_interface_t interface);
#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
void wfx_dhcp_got_ipv4(uint32_t);
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
@@ -353,16 +353,16 @@ void wfx_ipv6_notify(int got_ip);
#ifdef RS911X_WIFI
/* RSI for LWIP */
-void * wfx_rsi_alloc_pkt(void);
-void wfx_rsi_pkt_add_data(void * p, uint8_t * buf, uint16_t len, uint16_t off);
-int32_t wfx_rsi_send_data(void * p, uint16_t len);
+void* wfx_rsi_alloc_pkt(void);
+void wfx_rsi_pkt_add_data(void *p, uint8_t *buf, uint16_t len, uint16_t off);
+int32_t wfx_rsi_send_data(void *p, uint16_t len);
#endif /* RS911X_WIFI */
#ifdef WF200_WIFI
void wfx_bus_start(void);
sl_status_t get_all_counters(void);
void sl_wfx_host_gpio_init(void);
-sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload);
+sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t *event_payload);
#endif
void wfx_retry_interval_handler(bool is_wifi_disconnection_event, uint16_t retryJoin);
diff --git a/src/platform/silabs/efr32/wifi/wfx_msgs.h b/src/platform/silabs/efr32/wifi/wfx_msgs.h
index edf0aec5828fa7..8dfdc9f40e49b0 100644
--- a/src/platform/silabs/efr32/wifi/wfx_msgs.h
+++ b/src/platform/silabs/efr32/wifi/wfx_msgs.h
@@ -59,8 +59,7 @@ typedef struct __attribute__((__packed__)) sl_wfx_generic_message_s
*/
typedef struct __attribute__((__packed__)) sl_wfx_startup_ind_body_s
{
- uint32_t
- status; ///< Initialization status. A value of zero indicates the boot is completed successfully (see enum sl_wfx_status_t)
+ uint32_t status; ///< Initialization status. A value of zero indicates the boot is completed successfully (see enum sl_wfx_status_t)
uint16_t hardware_id; ///<=RO misc_read_reg7 register value
#if 0 /* Not used in RS911x for now - use stuff here for the port */
uint8_t opn[SL_WFX_OPN_SIZE]; ///<=OTP part_OPN
diff --git a/src/platform/silabs/efr32/wifi/wfx_notify.cpp b/src/platform/silabs/efr32/wifi/wfx_notify.cpp
index bbc7f91570de21..c1ea2839026e85 100644
--- a/src/platform/silabs/efr32/wifi/wfx_notify.cpp
+++ b/src/platform/silabs/efr32/wifi/wfx_notify.cpp
@@ -86,7 +86,7 @@ void wfx_started_notify()
* @param[in] ap: access point
* @return None
*************************************************************************************/
-void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t * ap)
+void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t *ap)
{
sl_wfx_connect_ind_t evt;
diff --git a/src/platform/silabs/efr32/wifi/wifi_config.h b/src/platform/silabs/efr32/wifi/wifi_config.h
index 88ad34b5741649..8e00201b7fc102 100644
--- a/src/platform/silabs/efr32/wifi/wifi_config.h
+++ b/src/platform/silabs/efr32/wifi/wifi_config.h
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#ifndef DEMO_CONFIG_H
-#define DEMO_CONFIG_H
+#ifndef WIFI_CONFIG_H
+#define WIFI_CONFIG_H
#define USE_DHCP_CLIENT_DEFAULT 1 ///< If defined, DHCP is enabled, otherwise static address below is used
@@ -38,24 +38,6 @@
#define STA_GW_ADDR2_DEFAULT (uint8_t) 0 ///< Static IP: Gateway value 2
#define STA_GW_ADDR3_DEFAULT (uint8_t) 0 ///< Static IP: Gateway value 3
-/************************** Access Point Static Default ****************************/
-// #define AP_IP_ADDR0_DEFAULT (uint8_t) 10 ///< Static IP: IP address value 0
-// #define AP_IP_ADDR1_DEFAULT (uint8_t) 10 ///< Static IP: IP address value 1
-// #define AP_IP_ADDR2_DEFAULT (uint8_t) 0 ///< Static IP: IP address value 2
-// #define AP_IP_ADDR3_DEFAULT (uint8_t) 1 ///< Static IP: IP address value 3
-
-/*NETMASK*/
-// #define AP_NETMASK_ADDR0_DEFAULT (uint8_t) 255 ///< Static IP: Netmask value 0
-// #define AP_NETMASK_ADDR1_DEFAULT (uint8_t) 255 ///< Static IP: Netmask value 1
-// #define AP_NETMASK_ADDR2_DEFAULT (uint8_t) 255 ///< Static IP: Netmask value 2
-// #define AP_NETMASK_ADDR3_DEFAULT (uint8_t) 0 ///< Static IP: Netmask value 3
-
-/*Gateway Address*/
-// #define AP_GW_ADDR0_DEFAULT (uint8_t) 0 ///< Static IP: Gateway value 0
-// #define AP_GW_ADDR1_DEFAULT (uint8_t) 0 ///< Static IP: Gateway value 1
-// #define AP_GW_ADDR2_DEFAULT (uint8_t) 0 ///< Static IP: Gateway value 2
-// #define AP_GW_ADDR3_DEFAULT (uint8_t) 0 ///< Static IP: Gateway value 3
-
#define WLAN_SSID_DEFAULT "AP_name" ///< wifi ssid for client mode
#define WLAN_PASSKEY_DEFAULT "passkey" ///< wifi password for client mode
#define WLAN_SECURITY_DEFAULT WFM_SECURITY_MODE_WPA2_PSK ///< wifi security mode for client mode:
@@ -68,4 +50,4 @@
#define SOFTAP_CHANNEL_DEFAULT 6 ///< wifi channel for soft ap
-#endif // DEMO_CONFIG_H
+#endif // WIFI_CONFIG_H