Skip to content

Commit 910830e

Browse files
committed
Update comments for RemoveSynchronizedDevice
1 parent 8f887a3 commit 910830e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/fabric-admin/rpc/RpcClient.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ CHIP_ERROR AddSynchronizedDevice(chip::NodeId nodeId)
9090
chip_rpc_SynchronizedDevice device;
9191
device.node_id = nodeId;
9292

93-
// The RPC will remain active as long as `addSynchronizedDeviceCall` is alive.
93+
// By assigning the returned call to the global 'addSynchronizedDeviceCall', the RPC
94+
// call is kept alive until it completes. When a response is received, it
95+
// will be logged by the handler function and the call will complete.
9496
addSynchronizedDeviceCall = fabricBridgeClient.AddSynchronizedDevice(device, OnAddDeviceResponseCompleted);
9597

9698
if (!addSynchronizedDeviceCall.active())
9799
{
100+
// The RPC call was not sent. This could occur due to, for example, an invalid channel ID. Handle if necessary.
98101
return CHIP_ERROR_INTERNAL;
99102
}
100103

@@ -114,11 +117,14 @@ CHIP_ERROR RemoveSynchronizedDevice(chip::NodeId nodeId)
114117
chip_rpc_SynchronizedDevice device;
115118
device.node_id = nodeId;
116119

117-
// The RPC will remain active as long as `removeSynchronizedDeviceCall` is alive.
120+
// By assigning the returned call to the global 'removeSynchronizedDeviceCall', the RPC
121+
// call is kept alive until it completes. When a response is received, it
122+
// will be logged by the handler function and the call will complete.
118123
removeSynchronizedDeviceCall = fabricBridgeClient.RemoveSynchronizedDevice(device, OnRemoveDeviceResponseCompleted);
119124

120125
if (!removeSynchronizedDeviceCall.active())
121126
{
127+
// The RPC call was not sent. This could occur due to, for example, an invalid channel ID. Handle if necessary.
122128
return CHIP_ERROR_INTERNAL;
123129
}
124130

0 commit comments

Comments
 (0)