Skip to content

Commit 1677908

Browse files
vivien-applepull[bot]
authored andcommitted
[wifi-network-diagnostic] Remove WiFiVersionType from weak-enum-list.yaml (#24942)
* [wifi-network-diagnostic] Remove WiFiVersionType from weak-enum-list.yaml * Update generated code
1 parent ba01629 commit 1677908

File tree

12 files changed

+39
-43
lines changed

12 files changed

+39
-43
lines changed

src/app/common/templates/config-data.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ WeakEnums:
3838
- SecurityType
3939
- StepMode
4040
- TemperatureDisplayMode
41-
- WiFiVersionType
4241

4342
# We need a more configurable way of deciding which clusters have which init functions....
4443
# See https://github.com/project-chip/connectedhomeip/issues/4369

src/app/tests/suites/include/ConstraintsChecker.h

+28-2
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,25 @@ class ConstraintsChecker
246246
return true;
247247
}
248248

249-
template <typename T, typename U, std::enable_if_t<std::is_enum<T>::value && !std::is_pointer<U>::value, int> = 0>
249+
template <typename T, typename U,
250+
std::enable_if_t<std::is_enum<T>::value && !std::is_enum<U>::value && !std::is_pointer<U>::value, int> = 0>
250251
bool CheckConstraintMinValue(const char * itemName, T current, U expected)
251252
{
252253
return CheckConstraintMinValue(itemName, chip::to_underlying(current), expected);
253254
}
254255

256+
template <typename T, typename U, std::enable_if_t<std::is_enum<T>::value && std::is_enum<U>::value, int> = 0>
257+
bool CheckConstraintMinValue(const char * itemName, T current, U expected)
258+
{
259+
return CheckConstraintMinValue(itemName, chip::to_underlying(current), chip::to_underlying(expected));
260+
}
261+
262+
template <typename T, typename U, std::enable_if_t<!std::is_enum<T>::value && std::is_enum<U>::value, int> = 0>
263+
bool CheckConstraintMinValue(const char * itemName, T current, U expected)
264+
{
265+
return CheckConstraintMinValue(itemName, current, chip::to_underlying(expected));
266+
}
267+
255268
template <typename T, typename U, std::enable_if_t<!std::is_pointer<U>::value, int> = 0>
256269
bool CheckConstraintMinValue(const char * itemName, chip::BitFlags<T> current, U expected)
257270
{
@@ -309,12 +322,25 @@ class ConstraintsChecker
309322
return true;
310323
}
311324

312-
template <typename T, typename U, std::enable_if_t<std::is_enum<T>::value && !std::is_pointer<U>::value, int> = 0>
325+
template <typename T, typename U,
326+
std::enable_if_t<std::is_enum<T>::value && !std::is_enum<U>::value && !std::is_pointer<U>::value, int> = 0>
313327
bool CheckConstraintMaxValue(const char * itemName, T current, U expected)
314328
{
315329
return CheckConstraintMaxValue(itemName, chip::to_underlying(current), expected);
316330
}
317331

332+
template <typename T, typename U, std::enable_if_t<std::is_enum<T>::value && std::is_enum<U>::value, int> = 0>
333+
bool CheckConstraintMaxValue(const char * itemName, T current, U expected)
334+
{
335+
return CheckConstraintMaxValue(itemName, chip::to_underlying(current), chip::to_underlying(expected));
336+
}
337+
338+
template <typename T, typename U, std::enable_if_t<!std::is_enum<T>::value && std::is_enum<U>::value, int> = 0>
339+
bool CheckConstraintMaxValue(const char * itemName, T current, U expected)
340+
{
341+
return CheckConstraintMaxValue(itemName, current, chip::to_underlying(expected));
342+
}
343+
318344
template <typename T, typename U, std::enable_if_t<!std::is_pointer<U>::value, int> = 0>
319345
bool CheckConstraintMaxValue(const char * itemName, chip::BitFlags<T> current, U expected)
320346
{

src/platform/Ameba/DiagnosticDataProviderImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
273273
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
274274
{
275275
// Support 802.11a/n Wi-Fi in AmebaD chipset
276-
wifiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
276+
wifiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType::kN);
277277
return CHIP_NO_ERROR;
278278
}
279279

src/platform/Beken/DiagnosticDataProviderImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
173173
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
174174
{
175175
// Support 802.11a/n Wi-Fi in Beken chipset
176-
wifiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
176+
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType::kN);
177177
return CHIP_NO_ERROR;
178178
}
179179

src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,17 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wiFiVersion)
260260
/* VHT Capable */
261261
if (bss_info.vht_cap)
262262
{
263-
wiFiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_AC;
263+
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType::kAc);
264264
}
265265
/* HT Capable */
266266
else if (bss_info.n_cap)
267267
{
268-
wiFiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
268+
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType::kN);
269269
}
270270
/* 11g Capable */
271271
else
272272
{
273-
wiFiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_G;
273+
wiFiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType::kG);
274274
}
275275

276276
exit:

src/platform/Linux/ConnectivityManagerImpl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,8 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(uint8_t & securityType)
12411241

12421242
CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(uint8_t & wiFiVersion)
12431243
{
1244-
// We don't have driect API to get the WiFi version yet, retrun 802.11n on Linux simulation.
1245-
wiFiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
1244+
// We don't have direct API to get the WiFi version yet, return 802.11n on Linux simulation.
1245+
wiFiVersion = to_underlying(WiFiVersionType::kN);
12461246

12471247
return CHIP_NO_ERROR;
12481248
}

src/platform/nxp/mw320/ConnectivityManagerImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(uint8_t & securityType)
244244

245245
CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(uint8_t & wiFiVersion)
246246
{
247-
wiFiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
247+
wiFiVersion = to_underlying(WiFiVersionType::kN);
248248
ChipLogProgress(DeviceLayer, "GetWiFiVersion: %u", wiFiVersion);
249249
return CHIP_NO_ERROR;
250250
}

src/platform/silabs/DiagnosticDataProviderImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(uint8_t & securityTyp
374374

375375
CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(uint8_t & wifiVersion)
376376
{
377-
wifiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
377+
wifiVersion = to_underlying(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType::kN);
378378
return CHIP_NO_ERROR;
379379
}
380380

src/platform/webos/ConnectivityManagerImpl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,8 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(uint8_t & securityType)
12031203

12041204
CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(uint8_t & wiFiVersion)
12051205
{
1206-
// We don't have driect API to get the WiFi version yet, retrun 802.11n on Linux simulation.
1207-
wiFiVersion = EMBER_ZCL_WI_FI_VERSION_TYPE_N;
1206+
// We don't have direct API to get the WiFi version yet, return 802.11n on Linux simulation.
1207+
wiFiVersion = to_underlying(WiFiVersionType::kN);
12081208

12091209
return CHIP_NO_ERROR;
12101210
}

zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h

-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/cluster-enums.h

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/enums.h

-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)