Skip to content

Commit

Permalink
Switch to using WiFiVersionEnum instead of raw integers. (#25547)
Browse files Browse the repository at this point in the history
Fixes #24948
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Oct 9, 2023
1 parent 3b8812e commit 2487776
Show file tree
Hide file tree
Showing 30 changed files with 78 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::ReadSecurityType(AttributeValueEncoder & aE
CHIP_ERROR WiFiDiagosticsAttrAccess::ReadWiFiVersion(AttributeValueEncoder & aEncoder)
{
Attributes::WiFiVersion::TypeInfo::Type version;
uint8_t value = 0;
WiFiVersionEnum value = WiFiVersionEnum::kUnknownEnumValue;

if (DeviceLayer::GetDiagnosticDataProvider().GetWiFiVersion(value) == CHIP_NO_ERROR)
{
version.SetNonNull(static_cast<WiFiNetworkDiagnostics::WiFiVersionEnum>(value));
ChipLogProgress(Zcl, "The current 802.11 standard version in use by the Node: %d", value);
version.SetNonNull(value);
ChipLogProgress(Zcl, "The current 802.11 standard version in use by the Node: %d", to_underlying(value));
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/include/platform/DiagnosticDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class DiagnosticDataProvider
*/
virtual CHIP_ERROR GetWiFiBssId(ByteSpan & value);
virtual CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType);
virtual CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion);
virtual CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion);
virtual CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber);
virtual CHIP_ERROR GetWiFiRssi(int8_t & rssi);
virtual CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount);
Expand Down Expand Up @@ -339,7 +339,7 @@ DiagnosticDataProvider::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostic
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

inline CHIP_ERROR DiagnosticDataProvider::GetWiFiVersion(uint8_t & wiFiVersion)
inline CHIP_ERROR DiagnosticDataProvider::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}
Expand Down
5 changes: 3 additions & 2 deletions src/platform/Ameba/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion)
{
// Support 802.11a/n Wi-Fi in AmebaD chipset
wifiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kN);
// TODO: https://github.com/project-chip/connectedhomeip/issues/25542
wifiVersion = app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kN;
return CHIP_NO_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/Ameba/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
Expand Down
5 changes: 3 additions & 2 deletions src/platform/Beken/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion)
{
// Support 802.11a/n Wi-Fi in Beken chipset
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kN);
// TODO: https://github.com/project-chip/connectedhomeip/issues/25543
wiFiVersion = app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kN;
return CHIP_NO_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/Beken/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
Expand Down
28 changes: 18 additions & 10 deletions src/platform/ESP32/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@ app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum MapAuthModeToSecurityTyp
}
}

uint8_t GetWiFiVersionFromAPRecord(wifi_ap_record_t ap_info)
app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum GetWiFiVersionFromAPRecord(wifi_ap_record_t ap_info)
{
using app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum;
if (ap_info.phy_11n)
return 3;
return WiFiVersionEnum::kN;
else if (ap_info.phy_11g)
return 2;
return WiFiVersionEnum::kG;
else if (ap_info.phy_11b)
return 1;
return WiFiVersionEnum::kB;
else
return 0;
// TODO: This is keeping the old behavior, it doesn't look right.
// https://github.com/project-chip/connectedhomeip/issues/25544
return WiFiVersionEnum::kA;
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

Expand Down Expand Up @@ -305,17 +308,18 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNe
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion)
{
wifiVersion = 0;
wifi_ap_record_t ap_info;
esp_err_t err;
err = esp_wifi_sta_get_ap_info(&ap_info);
if (err == ESP_OK)
{
wifiVersion = GetWiFiVersionFromAPRecord(ap_info);
return CHIP_NO_ERROR;
}
return CHIP_NO_ERROR;

return ESP32Utils::MapError(err);
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNumber)
Expand All @@ -328,8 +332,10 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNu
if (err == ESP_OK)
{
channelNumber = ap_info.primary;
return CHIP_NO_ERROR;
}
return CHIP_NO_ERROR;

