Skip to content

Commit 8e9cfbf

Browse files
committed
Adds GetSupportedWiFiBandsMask API
1 parent 652f786 commit 8e9cfbf

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

src/platform/silabs/NetworkCommissioningWiFiDriver.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ chip::BitFlags<WiFiSecurity> SlWiFiDriver::ConvertSecuritytype(wfx_sec_t securit
258258
return securityType;
259259
}
260260

261+
uint32_t SlWiFiDriver::GetSupportedWiFiBandsMask() const
262+
{
263+
return WifiInterface::GetInstance()._GetSupportedWiFiBandsMask();
264+
}
265+
261266
bool SlWiFiDriver::StartScanWiFiNetworks(ByteSpan ssid)
262267
{
263268
ChipLogProgress(DeviceLayer, "Start Scan WiFi Networks");

src/platform/silabs/NetworkCommissioningWiFiDriver.h

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class SlWiFiDriver final : public WiFiDriver
123123
CHIP_ERROR ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen);
124124

125125
chip::BitFlags<WiFiSecurity> ConvertSecuritytype(wfx_sec_t security);
126+
uint32_t GetSupportedWiFiBandsMask() const override;
126127

127128
void OnConnectWiFiNetwork();
128129
void UpdateNetworkingStatus();

src/platform/silabs/wifi/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ source_set("wifi-platform") {
113113
"${chip_root}/src/app/icd/server:icd-server-config",
114114
"${chip_root}/src/inet",
115115
"${chip_root}/src/lib/support",
116+
"${chip_root}/src/platform:platform_base",
116117
]
117118

118119
if (use_rs9116) {

src/platform/silabs/wifi/WifiInterface.h

+16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
*/
1717
#pragma once
1818

19+
#include <app-common/zap-generated/cluster-enums.h>
1920
#include <app/icd/server/ICDServerConfig.h>
21+
2022
#include <array>
2123
#include <cmsis_os2.h>
2224
#include <lib/support/BitFlags.h>
@@ -410,6 +412,20 @@ class WifiInterface
410412
*/
411413
virtual void CancelScanNetworks() = 0;
412414

415+
using WiFiBandEnum = app::Clusters::NetworkCommissioning::WiFiBandEnum;
416+
/**
417+
* @brief Provide all the frequency bands supported by the Wi-Fi interface.
418+
*
419+
* The default implementation returns the 2.4 GHz band support.
420+
*
421+
* @return a bitmask of supported Wi-Fi bands where each bit is associated with a WiFiBandEnum value.
422+
*/
423+
virtual uint32_t _GetSupportedWiFiBandsMask() const
424+
{
425+
// Default to 2.4G support only
426+
return static_cast<uint32_t>(1UL << chip::to_underlying(WiFiBandEnum::k2g4));
427+
}
428+
413429
protected:
414430
/**
415431
* @brief Function notifies the PlatformManager that an IPv6 event occured on the WiFi interface.

0 commit comments

Comments
 (0)