Skip to content

Commit a3d3ee5

Browse files
ThreadStackManager{Impl}: Remove unused legacy methods (project-chip#41681)
These have been marked as "TODO: Remove Weave legacy APIs" since the code was imported from Weave, and are not called from anywhere in the Matter SDK.
1 parent 5efe2e7 commit a3d3ee5

11 files changed

+0
-668
lines changed

src/include/platform/ThreadStackManager.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,8 @@ class ThreadStackManager
103103
bool IsThreadProvisioned();
104104
bool IsThreadAttached();
105105
CHIP_ERROR GetThreadProvision(Thread::OperationalDataset & dataset);
106-
CHIP_ERROR GetAndLogThreadStatsCounters();
107-
CHIP_ERROR GetAndLogThreadTopologyMinimal();
108-
CHIP_ERROR GetAndLogThreadTopologyFull();
109106
CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf);
110-
CHIP_ERROR GetExternalIPv6Address(chip::Inet::IPAddress & addr);
111107
CHIP_ERROR GetThreadVersion(uint16_t & version);
112-
CHIP_ERROR GetPollPeriod(uint32_t & buf);
113108

114109
CHIP_ERROR SetThreadProvision(ByteSpan aDataset);
115110
CHIP_ERROR SetThreadEnabled(bool val);
@@ -195,8 +190,6 @@ class ThreadStackManager
195190
CHIP_ERROR SetPollingInterval(System::Clock::Milliseconds32 pollingInterval);
196191
#endif
197192

198-
bool HaveMeshConnectivity();
199-
200193
protected:
201194
// Construction/destruction limited to subclasses.
202195
ThreadStackManager() = default;
@@ -423,46 +416,16 @@ inline CHIP_ERROR ThreadStackManager::SetPollingInterval(System::Clock::Millisec
423416
}
424417
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
425418

426-
inline bool ThreadStackManager::HaveMeshConnectivity()
427-
{
428-
return static_cast<ImplClass *>(this)->_HaveMeshConnectivity();
429-
}
430-
431-
inline CHIP_ERROR ThreadStackManager::GetAndLogThreadStatsCounters()
432-
{
433-
return static_cast<ImplClass *>(this)->_GetAndLogThreadStatsCounters();
434-
}
435-
436-
inline CHIP_ERROR ThreadStackManager::GetAndLogThreadTopologyMinimal()
437-
{
438-
return static_cast<ImplClass *>(this)->_GetAndLogThreadTopologyMinimal();
439-
}
440-
441-
inline CHIP_ERROR ThreadStackManager::GetAndLogThreadTopologyFull()
442-
{
443-
return static_cast<ImplClass *>(this)->_GetAndLogThreadTopologyFull();
444-
}
445-
446419
inline CHIP_ERROR ThreadStackManager::GetPrimary802154MACAddress(uint8_t * buf)
447420
{
448421
return static_cast<ImplClass *>(this)->_GetPrimary802154MACAddress(buf);
449422
}
450423

451-
inline CHIP_ERROR ThreadStackManager::GetExternalIPv6Address(chip::Inet::IPAddress & addr)
452-
{
453-
return static_cast<ImplClass *>(this)->_GetExternalIPv6Address(addr);
454-
}
455-
456424
inline CHIP_ERROR ThreadStackManager::GetThreadVersion(uint16_t & version)
457425
{
458426
return static_cast<ImplClass *>(this)->_GetThreadVersion(version);
459427
}
460428