return ESP32Utils::MapError(err);
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi)
Expand All @@ -343,8 +349,10 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi)
if (err == ESP_OK)
{
rssi = ap_info.rssi;
return CHIP_NO_ERROR;
}
return CHIP_NO_ERROR;

return ESP32Utils::MapError(err);
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconLostCount(uint32_t & beaconLostCount)
Expand Down
2 changes: 1 addition & 1 deletion src/platform/ESP32/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
Expand Down
16 changes: 8 additions & 8 deletions src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNe
return err;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wiFiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion)
{
CHIP_ERROR err = CHIP_NO_ERROR;
using app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum;

wl_bss_info_t bss_info;
whd_security_t security;
cy_rslt_t result = CY_RSLT_SUCCESS;
Expand All @@ -256,27 +257,26 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wiFiVersion)
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "whd_wifi_get_ap_info failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
return CHIP_ERROR_INTERNAL;
}

/* VHT Capable */
if (bss_info.vht_cap)
{
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kAc);
wiFiVersion = WiFiVersionEnum::kAc;
}
/* HT Capable */
else if (bss_info.n_cap)
{
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kN);
wiFiVersion = WiFiVersionEnum::kN;
}
/* 11g Capable */
else
{
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kG);
wiFiVersion = WiFiVersionEnum::kG;
}

exit:
return err;
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNumber)
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider

CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconRxCount(uint32_t & beaconRxCount) override;
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Linux/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,10 +1239,10 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(SecurityTypeEnum & secur
return CHIP_NO_ERROR;
}

CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(uint8_t & wiFiVersion)
CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(WiFiVersionEnum & wiFiVersion)
{
// We don't have direct API to get the WiFi version yet, return 802.11n on Linux simulation.
wiFiVersion = to_underlying(WiFiVersionEnum::kN);
wiFiVersion = WiFiVersionEnum::kN;

return CHIP_NO_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager,
int32_t GetDisconnectReason();
CHIP_ERROR GetWiFiBssId(ByteSpan & value);
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType);
CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion);
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion);
CHIP_ERROR GetConfiguredNetwork(NetworkCommissioning::Network & network);
CHIP_ERROR StartWiFiScan(ByteSpan ssid, NetworkCommissioning::WiFiDriver::ScanCallback * callback);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts()
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

