Skip to content

Commit

Permalink
Restyled files
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahay-silabs committed Jun 29, 2022
1 parent 5e22119 commit d416925
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
39 changes: 24 additions & 15 deletions src/platform/EFR32/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if(err == 0){
BssId = ByteSpan(ap.bssid,6);
if (err == 0)
{
BssId = ByteSpan(ap.bssid, 6);
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
Expand All @@ -357,7 +358,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(uint8_t & securityTyp
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if(err == 0){
if (err == 0)
{
securityType = ap.security;
return CHIP_NO_ERROR;
}
Expand All @@ -374,7 +376,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNu
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if(err == 0){
if (err == 0)
{
channelNumber = ap.chan;
return CHIP_NO_ERROR;
}
Expand All @@ -385,7 +388,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi)
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if(err == 0){
if (err == 0)
{
rssi = ap.rssi;
return CHIP_NO_ERROR;
}
Expand All @@ -396,7 +400,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconLostCount(uint32_t & beaconL
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if(err ==0){
if (err == 0)
{
beaconLostCount = extra_info.beacon_lost_count;
return CHIP_NO_ERROR;
}
Expand All @@ -412,7 +417,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketMulticastRxCount(uint32_t &
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if(err ==0){
if (err == 0)
{
packetMulticastRxCount = extra_info.mcast_rx_count;
return CHIP_NO_ERROR;
}
Expand All @@ -423,7 +429,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketMulticastTxCount(uint32_t &
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if(err ==0){
if (err == 0)
{
packetMulticastTxCount = extra_info.mcast_tx_count;
return CHIP_NO_ERROR;
}
Expand All @@ -434,32 +441,35 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastRxCount(uint32_t & pa
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if(err ==0){
if (err == 0)
{
packetUnicastRxCount = extra_info.ucast_rx_count;
return CHIP_NO_ERROR;
}
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastTxCount(uint32_t & packetUnicastTxCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if(err ==0){
if (err == 0)
{
packetUnicastTxCount = extra_info.ucast_tx_count;
return CHIP_NO_ERROR;
}
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiOverrunCount(uint64_t & overrunCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if(err ==0){
if (err == 0)
{
overrunCount = extra_info.overrun_count;
return CHIP_NO_ERROR;
}
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

Expand All @@ -469,6 +479,5 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts()
}
#endif // SL_WIFI


} // namespace DeviceLayer
} // namespace chip
30 changes: 15 additions & 15 deletions src/platform/EFR32/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetNetworkInterfaces(NetworkInterface ** netifpp) override;
void ReleaseNetworkInterfaces(NetworkInterface * netifp) override;

#if SL_WIFI
CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(uint8_t & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
CHIP_ERROR GetWiFiPacketMulticastRxCount(uint32_t & packetMulticastRxCount) override;
CHIP_ERROR GetWiFiPacketMulticastTxCount(uint32_t & packetMulticastTxCount) override;
CHIP_ERROR GetWiFiPacketUnicastRxCount(uint32_t & packetUnicastRxCount) override;
CHIP_ERROR GetWiFiPacketUnicastTxCount(uint32_t & packetUnicastTxCount) override;
CHIP_ERROR GetWiFiCurrentMaxRate(uint64_t & currentMaxRate) override;
CHIP_ERROR GetWiFiOverrunCount(uint64_t & overrunCount) override;
CHIP_ERROR ResetWiFiNetworkDiagnosticsCounts() override;
#endif // SL_WIFI
#if SL_WIFI
CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(uint8_t & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
CHIP_ERROR GetWiFiPacketMulticastRxCount(uint32_t & packetMulticastRxCount) override;
CHIP_ERROR GetWiFiPacketMulticastTxCount(uint32_t & packetMulticastTxCount) override;
CHIP_ERROR GetWiFiPacketUnicastRxCount(uint32_t & packetUnicastRxCount) override;
CHIP_ERROR GetWiFiPacketUnicastTxCount(uint32_t & packetUnicastTxCount) override;
CHIP_ERROR GetWiFiCurrentMaxRate(uint64_t & currentMaxRate) override;
CHIP_ERROR GetWiFiOverrunCount(uint64_t & overrunCount) override;
CHIP_ERROR ResetWiFiNetworkDiagnosticsCounts() override;
#endif // SL_WIFI
};

} // namespace DeviceLayer
Expand Down

0 comments on commit d416925

Please sign in to comment.