461-
inline CHIP_ERROR ThreadStackManager::GetPollPeriod(uint32_t & buf)
462-
{
463-
return static_cast<ImplClass *>(this)->_GetPollPeriod(buf);
464-
}
465-
466429
inline void ThreadStackManager::ResetThreadNetworkDiagnosticsCounts()
467430
{
468431
static_cast<ImplClass *>(this)->_ResetThreadNetworkDiagnosticsCounts();

src/platform/Linux/ThreadStackManagerImpl.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -514,35 +514,6 @@ CHIP_ERROR ThreadStackManagerImpl::_SetPollingInterval(System::Clock::Millisecon
514514
}
515515
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
516516

517-
bool ThreadStackManagerImpl::_HaveMeshConnectivity()
518-
{
519-
// TODO: Remove Weave legacy APIs
520-
// For a leader with a child, the child is considered to have mesh connectivity
521-
// and the leader is not, which is a very confusing definition.
522-
// This API is Weave legacy and should be removed.
523-
524-
ChipLogError(DeviceLayer, "HaveMeshConnectivity has confusing behavior and shouldn't be called");
525-
return false;
526-
}
527-
528-
CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadStatsCounters()
529-
{
530-
// TODO: Remove Weave legacy APIs
531-
return CHIP_ERROR_NOT_IMPLEMENTED;
532-
}
533-
534-
CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadTopologyMinimal()
535-
{
536-
// TODO: Remove Weave legacy APIs
537-
return CHIP_ERROR_NOT_IMPLEMENTED;
538-
}
539-
540-
CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadTopologyFull()
541-
{
542-
// TODO: Remove Weave legacy APIs
543-
return CHIP_ERROR_NOT_IMPLEMENTED;
544-
}
545-
546517
CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf)
547518
{
548519
VerifyOrReturnError(mProxy, CHIP_ERROR_INCORRECT_STATE);
@@ -590,25 +561,13 @@ CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf)
590561
return CHIP_NO_ERROR;
591562
}
592563

593-
CHIP_ERROR ThreadStackManagerImpl::_GetExternalIPv6Address(chip::Inet::IPAddress & addr)
594-
{
595-
// TODO: Remove Weave legacy APIs
596-
return CHIP_ERROR_NOT_IMPLEMENTED;
597-
}
598-
599564
CHIP_ERROR ThreadStackManagerImpl::_GetThreadVersion(uint16_t & version)
600565
{
601566
// TODO https://github.com/project-chip/connectedhomeip/issues/30602
602567
// Needs to be implemented with DBUS io.openthread.BorderRouter Thread API
603568
return CHIP_ERROR_NOT_IMPLEMENTED;
604569
}
605570

606-
CHIP_ERROR ThreadStackManagerImpl::_GetPollPeriod(uint32_t & buf)
607-
{
608-
// TODO: Remove Weave legacy APIs
609-
return CHIP_ERROR_NOT_IMPLEMENTED;
610-
}
611-
612571
CHIP_ERROR ThreadStackManagerImpl::GLibMatterContextCallScan(ThreadStackManagerImpl * self)
613572
{
614573
VerifyOrDie(g_main_context_get_thread_default() != nullptr);

src/platform/Linux/ThreadStackManagerImpl.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,9 @@ class ThreadStackManagerImpl : public ThreadStackManager
102102
CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval);
103103
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
104104

105-
bool _HaveMeshConnectivity();
106-
107-
CHIP_ERROR _GetAndLogThreadStatsCounters();
108-
109-
CHIP_ERROR _GetAndLogThreadTopologyMinimal();
110-
111-
CHIP_ERROR _GetAndLogThreadTopologyFull();
112-
113105
CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf);
114106

115-
CHIP_ERROR _GetExternalIPv6Address(chip::Inet::IPAddress & addr);
116107
CHIP_ERROR _GetThreadVersion(uint16_t & version);
117-
CHIP_ERROR _GetPollPeriod(uint32_t & buf);
118108

119109
void _ResetThreadNetworkDiagnosticsCounts();
120110

src/platform/NuttX/ThreadStackManagerImpl.cpp

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -519,35 +519,6 @@ CHIP_ERROR ThreadStackManagerImpl::_SetPollingInterval(System::Clock::Millisecon
519519
}
520520
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
521521

