Skip to content

Commit 022f2c9

Browse files
ArekBalysNordicanangl
authored andcommitted
[nrf toup] Fix missing network band in scan response.
There is a missing network band parameter in the scan response, and due to that the `networkcommissioning scan-networks` command shows 0 as the band field for all found networks.
1 parent bc49aa4 commit 022f2c9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/platform/nrfconnect/wifi/WiFiManager.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ namespace DeviceLayer {
4949

5050
namespace {
5151

52+
app::Clusters::NetworkCommissioning::WiFiBandEnum ConvertBandEnum(uint8_t band)
53+
{
54+
switch (band)
55+
{
56+
case WIFI_FREQ_BAND_2_4_GHZ:
57+
return app::Clusters::NetworkCommissioning::WiFiBandEnum::k2g4;
58+
case WIFI_FREQ_BAND_5_GHZ:
59+
return app::Clusters::NetworkCommissioning::WiFiBandEnum::k5g;
60+
case WIFI_FREQ_BAND_6_GHZ:
61+
return app::Clusters::NetworkCommissioning::WiFiBandEnum::k6g;
62+
default:
63+
return app::Clusters::NetworkCommissioning::WiFiBandEnum::kUnknownEnumValue;
64+
}
65+
}
66+
5267
NetworkCommissioning::WiFiScanResponse ToScanResponse(const wifi_scan_result * result)
5368
{
5469
NetworkCommissioning::WiFiScanResponse response = {};
@@ -64,6 +79,7 @@ NetworkCommissioning::WiFiScanResponse ToScanResponse(const wifi_scan_result * r
6479
response.channel = result->channel;
6580
response.rssi = result->rssi;
6681
response.ssidLen = result->ssid_length;
82+
response.wiFiBand = ConvertBandEnum(result->band);
6783
memcpy(response.ssid, result->ssid, result->ssid_length);
6884
// TODO: MAC/BSSID is not filled by the Wi-Fi driver
6985
memcpy(response.bssid, result->mac, result->mac_length);

0 commit comments

Comments
 (0)