From 981691701ccfe7d5c37b345faa4b2ca60c1ffa57 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 18 Oct 2021 14:18:31 -0700 Subject: [PATCH] Fix compile error if disable CHIP_DEVICE_CONFIG_ENABLE_WPA (#10627) --- src/platform/Linux/ConnectivityManagerImpl.cpp | 8 +++----- .../Linux/DeviceNetworkProvisioningDelegateImpl.cpp | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index 297f5cc72936ac..9c5ca4790d9f93 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -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) { @@ -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; @@ -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) { diff --git a/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp index e320a99f4c9fee..11bfe89cf6752e 100644 --- a/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp +++ b/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp @@ -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) {