@@ -51,22 +51,22 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E
51
51
52
52
if (err == CHIP_NO_ERROR)
53
53
{
54
- DeviceMgr ().SetRemoteBridgeNodeId (mBridgeNodeId );
54
+ DeviceManager::Instance ().SetRemoteBridgeNodeId (mBridgeNodeId );
55
55
ChipLogProgress (NotSpecified, " Successfully paired bridge device: NodeId: " ChipLogFormatX64,
56
56
ChipLogValueX64 (mBridgeNodeId ));
57
57
58
- DeviceMgr ().UpdateLastUsedNodeId (mBridgeNodeId );
59
- DeviceMgr ().SubscribeRemoteFabricBridge ();
58
+ DeviceManager::Instance ().UpdateLastUsedNodeId (mBridgeNodeId );
59
+ DeviceManager::Instance ().SubscribeRemoteFabricBridge ();
60
60
61
- if (DeviceMgr ().IsLocalBridgeReady ())
61
+ if (DeviceManager::Instance ().IsLocalBridgeReady ())
62
62
{
63
63
// After successful commissioning of the Commissionee, initiate Reverse Commissioning
64
64
// via the Commissioner Control Cluster. However, we must first verify that the
65
65
// remote Fabric-Bridge supports Fabric Synchronization.
66
66
//
67
67
// Note: The Fabric-Admin MUST NOT send the RequestCommissioningApproval command
68
68
// if the remote Fabric-Bridge lacks Fabric Synchronization support.
69
- DeviceLayer::SystemLayer ().ScheduleLambda ([]() { DeviceMgr ().ReadSupportedDeviceCategories (); });
69
+ DeviceLayer::SystemLayer ().ScheduleLambda ([]() { DeviceManager::Instance ().ReadSupportedDeviceCategories (); });
70
70
}
71
71
}
72
72
else
@@ -80,7 +80,7 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E
80
80
81
81
CHIP_ERROR FabricSyncAddBridgeCommand::RunCommand (NodeId remoteId)
82
82
{
83
- if (DeviceMgr ().IsFabricSyncReady ())
83
+ if (DeviceManager::Instance ().IsFabricSyncReady ())
84
84
{
85
85
// print to console
86
86
fprintf (stderr, " Remote Fabric Bridge has already been configured.\n " );
@@ -91,7 +91,8 @@ CHIP_ERROR FabricSyncAddBridgeCommand::RunCommand(NodeId remoteId)
91
91
92
92
mBridgeNodeId = remoteId;
93
93
94
- DeviceMgr ().PairRemoteFabricBridge (remoteId, mSetupPINCode , reinterpret_cast <const char *>(mRemoteAddr .data ()), mRemotePort );
94
+ DeviceManager::Instance ().PairRemoteFabricBridge (remoteId, mSetupPINCode , reinterpret_cast <const char *>(mRemoteAddr .data ()),
95
+ mRemotePort );
95
96
96
97
return CHIP_NO_ERROR;
97
98
}
@@ -106,7 +107,7 @@ void FabricSyncRemoveBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_ERROR
106
107
107
108
if (err == CHIP_NO_ERROR)
108
109
{
109
- DeviceMgr ().SetRemoteBridgeNodeId (kUndefinedNodeId );
110
+ DeviceManager::Instance ().SetRemoteBridgeNodeId (kUndefinedNodeId );
110
111
ChipLogProgress (NotSpecified, " Successfully removed bridge device: NodeId: " ChipLogFormatX64,
111
112
ChipLogValueX64 (mBridgeNodeId ));
112
113
}
@@ -121,7 +122,7 @@ void FabricSyncRemoveBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_ERROR
121
122
122
123
CHIP_ERROR FabricSyncRemoveBridgeCommand::RunCommand ()
123
124
{
124
- NodeId bridgeNodeId = DeviceMgr ().GetRemoteBridgeNodeId ();
125
+ NodeId bridgeNodeId = DeviceManager::Instance ().GetRemoteBridgeNodeId ();
125
126
126
127
if (bridgeNodeId == kUndefinedNodeId )
127
128
{
@@ -133,7 +134,7 @@ CHIP_ERROR FabricSyncRemoveBridgeCommand::RunCommand()
133
134
mBridgeNodeId = bridgeNodeId;
134
135
135
136
PairingManager::Instance ().SetPairingDelegate (this );
136
- DeviceMgr ().UnpairRemoteFabricBridge ();
137
+ DeviceManager::Instance ().UnpairRemoteFabricBridge ();
137
138
138
139
return CHIP_NO_ERROR;
139
140
}
@@ -157,8 +158,8 @@ void FabricSyncAddLocalBridgeCommand::OnCommissioningComplete(NodeId deviceId, C
157
158
158
159
if (err == CHIP_NO_ERROR)
159
160
{
160
- DeviceMgr ().SetLocalBridgeNodeId (mLocalBridgeNodeId );
161
- DeviceMgr ().UpdateLastUsedNodeId (mLocalBridgeNodeId );
161
+ DeviceManager::Instance ().SetLocalBridgeNodeId (mLocalBridgeNodeId );
162
+ DeviceManager::Instance ().UpdateLastUsedNodeId (mLocalBridgeNodeId );
162
163
ChipLogProgress (NotSpecified, " Successfully paired local bridge device: NodeId: " ChipLogFormatX64,
163
164
ChipLogValueX64 (mLocalBridgeNodeId ));
164
165
}
@@ -173,7 +174,7 @@ void FabricSyncAddLocalBridgeCommand::OnCommissioningComplete(NodeId deviceId, C
173
174
174
175
CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand (NodeId deviceId)
175
176
{
176
- if (DeviceMgr ().IsLocalBridgeReady ())
177
+ if (DeviceManager::Instance ().IsLocalBridgeReady ())
177
178
{
178
179
// print to console
179
180
fprintf (stderr, " Local Fabric Bridge has already been configured.\n " );
@@ -185,14 +186,14 @@ CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand(NodeId deviceId)
185
186
186
187
if (mSetupPINCode .HasValue ())
187
188
{
188
- DeviceMgr ().SetLocalBridgeSetupPinCode (mSetupPINCode .Value ());
189
+ DeviceManager::Instance ().SetLocalBridgeSetupPinCode (mSetupPINCode .Value ());
189
190
}
190
191
if (mLocalPort .HasValue ())
191
192
{
192
- DeviceMgr ().SetLocalBridgePort (mLocalPort .Value ());
193
+ DeviceManager::Instance ().SetLocalBridgePort (mLocalPort .Value ());
193
194
}
194
195
195
- DeviceMgr ().PairLocalFabricBridge (deviceId);
196
+ DeviceManager::Instance ().PairLocalFabricBridge (deviceId);
196
197
197
198
return CHIP_NO_ERROR;
198
199
}
@@ -207,7 +208,7 @@ void FabricSyncRemoveLocalBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_E
207
208
208
209
if (err == CHIP_NO_ERROR)
209
210
{
210
- DeviceMgr ().SetLocalBridgeNodeId (kUndefinedNodeId );
211
+ DeviceManager::Instance ().SetLocalBridgeNodeId (kUndefinedNodeId );
211
212
ChipLogProgress (NotSpecified, " Successfully removed local bridge device: NodeId: " ChipLogFormatX64,
212
213
ChipLogValueX64 (mLocalBridgeNodeId ));
213
214
}
@@ -222,7 +223,7 @@ void FabricSyncRemoveLocalBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_E
222
223
223
224
CHIP_ERROR FabricSyncRemoveLocalBridgeCommand::RunCommand ()
224
225
{
225
- NodeId bridgeNodeId = DeviceMgr ().GetLocalBridgeNodeId ();
226
+ NodeId bridgeNodeId = DeviceManager::Instance ().GetLocalBridgeNodeId ();
226
227
227
228
if (bridgeNodeId == kUndefinedNodeId )
228
229
{
@@ -234,7 +235,7 @@ CHIP_ERROR FabricSyncRemoveLocalBridgeCommand::RunCommand()
234
235
mLocalBridgeNodeId = bridgeNodeId;
235
236
236
237
PairingManager::Instance ().SetPairingDelegate (this );
237
- DeviceMgr ().UnpairLocalFabricBridge ();
238
+ DeviceManager::Instance ().UnpairLocalFabricBridge ();
238
239
239
240
return CHIP_NO_ERROR;
240
241
}
@@ -250,14 +251,14 @@ void FabricSyncDeviceCommand::OnCommissioningWindowOpened(NodeId deviceId, CHIP_
250
251
CHIP_ERROR error = ManualSetupPayloadGenerator (payload).payloadDecimalStringRepresentation (manualCode);
251
252
if (error == CHIP_NO_ERROR)
252
253
{
253
- NodeId nodeId = DeviceMgr ().GetNextAvailableNodeId ();
254
+ NodeId nodeId = DeviceManager::Instance ().GetNextAvailableNodeId ();
254
255
255
256
PairingManager::Instance ().SetPairingDelegate (this );
256
257
mAssignedNodeId = nodeId;
257
258
258
259
usleep (kCommissionPrepareTimeMs * 1000 );
259
260
260
- DeviceMgr ().PairRemoteDevice (nodeId, payloadBuffer);
261
+ DeviceManager::Instance ().PairRemoteDevice (nodeId, payloadBuffer);
261
262
}
262
263
else
263
264
{
@@ -283,7 +284,7 @@ void FabricSyncDeviceCommand::OnCommissioningComplete(NodeId deviceId, CHIP_ERRO
283
284
284
285
if (err == CHIP_NO_ERROR)
285
286
{
286
- DeviceMgr ().AddSyncedDevice (Device (mAssignedNodeId , mRemoteEndpointId ));
287
+ DeviceManager::Instance ().AddSyncedDevice (Device (mAssignedNodeId , mRemoteEndpointId ));
287
288
}
288
289
else
289
290
{
@@ -294,7 +295,7 @@ void FabricSyncDeviceCommand::OnCommissioningComplete(NodeId deviceId, CHIP_ERRO
294
295
295
296
CHIP_ERROR FabricSyncDeviceCommand::RunCommand (EndpointId remoteEndpointId)
296
297
{
297
- if (!DeviceMgr ().IsFabricSyncReady ())
298
+ if (!DeviceManager::Instance ().IsFabricSyncReady ())
298
299
{
299
300
// print to console
300
301
fprintf (stderr, " Remote Fabric Bridge is not configured yet.\n " );
@@ -303,7 +304,7 @@ CHIP_ERROR FabricSyncDeviceCommand::RunCommand(EndpointId remoteEndpointId)
303
304
304
305
PairingManager::Instance ().SetOpenCommissioningWindowDelegate (this );
305
306
306
- DeviceMgr ().OpenRemoteDeviceCommissioningWindow (remoteEndpointId);
307
+ DeviceManager::Instance ().OpenRemoteDeviceCommissioningWindow (remoteEndpointId);
307
308
308
309
return CHIP_NO_ERROR;
309
310
}
0 commit comments