Skip to content

Commit

Permalink
[Silabs] Adds fix for wifi diagnostics attributes (#23932)
Browse files Browse the repository at this point in the history
* Adds fix for wifi diagnostics attributes

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Sep 13, 2023
1 parent b95b7b6 commit 4150884
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/platform/silabs/efr32/wf200/host_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication
{
uint8_t * mac = connect_indication_body.mac;
uint32_t status = connect_indication_body.status;
ap_info.chan = connect_indication_body.channel;
memcpy(&ap_info.security, &wifi_provision.security, sizeof(wifi_provision.security));
switch (status)
{
case WFM_STATUS_SUCCESS: {
Expand Down
12 changes: 12 additions & 0 deletions src/platform/silabs/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,18 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiOverrunCount(uint64_t & overrunCou
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconRxCount(uint32_t & beaconRxCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if (err == 0)
{
beaconRxCount = extra_info.beacon_rx_count;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts()
{
int32_t err = wfx_reset_counts();
Expand Down
1 change: 1 addition & 0 deletions src/platform/silabs/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
CHIP_ERROR GetWiFiBeaconRxCount(uint32_t & beaconRxCount) override;
CHIP_ERROR GetWiFiPacketMulticastRxCount(uint32_t & packetMulticastRxCount) override;
CHIP_ERROR GetWiFiPacketMulticastTxCount(uint32_t & packetMulticastTxCount) override;
CHIP_ERROR GetWiFiPacketUnicastRxCount(uint32_t & packetUnicastRxCount) override;
Expand Down

0 comments on commit 4150884

Please sign in to comment.