|
25 | 25 | #include <cstdio>
|
26 | 26 | #include <string>
|
27 | 27 |
|
| 28 | +#if defined(PW_RPC_ENABLED) |
| 29 | +#include <rpc/RpcClient.h> |
| 30 | +#endif |
| 31 | + |
28 | 32 | using namespace chip;
|
29 | 33 |
|
30 | 34 | namespace admin {
|
@@ -109,8 +113,13 @@ Device * DeviceManager::FindDeviceByNode(NodeId nodeId)
|
109 | 113 | return nullptr;
|
110 | 114 | }
|
111 | 115 |
|
112 |
| -void DeviceManager::RemoveSyncedDevice(NodeId nodeId) |
| 116 | +void DeviceManager::RemoveSyncedDevice(chip::ScopedNodeId scopedNodeId) |
113 | 117 | {
|
| 118 | +#if defined(PW_RPC_ENABLED) |
| 119 | + RemoveSynchronizedDevice(scopedNodeId); |
| 120 | +#endif |
| 121 | + |
| 122 | + NodeId nodeId = scopedNodeId.GetNodeId(); |
114 | 123 | Device * device = FindDeviceByNode(nodeId);
|
115 | 124 | if (device == nullptr)
|
116 | 125 | {
|
@@ -259,6 +268,10 @@ void DeviceManager::HandleReadSupportedDeviceCategories(TLV::TLVReader & data)
|
259 | 268 | ChipLogProgress(NotSpecified, "Remote Fabric-Bridge supports Fabric Synchronization, start reverse commissioning.");
|
260 | 269 | RequestCommissioningApproval();
|
261 | 270 | }
|
| 271 | + else |
| 272 | + { |
| 273 | + ChipLogProgress(NotSpecified, "Remote Fabric-Bridge does not support Fabric Synchronization."); |
| 274 | + } |
262 | 275 | }
|
263 | 276 |
|
264 | 277 | void DeviceManager::RequestCommissioningApproval()
|
@@ -406,6 +419,8 @@ void DeviceManager::SendCommissionNodeRequest(uint64_t requestId, uint16_t respo
|
406 | 419 |
|
407 | 420 | void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data)
|
408 | 421 | {
|
| 422 | + ChipLogProgress(NotSpecified, "Handle ReverseOpenCommissioningWindow command."); |
| 423 | + |
409 | 424 | app::Clusters::CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType value;
|
410 | 425 | CHIP_ERROR error = app::DataModel::Decode(data, value);
|
411 | 426 |
|
@@ -459,17 +474,4 @@ void DeviceManager::HandleCommandResponse(const app::ConcreteCommandPath & path,
|
459 | 474 | }
|
460 | 475 | }
|
461 | 476 |
|
462 |
| -void DeviceManager::OnDeviceRemoved(NodeId deviceId, CHIP_ERROR err) |
463 |
| -{ |
464 |
| - if (err != CHIP_NO_ERROR) |
465 |
| - { |
466 |
| - ChipLogError(NotSpecified, "Failed to remove synced device:(" ChipLogFormatX64 ") with error: %" CHIP_ERROR_FORMAT, |
467 |
| - ChipLogValueX64(deviceId), err.Format()); |
468 |
| - return; |
469 |
| - } |
470 |
| - |
471 |
| - RemoveSyncedDevice(deviceId); |
472 |
| - ChipLogProgress(NotSpecified, "Synced device with NodeId:" ChipLogFormatX64 " has been removed.", ChipLogValueX64(deviceId)); |
473 |
| -} |
474 |
| - |
475 | 477 | } // namespace admin
|
0 commit comments