Skip to content

Commit a47bc4a

Browse files
restyled-commitswqx6
authored andcommitted
Restyled by clang-format
1 parent 4d0fe45 commit a47bc4a

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/platform/OpenThread/GenericThreadBorderRouterDelegate.cpp

+13-15
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::Init()
6262

6363
CHIP_ERROR GenericThreadBorderRouterDelegate::GetBorderAgentId(MutableByteSpan & borderAgentIdSpan)
6464
{
65-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
65+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
6666
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
6767
otBorderAgentId borderAgentId;
6868
if (borderAgentIdSpan.size() < sizeof(borderAgentId.mId))
@@ -88,7 +88,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetThreadVersion(uint16_t & thread
8888

8989
CHIP_ERROR GenericThreadBorderRouterDelegate::GetInterfaceEnabled(bool & interfaceEnabled)
9090
{
91-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
91+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
9292
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
9393
ScopedThreadLock threadLock;
9494
interfaceEnabled = otIp6IsEnabled(otInst);
@@ -97,7 +97,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetInterfaceEnabled(bool & interfa
9797

9898
CHIP_ERROR GenericThreadBorderRouterDelegate::GetDataset(Thread::OperationalDataset & dataset, DatasetType type)
9999
{
100-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
100+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
101101
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
102102

103103
ScopedThreadLock threadLock;
@@ -119,9 +119,9 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::GetDataset(Thread::OperationalData
119119
}
120120

121121
CHIP_ERROR GenericThreadBorderRouterDelegate::SetActiveDataset(const Thread::OperationalDataset & activeDataset,
122-
ActivateDatasetCallback * callback)
122+
ActivateDatasetCallback * callback)
123123
{
124-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
124+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
125125
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
126126

127127
VerifyOrReturnError(callback, CHIP_ERROR_INVALID_ARGUMENT);
@@ -136,8 +136,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetActiveDataset(const Thread::Ope
136136
if (threadIsEnabled)
137137
{
138138
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);
141140
if (activeDataset.AsByteSpan().data_equal(ByteSpan(stagingDataset.mTlvs, stagingDataset.mLength)))
142141
{
143142
callback->OnActivateDatasetComplete(CHIP_NO_ERROR);
@@ -172,7 +171,7 @@ void GenericThreadBorderRouterDelegate::OnPlatformEventHandler(const DeviceLayer
172171

173172
CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
174173
{
175-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
174+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
176175
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
177176

178177
bool threadIsEnabled = false;
@@ -197,8 +196,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
197196
ReturnErrorOnFailure(err);
198197
stagingDataset.mLength = datasetTlvslen;
199198
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);
202200
}
203201
ReturnErrorOnFailure(SetThreadEnabled(threadIsEnabled));
204202
// Delete Failsafe Keys after reverting.
@@ -209,7 +207,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::RevertActiveDataset()
209207

210208
CHIP_ERROR GenericThreadBorderRouterDelegate::SetPendingDataset(const Thread::OperationalDataset & pendingDataset)
211209
{
212-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
210+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
213211
VerifyOrReturnError(otInst, CHIP_ERROR_INCORRECT_STATE);
214212

215213
ScopedThreadLock threadLock;
@@ -222,10 +220,10 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetPendingDataset(const Thread::Op
222220

223221
CHIP_ERROR GenericThreadBorderRouterDelegate::SetThreadEnabled(bool enabled)
224222
{
225-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
223+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
226224
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);
229227
if (enabled && !isIp6Enabled)
230228
{
231229
ReturnErrorCodeIf(otIp6SetEnabled(otInst, enabled) != OT_ERROR_NONE, CHIP_ERROR_INTERNAL);
@@ -243,7 +241,7 @@ CHIP_ERROR GenericThreadBorderRouterDelegate::SetThreadEnabled(bool enabled)
243241

244242
bool GenericThreadBorderRouterDelegate::GetThreadEnabled()
245243
{
246-
otInstance *otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
244+
otInstance * otInst = DeviceLayer::ThreadStackMgrImpl().OTInstance();
247245
return otInst && otIp6IsEnabled(otInst) && (otThreadGetDeviceRole(otInst) != OT_DEVICE_ROLE_DISABLED);
248246
}
249247

0 commit comments

Comments
 (0)