Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tizen platform build with disabled WiFi #16711

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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