Skip to content

Commit

Permalink
Fix Tizen platform build with disabled WiFi (#16711)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq authored and pull[bot] committed Sep 1, 2023
1 parent b49a791 commit 1304266
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/platform/Tizen/CHIPDevicePlatformEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#pragma once

#include <platform/CHIPDeviceEvent.h>
#include <system/SystemPacketBuffer.h>

namespace chip {
namespace DeviceLayer {
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Tizen/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ CHIP_ERROR ConnectivityManagerImpl::_Init(void)
{
CHIP_ERROR err = CHIP_NO_ERROR;

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
mWiFiStationMode = kWiFiStationMode_Disabled;
mWiFiAPMode = kWiFiAPMode_Disabled;
mWiFiAPState = kWiFiAPState_NotActive;
mLastAPDemandTime = System::Clock::kZero;
mWiFiStationReconnectInterval = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL);
mWiFiAPIdleTimeout = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT);

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
WiFiMgr().Init();
#endif

Expand Down Expand Up @@ -214,12 +214,12 @@ void ConnectivityManagerImpl::DeactivateWiFiManager(::chip::System::Layer * aLay
{
WiFiMgr().Deactivate();
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, const char * key)
{
return WiFiMgr().Connect(ssid, key);
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

} // namespace DeviceLayer
} // namespace chip
4 changes: 3 additions & 1 deletion src/platform/Tizen/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager,
friend class ConnectivityManager;

public:
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
CHIP_ERROR ProvisionWiFiNetwork(const char * ssid, const char * key);

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
void StartWiFiManagement(void);
void StopWiFiManagement(void);
#endif
Expand Down Expand Up @@ -124,12 +124,14 @@ class ConnectivityManagerImpl final : public ConnectivityManager,

// ===== Private members reserved for use by this class only.

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
ConnectivityManager::WiFiStationMode mWiFiStationMode;
ConnectivityManager::WiFiAPMode mWiFiAPMode;
WiFiAPState mWiFiAPState;
System::Clock::Timestamp mLastAPDemandTime;
System::Clock::Timeout mWiFiStationReconnectInterval;
System::Clock::Timeout mWiFiAPIdleTimeout;
#endif
};

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
Expand Down
5 changes: 5 additions & 0 deletions src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::_ProvisionWiFiNetwork(const ch

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

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

if (err != CHIP_NO_ERROR)
{
ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err));
Expand Down

0 comments on commit 1304266

Please sign in to comment.