@@ -62,7 +62,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::Init()
62
62
63
63
CHIP_ERROR GenericThreadBorderRouterDelegate::GetBorderAgentId (MutableByteSpan & borderAgentIdSpan)
64
64
{
65
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
65
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
66
66
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
67
67
otBorderAgentId borderAgentId;
68
68
if (borderAgentIdSpan.size () < sizeof (borderAgentId.mId ))
@@ -88,7 +88,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetThreadVersion(uint16_t & thread
88
88
89
89
CHIP_ERROR GenericThreadBorderRouterDelegate::GetInterfaceEnabled (bool & interfaceEnabled)
90
90
{
91
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
91
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
92
92
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
93
93
ScopedThreadLock threadLock;
94
94
interfaceEnabled = otIp6IsEnabled (otInst);
@@ -97,7 +97,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetInterfaceEnabled(bool & interfa
97
97
98
98
CHIP_ERROR GenericThreadBorderRouterDelegate::GetDataset (Thread::OperationalDataset & dataset, DatasetType type)
99
99
{
100
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
100
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
101
101
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
102
102
103
103
ScopedThreadLock threadLock;
@@ -119,9 +119,9 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetDataset(Thread::OperationalData
119
119
}
120
120
121
121
CHIP_ERROR GenericThreadBorderRouterDelegate::SetActiveDataset (const Thread::OperationalDataset & activeDataset,
122
- ActivateDatasetCallback * callback)
122
+ ActivateDatasetCallback * callback)
123
123
{
124
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
124
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
125
125
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
126
126
127
127
VerifyOrReturnError (callback, CHIP_ERROR_INVALID_ARGUMENT);
@@ -136,8 +136,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetActiveDataset(const Thread::Ope
136
136
if (threadIsEnabled)
137
137
{
138
138
otOperationalDatasetTlvs stagingDataset;
139
- ReturnErrorCodeIf (otDatasetGetActiveTlvs (otInst, &stagingDataset) != OT_ERROR_NONE,
140
- CHIP_ERROR_INTERNAL);
139
+ ReturnErrorCodeIf (otDatasetGetActiveTlvs (otInst, &stagingDataset) != OT_ERROR_NONE, CHIP_ERROR_INTERNAL);
141
140
if (activeDataset.AsByteSpan ().data_equal (ByteSpan (stagingDataset.mTlvs , stagingDataset.mLength )))
142
141
{
143
142
callback->OnActivateDatasetComplete (CHIP_NO_ERROR);
@@ -172,7 +171,7 @@ void GenericThreadBorderRouterDelegate::OnPlatformEventHandler(const DeviceLayer
172
171
173
172
CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset ()
174
173
{
175
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
174
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
176
175
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
177
176
178
177
bool threadIsEnabled = false ;
@@ -197,8 +196,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
197
196
ReturnErrorOnFailure (err);
198
197
stagingDataset.mLength = datasetTlvslen;
199
198
ReturnErrorOnFailure (SetThreadEnabled (false ));
200
- ReturnErrorCodeIf (otDatasetSetActiveTlvs (otInst, &stagingDataset) != OT_ERROR_NONE,
201
- CHIP_ERROR_INTERNAL);
199
+ ReturnErrorCodeIf (otDatasetSetActiveTlvs (otInst, &stagingDataset) != OT_ERROR_NONE, CHIP_ERROR_INTERNAL);
202
200
}
203
201
ReturnErrorOnFailure (SetThreadEnabled (threadIsEnabled));
204
202
// Delete Failsafe Keys after reverting.
@@ -209,7 +207,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
209
207
210
208
CHIP_ERROR GenericThreadBorderRouterDelegate::SetPendingDataset (const Thread::OperationalDataset & pendingDataset)
211
209
{
212
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
210
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
213
211
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
214
212
215
213
ScopedThreadLock threadLock;
@@ -222,10 +220,10 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetPendingDataset(const Thread::Op
222
220
223
221
CHIP_ERROR GenericThreadBorderRouterDelegate::SetThreadEnabled (bool enabled)
224
222
{
225
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
223
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
226
224
VerifyOrReturnError (otInst, CHIP_ERROR_INCORRECT_STATE);
227
- bool isEnabled = (otThreadGetDeviceRole (otInst) != OT_DEVICE_ROLE_DISABLED);
228
- bool isIp6Enabled = otIp6IsEnabled (otInst);
225
+ bool isEnabled = (otThreadGetDeviceRole (otInst) != OT_DEVICE_ROLE_DISABLED);
226
+ bool isIp6Enabled = otIp6IsEnabled (otInst);
229
227
if (enabled && !isIp6Enabled)
230
228
{
231
229
ReturnErrorCodeIf (otIp6SetEnabled (otInst, enabled) != OT_ERROR_NONE, CHIP_ERROR_INTERNAL);
@@ -243,7 +241,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetThreadEnabled(bool enabled)
243
241
244
242
bool GenericThreadBorderRouterDelegate::GetThreadEnabled ()
245
243
{
246
- otInstance *otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
244
+ otInstance * otInst = DeviceLayer::ThreadStackMgrImpl ().OTInstance ();
247
245
return otInst && otIp6IsEnabled (otInst) && (otThreadGetDeviceRole (otInst) != OT_DEVICE_ROLE_DISABLED);
248
246
}
249
247
0 commit comments