Skip to content

Commit

Permalink
Fix compile error if disable CHIP_DEVICE_CONFIG_ENABLE_WPA (#10627)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored and pull[bot] committed Nov 2, 2021
1 parent 18a78d4 commit 32f2ed8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/platform/Linux/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@ ConnectivityManagerImpl ConnectivityManagerImpl::sInstance;

CHIP_ERROR ConnectivityManagerImpl::_Init()
{
#if CHIP_DEVICE_CONFIG_ENABLE_WPA
mWiFiStationMode = kWiFiStationMode_Disabled;
mWiFiStationReconnectIntervalMS = CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL;
#endif

if (ConnectivityUtils::GetEthInterfaceName(mEthIfName, IFNAMSIZ) == CHIP_NO_ERROR)
{
Expand Down Expand Up @@ -877,11 +879,9 @@ void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void
{
sInstance.DriveAPState();
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA

CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, const char * key)
{
#if CHIP_DEVICE_CONFIG_ENABLE_WPA
CHIP_ERROR ret = CHIP_NO_ERROR;
GError * err = nullptr;
GVariant * args = nullptr;
Expand Down Expand Up @@ -1025,10 +1025,8 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, cons
g_error_free(err);

return ret;
#else
return CHIP_ERROR_NOT_IMPLEMENTED;
#endif
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA

CHIP_ERROR ConnectivityManagerImpl::_GetEthPHYRate(uint8_t & pHYRate)
{
Expand Down
4 changes: 4 additions & 0 deletions src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::_ProvisionWiFiNetwork(const ch

ChipLogProgress(NetworkProvisioning, "LinuxNetworkProvisioningDelegate: SSID: %s", ssid);

#if CHIP_DEVICE_CONFIG_ENABLE_WPA
err = ConnectivityMgrImpl().ProvisionWiFiNetwork(ssid, key);
#else
err = CHIP_ERROR_NOT_IMPLEMENTED;
#endif

if (err != CHIP_NO_ERROR)
{
Expand Down

0 comments on commit 32f2ed8

Please sign in to comment.