#if CHIP_DEVICE_CONFIG_ENABLE_WPA
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wiFiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion)
{
return ConnectivityMgrImpl().GetWiFiVersion(wiFiVersion);
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
#endif

#if CHIP_DEVICE_CONFIG_ENABLE_WPA
CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion) override;
CHIP_ERROR GetWiFiBssId(ByteSpan & value) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
#endif
Expand Down
6 changes: 4 additions & 2 deletions src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNe
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion)
{
wifiVersion = 0;
// TODO: Keeping existing behavior, but this looks broken.
// https://github.com/project-chip/connectedhomeip/issues/25546
wifiVersion = app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum::kA;
return CHIP_NO_ERROR;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
void ReleaseNetworkInterfaces(NetworkInterface * netifp) override;
CHIP_ERROR GetWiFiBssId(ByteSpan & BssId) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wifiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/DiagnosticDataProviderImplNrf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DiagnosticDataProviderImplNrf::GetWiFiSecurityType(app::Clusters::WiFiNetworkDia
return err;
}

CHIP_ERROR DiagnosticDataProviderImplNrf::GetWiFiVersion(uint8_t & wiFiVersion)
CHIP_ERROR DiagnosticDataProviderImplNrf::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion)
{
WiFiManager::WiFiInfo info;
CHIP_ERROR err = WiFiManager::Instance().GetWiFiInfo(info);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/DiagnosticDataProviderImplNrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DiagnosticDataProviderImplNrf : public DiagnosticDataProviderImpl
#ifdef CONFIG_WIFI_NRF700X
CHIP_ERROR GetWiFiBssId(ByteSpan & value) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion) override;
CHIP_ERROR GetWiFiChannelNumber(uint16_t & channelNumber) override;
CHIP_ERROR GetWiFiRssi(int8_t & rssi) override;
CHIP_ERROR GetWiFiBeaconLostCount(uint32_t & beaconLostCount) override;
Expand Down
14 changes: 7 additions & 7 deletions src/platform/nrfconnect/wifi/WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,30 +75,30 @@ NetworkCommissioning::WiFiScanResponse ToScanResponse(const wifi_scan_result * r

// Matter expectations towards Wi-Fi version codes are unaligned with
// what wpa_supplicant provides. This function maps supplicant codes
// to the ones defined in the Matter spec (11.14.3.2. WiFiVersion enum)
uint8_t MapToMatterWiFiVersionCode(wifi_link_mode wifiVersion)
// to the ones defined in the Matter spec (11.14.5.2. WiFiVersionEnum)
app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum MapToMatterWiFiVersionCode(wifi_link_mode wifiVersion)
{
using app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum;

if (wifiVersion < WIFI_1 || wifiVersion > WIFI_6E)
{
ChipLogError(DeviceLayer, "Unsupported Wi-Fi version detected");
return static_cast<uint8_t>(WiFiVersionEnum::kA); // let's return 'a' by default
return WiFiVersionEnum::kA; // let's return 'a' by default
}

switch (wifiVersion)
{
case WIFI_1:
return static_cast<uint8_t>(WiFiVersionEnum::kB);
return WiFiVersionEnum::kB;
case WIFI_2:
return static_cast<uint8_t>(WiFiVersionEnum::kA);
return WiFiVersionEnum::kA;
case WIFI_6E:
return static_cast<uint8_t>(WiFiVersionEnum::kAx); // treat as 802.11ax
return WiFiVersionEnum::kAx; // treat as 802.11ax
default:
break;
}

return (static_cast<uint8_t>(wifiVersion) - 1);
return static_cast<WiFiVersionEnum>(wifiVersion - 1);
}

// Matter expectations towards Wi-Fi security type codes are unaligned with
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/wifi/WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class WiFiManager
{
ByteSpan mBssId{};
app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum mSecurityType{};
uint8_t mWiFiVersion{};
app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum mWiFiVersion{};
uint16_t mChannel{};
int8_t mRssi{};
uint8_t mSsid[DeviceLayer::Internal::kMaxWiFiSSIDLength];
Expand Down
10 changes: 4 additions & 6 deletions src/platform/nxp/mw320/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,8 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiBssId(ByteSpan & value)
return CHIP_NO_ERROR;
}

CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType)
CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(SecurityTypeEnum & securityType)
{
using app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum;

int ret = wlan_get_current_network(&sta_network);
if (ret != WM_SUCCESS)
{
Expand Down Expand Up @@ -244,10 +242,10 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(app::Clusters::WiFiNetwo
return CHIP_NO_ERROR;
}

CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(uint8_t & wiFiVersion)
CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(WiFiVersionEnum & wiFiVersion)
{
wiFiVersion = to_underlying(WiFiVersionEnum::kN);
ChipLogProgress(DeviceLayer, "GetWiFiVersion: %u", wiFiVersion);
wiFiVersion = WiFiVersionEnum::kN;
ChipLogProgress(DeviceLayer, "GetWiFiVersion: %u", to_underlying(wiFiVersion));
return CHIP_NO_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/nxp/mw320/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager,
void StartWiFiManagement();
CHIP_ERROR GetWiFiBssId(ByteSpan & value);
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType);
CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion);
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion);
#endif
CHIP_ERROR GetConfiguredNetwork(NetworkCommissioning::Network & network);
CHIP_ERROR StartWiFiScan(ByteSpan ssid, NetworkCommissioning::WiFiDriver::ScanCallback * callback);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts()
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wiFiVersion)
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion)
{
return ConnectivityMgrImpl().GetWiFiVersion(wiFiVersion);
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nxp/mw320/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetWiFiOverrunCount(uint64_t & overrunCount) override;
CHIP_ERROR ResetWiFiNetworkDiagnosticsCounts() override;

CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion) override;
CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion) override;
CHIP_ERROR GetWiFiBssId(ByteSpan & value) override;
CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override;
};
Expand Down
Loading

0 comments on commit 2487776

Please sign in to comment.