Skip to content

Commit 35a6c86

Browse files
committed
rename the delegate implementation class
1 parent 0ec7110 commit 35a6c86

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/platform/OpenThread/GenericThreadBorderRouterDelegate.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ class ScopedThreadLock
5252
~ScopedThreadLock() { DeviceLayer::ThreadStackMgr().UnlockThreadStack(); }
5353
};
5454

55-
CHIP_ERROR GenericThreadBorderRouterDelegate::Init()
55+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::Init()
5656
{
5757
mCallback = nullptr;
5858
ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast<intptr_t>(this)));
5959
ReturnErrorOnFailure(RevertActiveDataset());
6060
return CHIP_NO_ERROR;
6161
}
6262

63-
CHIP_ERROR GenericThreadBorderRouterDelegate::GetBorderAgentId(MutableByteSpan & borderAgentIdSpan)
63+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::GetBorderAgentId(MutableByteSpan & borderAgentIdSpan)
6464
{
6565
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
6666
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
@@ -80,13 +80,13 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetBorderAgentId(MutableByteSpan &
8080
return CHIP_ERROR_INTERNAL;
8181
}
8282

83-
CHIP_ERROR GenericThreadBorderRouterDelegate::GetThreadVersion(uint16_t & threadVersion)
83+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::GetThreadVersion(uint16_t & threadVersion)
8484
{
8585
threadVersion = otThreadGetVersion();
8686
return CHIP_NO_ERROR;
8787
}
8888

89-
CHIP_ERROR GenericThreadBorderRouterDelegate::GetInterfaceEnabled(bool & interfaceEnabled)
89+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::GetInterfaceEnabled(bool & interfaceEnabled)
9090
{
9191
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
9292
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
@@ -95,7 +95,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetInterfaceEnabled(bool & interfa
9595
return CHIP_NO_ERROR;
9696
}
9797

98-
CHIP_ERROR GenericThreadBorderRouterDelegate::GetDataset(Thread::OperationalDataset & dataset, DatasetType type)
98+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::GetDataset(Thread::OperationalDataset & dataset, DatasetType type)
9999
{
100100
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
101101
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
@@ -118,7 +118,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetDataset(Thread::OperationalData
118118
return CHIP_ERROR_NOT_FOUND;
119119
}
120120

121-
CHIP_ERROR GenericThreadBorderRouterDelegate::SetActiveDataset(const Thread::OperationalDataset & activeDataset,
121+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::SetActiveDataset(const Thread::OperationalDataset & activeDataset,
122122
uint32_t randomNumber, ActivateDatasetCallback * callback)
123123
{
124124
CHIP_ERROR err = BackupActiveDataset();
@@ -134,9 +134,9 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetActiveDataset(const Thread::Ope
134134
return err;
135135
}
136136

137-
void GenericThreadBorderRouterDelegate::OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg)
137+
void GenericOpenThreadBorderRouterDelegate::OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg)
138138
{
139-
GenericThreadBorderRouterDelegate * delegate = reinterpret_cast<GenericThreadBorderRouterDelegate *>(arg);
139+
GenericOpenThreadBorderRouterDelegate * delegate = reinterpret_cast<GenericOpenThreadBorderRouterDelegate *>(arg);
140140
if (delegate && delegate->mCallback)
141141
{
142142
if (event->Type == DeviceLayer::DeviceEventType::kThreadConnectivityChange &&
@@ -150,7 +150,7 @@ void GenericThreadBorderRouterDelegate::OnPlatformEventHandler(const DeviceLayer
150150
}
151151
}
152152

153-
CHIP_ERROR GenericThreadBorderRouterDelegate::BackupActiveDataset()
153+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::BackupActiveDataset()
154154
{
155155
// If active dataset is already backed up, return with no error
156156
CHIP_ERROR err = DeviceLayer::PersistedStorage::KeyValueStoreMgr().Get(kFailsafeThreadDatasetTlvsKey, nullptr, 0);
@@ -163,14 +163,14 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::BackupActiveDataset()
163163
return DeviceLayer::PersistedStorage::KeyValueStoreMgr().Put(kFailsafeThreadDatasetTlvsKey, dataset.data(), dataset.size());
164164
}
165165

166-
CHIP_ERROR GenericThreadBorderRouterDelegate::CommitActiveDataset()
166+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::CommitActiveDataset()
167167
{
168168
// Delete Failsafe Key when committing.
169169
DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(kFailsafeThreadDatasetTlvsKey);
170170
return CHIP_NO_ERROR;
171171
}
172172

173-
CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
173+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::RevertActiveDataset()
174174
{
175175
// The FailSafe Timer is triggered and the previous command request should be handled, so reset the callback.
176176
mCallback = nullptr;
@@ -195,7 +195,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
195195
return CHIP_NO_ERROR;
196196
}
197197

198-
CHIP_ERROR GenericThreadBorderRouterDelegate::SetPendingDataset(const Thread::OperationalDataset & pendingDataset)
198+
CHIP_ERROR GenericOpenThreadBorderRouterDelegate::SetPendingDataset(const Thread::OperationalDataset & pendingDataset)
199199
{
200200
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
201201
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);

src/platform/OpenThread/GenericThreadBorderRouterDelegate.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ namespace Clusters {
2929

3030
namespace ThreadBorderRouterManagement {
3131

32-
class GenericThreadBorderRouterDelegate : public Delegate
32+
class GenericOpenThreadBorderRouterDelegate : public Delegate
3333
{
3434
public:
35-
static constexpr char kThreadBorderRourterName[] = "Espressif-ThreadBR";
35+
static constexpr char kThreadBorderRourterName[] = "OpenThread-ThreadBR";
3636
static constexpr char kFailsafeThreadDatasetTlvsKey[] = "g/fs/td";
3737

38-
GenericThreadBorderRouterDelegate() = default;
39-
~GenericThreadBorderRouterDelegate() = default;
38+
GenericOpenThreadBorderRouterDelegate() = default;
39+
~GenericOpenThreadBorderRouterDelegate() = default;
4040

4141
CHIP_ERROR Init() override;
4242

0 commit comments

Comments
 (0)