Skip to content

Commit

Permalink
[EFR32]Feature wifinetworkdiagnostics implmentation for RS9116 (#20123)
Browse files Browse the repository at this point in the history
* added wifinetworkdiagnostics implementation for rs911x

* Restyled files

* resolving comments, issue with handing out the pointer(ap.bssid) and using an array

* Restyled files

Co-authored-by: rosahay-silabs <[email protected]>
  • Loading branch information
chirag-silabs and rosahay-silabs authored Jul 1, 2022
1 parent a295bec commit a1336d5
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 2 deletions.
140 changes: 140 additions & 0 deletions src/platform/EFR32/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,5 +341,145 @@ void DiagnosticDataProviderImpl::ReleaseNetworkInterfaces(NetworkInterface * net
}
}

#if SL_WIFI
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
static uint8_t bssid[6];
if (err == 0)
{
memcpy(bssid, ap.bssid, 6);
BssId = ByteSpan(bssid, 6);
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(uint8_t & securityType)
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if (err == 0)
{
securityType = ap.security;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
{
wifiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_802__11N;
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNumber)
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if (err == 0)
{
channelNumber = ap.chan;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi)
{
wfx_wifi_scan_result_t ap;
int32_t err = wfx_get_ap_info(&ap);
if (err == 0)
{
rssi = ap.rssi;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconLostCount(uint32_t & beaconLostCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if (err == 0)
{
beaconLostCount = extra_info.beacon_lost_count;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiCurrentMaxRate(uint64_t & currentMaxRate)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketMulticastRxCount(uint32_t & packetMulticastRxCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if (err == 0)
{
packetMulticastRxCount = extra_info.mcast_rx_count;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketMulticastTxCount(uint32_t & packetMulticastTxCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
if (err == 0)
{
packetMulticastTxCount = extra_info.mcast_tx_count;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastRxCount(uint32_t & packetUnicastRxCount)
{
wfx_wifi_scan_ext_t extra_info;
int32_t err = wfx_get_ap_ext(&extra_info);
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)
{
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)
{
overrunCount = extra_info.overrun_count;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts()
{
return CHIP_NO_ERROR;
}
#endif // SL_WIFI

} // namespace DeviceLayer
} // namespace chip
16 changes: 16 additions & 0 deletions src/platform/EFR32/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetActiveNetworkFaults(GeneralFaults<kMaxNetworkFaults> & networkFaults) override;
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
};

} // namespace DeviceLayer
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/wiseconnect-wifi-bt-sdk
Submodule wiseconnect-wifi-bt-sdk updated 45 files
+0 −0 examples/at_commands/teraterm/ble_central/ble_central.ttl
+0 −0 examples/at_commands/teraterm/ble_peripheral/ble_peripheral.ttl
+3 −4 examples/featured/firmware_update/rsi_firmware_update_app.c
+3 −4 examples/featured/powersave_standby_associated/rsi_wlan_connected_sleep_app.c
+0 −0 examples/snippets/ble/ble_datalength/rsi_ble_config.h
+0 −0 examples/snippets/ble/ble_ibeacon/rsi_ble_config.h
+0 −0 examples/snippets/ble/ble_multiconnection_gatt_test/readme.md
+0 −0 examples/snippets/ble/ble_multiconnection_gatt_test/rsi_ble_device_info.h
+0 −0 examples/snippets/ble/ble_multiconnection_gatt_test/rsi_common_config.h
+0 −0 examples/snippets/ble/ble_privacy/rsi_ble_config.h
+ examples/snippets/bt/bt_spp_dual_role_with_secure_pairing/rsi_wc_app
+29 −8 examples/snippets/wlan/concurrent_mode/rsi_concurrent_mode.c
+3 −4 examples/snippets/wlan/embedded_mqtt/rsi_emb_mqtt.c
+3 −4 examples/snippets/wlan/enterprise_client/rsi_eap_connectivity.c
+3 −4 examples/snippets/wlan/ftp_client/rsi_ftp_client.c
+3 −4 examples/snippets/wlan/power_save_deep_sleep/rsi_wlan_power_save_profile.c
+2 −3 examples/snippets/wlan/station_ping/rsi_station_ping.c
+3 −4 examples/snippets/wlan/tcp_logging_stats/rsi_wlan_tcp_logging_stats.c
+4 −5 examples/snippets/wlan/three_ssl_concurrent_client_sockets/rsi_three_ssl_client_sockets.c
+4 −5 examples/snippets/wlan/tls_client/rsi_ssl_client_tls_versions.c
+2 −2 examples/snippets/wlan_bt_ble/wlan_https_bt_spp_ble_dual_role/readme.md
+ examples/snippets/wlan_bt_ble/wlan_https_bt_spp_ble_dual_role/resources/readme/image7a.png
+ firmware/RS9116W.2.5.0.27.rps
+ firmware/RS916W.2.5.0.27.rps
+2 −2 firmware/readme.txt
+0 −0 platforms/efm32/hal/sl_hal_mcu_logging.c
+0 −0 platforms/efx32/hal/sl_hal_mcu_logging.c
+0 −0 platforms/stm32/hal/sl_hal_mcu_logging.c
+4 −2 readme.md
+0 −0 resources/certificates/GRootCA.pem
+0 −0 resources/certificates/GRoot_CA.pem
+0 −0 resources/certificates/TestSSCert.pem
+0 −0 resources/certificates/TestSSKey.pem
+0 −0 resources/certificates/deviceca.pem
+0 −0 resources/certificates/wifi-user.pem
+0 −0 resources/certificates/wifiuser.pem
+1 −1 sapi/common/rsi_common_apis.c
+19 −0 sapi/driver/rsi_wlan.c
+3,857 −3,857 sapi/include/debug_auto_gen.h
+1 −0 sapi/include/rsi_common.h
+4 −2 sapi/include/rsi_wlan.h
+13 −1 sapi/include/rsi_wlan_apis.h
+29 −0 sapi/wlan/rsi_wlan_apis.c
+9 −9 templates.xml
+1 −1 utilities/advanced_logging/manifest.json

0 comments on commit a1336d5

Please sign in to comment.