522-
bool ThreadStackManagerImpl::_HaveMeshConnectivity()
523-
{
524-
// TODO: Remove Weave legacy APIs
525-
// For a leader with a child, the child is considered to have mesh connectivity
526-
// and the leader is not, which is a very confusing definition.
527-
// This API is Weave legacy and should be removed.
528-
529-
ChipLogError(DeviceLayer, "HaveMeshConnectivity has confusing behavior and shouldn't be called");
530-
return false;
531-
}
532-
533-
CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadStatsCounters()
534-
{
535-
// TODO: Remove Weave legacy APIs
536-
return CHIP_ERROR_NOT_IMPLEMENTED;
537-
}
538-
539-
CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadTopologyMinimal()
540-
{
541-
// TODO: Remove Weave legacy APIs
542-
return CHIP_ERROR_NOT_IMPLEMENTED;
543-
}
544-
545-
CHIP_ERROR ThreadStackManagerImpl::_GetAndLogThreadTopologyFull()
546-
{
547-
// TODO: Remove Weave legacy APIs
548-
return CHIP_ERROR_NOT_IMPLEMENTED;
549-
}
550-
551522
CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf)
552523
{
553524
VerifyOrReturnError(mProxy, CHIP_ERROR_INCORRECT_STATE);
@@ -562,31 +533,13 @@ CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf)
562533
return CHIP_NO_ERROR;
563534
}
564535

565-
CHIP_ERROR ThreadStackManagerImpl::_GetExternalIPv6Address(chip::Inet::IPAddress & addr)
566-
{
567-
// TODO: Remove Weave legacy APIs
568-
return CHIP_ERROR_NOT_IMPLEMENTED;
569-
}
570-
571536
CHIP_ERROR ThreadStackManagerImpl::_GetThreadVersion(uint16_t & version)
572537
{
573538
// TODO https://github.com/project-chip/connectedhomeip/issues/30602
574539
// Needs to be implemented with DBUS io.openthread.BorderRouter Thread API
575540
return CHIP_ERROR_NOT_IMPLEMENTED;
576541
}
577542

578-
CHIP_ERROR ThreadStackManagerImpl::_GetPollPeriod(uint32_t & buf)
579-
{
580-
// TODO: Remove Weave legacy APIs
581-
return CHIP_ERROR_NOT_IMPLEMENTED;
582-
}
583-
584-
CHIP_ERROR ThreadStackManagerImpl::_JoinerStart()
585-
{
586-
// TODO: Remove Weave legacy APIs
587-
return CHIP_ERROR_NOT_IMPLEMENTED;
588-
}
589-
590543
CHIP_ERROR ThreadStackManagerImpl::GLibMatterContextCallScan(ThreadStackManagerImpl * self)
591544
{
592545
VerifyOrDie(g_main_context_get_thread_default() != nullptr);

src/platform/NuttX/ThreadStackManagerImpl.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,9 @@ class ThreadStackManagerImpl : public ThreadStackManager
103103
CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval);
104104
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
105105

106-
bool _HaveMeshConnectivity();
107-
108-
CHIP_ERROR _GetAndLogThreadStatsCounters();
109-
110-
CHIP_ERROR _GetAndLogThreadTopologyMinimal();
111-
112-
CHIP_ERROR _GetAndLogThreadTopologyFull();
113-
114106
CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf);
115107

116-
CHIP_ERROR _GetExternalIPv6Address(chip::Inet::IPAddress & addr);
117108
CHIP_ERROR _GetThreadVersion(uint16_t & version);
118-
CHIP_ERROR _GetPollPeriod(uint32_t & buf);
119-
120-
CHIP_ERROR _JoinerStart();
121109

122110
void _ResetThreadNetworkDiagnosticsCounts();
123111

src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,9 @@ class GenericThreadStackManagerImpl_OpenThread
107107
CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval);
108108
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
109109

110-
bool _HaveMeshConnectivity();
111-
CHIP_ERROR _GetAndLogThreadStatsCounters();
112-
CHIP_ERROR _GetAndLogThreadTopologyMinimal();
113-
CHIP_ERROR _GetAndLogThreadTopologyFull();
114110
CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf);
115-
CHIP_ERROR _GetExternalIPv6Address(chip::Inet::IPAddress & addr);
116111
CHIP_ERROR _GetThreadVersion(uint16_t & version);
117112
void _ResetThreadNetworkDiagnosticsCounts();
118-
CHIP_ERROR _GetPollPeriod(uint32_t & buf);
119113
void _OnWoBLEAdvertisingStart();
120114
void _OnWoBLEAdvertisingStop();
121115

0 commit comments

Comments
 (0)