@@ -90,11 +90,14 @@ CHIP_ERROR AddSynchronizedDevice(chip::NodeId nodeId)
90
90
chip_rpc_SynchronizedDevice device;
91
91
device.node_id = nodeId;
92
92
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.
94
96
addSynchronizedDeviceCall = fabricBridgeClient.AddSynchronizedDevice (device, OnAddDeviceResponseCompleted);
95
97
96
98
if (!addSynchronizedDeviceCall.active ())
97
99
{
100
+ // The RPC call was not sent. This could occur due to, for example, an invalid channel ID. Handle if necessary.
98
101
return CHIP_ERROR_INTERNAL;
99
102
}
100
103
@@ -114,11 +117,14 @@ CHIP_ERROR RemoveSynchronizedDevice(chip::NodeId nodeId)
114
117
chip_rpc_SynchronizedDevice device;
115
118
device.node_id = nodeId;
116
119
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.
118
123
removeSynchronizedDeviceCall = fabricBridgeClient.RemoveSynchronizedDevice (device, OnRemoveDeviceResponseCompleted);
119
124
120
125
if (!removeSynchronizedDeviceCall.active ())
121
126
{
127
+ // The RPC call was not sent. This could occur due to, for example, an invalid channel ID. Handle if necessary.
122
128
return CHIP_ERROR_INTERNAL;
123
129
}
124
130
0 commit comments