Skip to content

Commit

Permalink
Remove unused ThreadMode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian-Nordic committed Apr 2, 2024
1 parent 8049ff6 commit 90548e6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 94 deletions.
26 changes: 0 additions & 26 deletions src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ class ConnectivityManager
kWiFiAPMode_OnDemand_NoStationProvision = 5,
};

enum ThreadMode
{
kThreadMode_NotSupported = 0,
kThreadMode_ApplicationControlled = 1,
kThreadMode_Disabled = 2,
kThreadMode_Enabled = 3,
};

enum WiFiStationState
{
kWiFiStationState_NotConnected,
Expand Down Expand Up @@ -192,10 +184,7 @@ class ConnectivityManager
void SetWiFiAPIdleTimeout(System::Clock::Timeout val);

// Thread Methods
ThreadMode GetThreadMode();
CHIP_ERROR SetThreadMode(ThreadMode val);
bool IsThreadEnabled();
bool IsThreadApplicationControlled();
ThreadDeviceType GetThreadDeviceType();
CHIP_ERROR SetThreadDeviceType(ThreadDeviceType deviceType);
bool IsThreadAttached();
Expand Down Expand Up @@ -417,26 +406,11 @@ inline CHIP_ERROR ConnectivityManager::GetAndLogWiFiStatsCounters()
return static_cast<ImplClass *>(this)->_GetAndLogWiFiStatsCounters();
}

inline ConnectivityManager::ThreadMode ConnectivityManager::GetThreadMode()
{
return static_cast<ImplClass *>(this)->_GetThreadMode();
}

inline CHIP_ERROR ConnectivityManager::SetThreadMode(ThreadMode val)
{
return static_cast<ImplClass *>(this)->_SetThreadMode(val);
}

inline bool ConnectivityManager::IsThreadEnabled()
{
return static_cast<ImplClass *>(this)->_IsThreadEnabled();
}

inline bool ConnectivityManager::IsThreadApplicationControlled()
{
return static_cast<ImplClass *>(this)->_IsThreadApplicationControlled();
}

inline ConnectivityManager::ThreadDeviceType ConnectivityManager::GetThreadDeviceType()
{
return static_cast<ImplClass *>(this)->_GetThreadDeviceType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class GenericConnectivityManagerImpl_NoThread
protected:
// ===== Methods that implement the ConnectivityManager abstract interface.

ConnectivityManager::ThreadMode _GetThreadMode(void);
CHIP_ERROR _SetThreadMode(ConnectivityManager::ThreadMode val);
bool _IsThreadEnabled(void);
bool _IsThreadApplicationControlled(void);
ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(void);
CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType);
bool _IsThreadAttached(void);
Expand All @@ -57,30 +54,12 @@ class GenericConnectivityManagerImpl_NoThread
ImplClass * Impl() { return static_cast<ImplClass *>(this); }
};

template <class ImplClass>
inline ConnectivityManager::ThreadMode GenericConnectivityManagerImpl_NoThread<ImplClass>::_GetThreadMode(void)
{
return ConnectivityManager::kThreadMode_NotSupported;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread<ImplClass>::_SetThreadMode(ConnectivityManager::ThreadMode val)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_NoThread<ImplClass>::_IsThreadEnabled(void)
{
return false;
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_NoThread<ImplClass>::_IsThreadApplicationControlled(void)
{
return false;
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_NoThread<ImplClass>::_IsThreadAttached(void)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ class GenericConnectivityManagerImpl_Thread

void _Init();
void _OnPlatformEvent(const ChipDeviceEvent * event);
ConnectivityManager::ThreadMode _GetThreadMode();
CHIP_ERROR _SetThreadMode(ConnectivityManager::ThreadMode val);
bool _IsThreadEnabled();
bool _IsThreadApplicationControlled();
ConnectivityManager::ThreadDeviceType _GetThreadDeviceType();
CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType);
#if CHIP_CONFIG_ENABLE_ICD_SERVER
Expand All @@ -82,7 +79,6 @@ class GenericConnectivityManagerImpl_Thread
enum class Flags : uint8_t
{
kHaveServiceConnectivity = 0x01,
kIsApplicationControlled = 0x02
};

BitFlags<Flags> mFlags;
Expand All @@ -102,12 +98,6 @@ inline bool GenericConnectivityManagerImpl_Thread<ImplClass>::_IsThreadEnabled()
return ThreadStackMgrImpl().IsThreadEnabled();
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_Thread<ImplClass>::_IsThreadApplicationControlled()
{
return mFlags.Has(Flags::kIsApplicationControlled);
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_Thread<ImplClass>::_IsThreadAttached()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,43 +56,6 @@ void GenericConnectivityManagerImpl_Thread<ImplClass>::_OnPlatformEvent(const Ch
}
}

template <class ImplClass>
ConnectivityManager::ThreadMode GenericConnectivityManagerImpl_Thread<ImplClass>::_GetThreadMode()
{
if (mFlags.Has(Flags::kIsApplicationControlled))
{
return ConnectivityManager::kThreadMode_ApplicationControlled;
}

return ThreadStackMgrImpl().IsThreadEnabled() ? ConnectivityManager::kThreadMode_Enabled
: ConnectivityManager::kThreadMode_Disabled;
}

template <class ImplClass>
CHIP_ERROR GenericConnectivityManagerImpl_Thread<ImplClass>::_SetThreadMode(ConnectivityManager::ThreadMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val == ConnectivityManager::kThreadMode_Enabled || val == ConnectivityManager::kThreadMode_Disabled ||
val == ConnectivityManager::kThreadMode_ApplicationControlled,
err = CHIP_ERROR_INVALID_ARGUMENT);

if (val == ConnectivityManager::kThreadMode_ApplicationControlled)
{
mFlags.Set(Flags::kIsApplicationControlled);
}
else
{
mFlags.Clear(Flags::kIsApplicationControlled);

err = ThreadStackMgrImpl().SetThreadEnabled(val == ConnectivityManager::kThreadMode_Enabled);
SuccessOrExit(err);
}

exit:
return err;
}

template <class ImplClass>
void GenericConnectivityManagerImpl_Thread<ImplClass>::UpdateServiceConnectivity()
{
Expand Down

0 comments on commit 90548e6

Please sign in to comment.