Add documentation for the model command destination id. (#18704)
Since the documentation explains what it is, rename from the unwieldy
"node-id/group-id" to "destination-id".
diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp
index 286dd7f..9eae919 100644
--- a/examples/chip-tool/commands/clusters/ModelCommand.cpp
+++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp
@@ -26,24 +26,25 @@
CHIP_ERROR ModelCommand::RunCommand()
{
- if (IsGroupId(mNodeId))
+ if (IsGroupId(mDestinationId))
{
FabricIndex fabricIndex;
ReturnErrorOnFailure(CurrentCommissioner().GetFabricIndex(&fabricIndex));
- ChipLogProgress(chipTool, "Sending command to group 0x%x", GroupIdFromNodeId(mNodeId));
+ ChipLogProgress(chipTool, "Sending command to group 0x%x", GroupIdFromNodeId(mDestinationId));
- return SendGroupCommand(GroupIdFromNodeId(mNodeId), fabricIndex);
+ return SendGroupCommand(GroupIdFromNodeId(mDestinationId), fabricIndex);
}
- ChipLogProgress(chipTool, "Sending command to node 0x%" PRIx64, mNodeId);
+ ChipLogProgress(chipTool, "Sending command to node 0x%" PRIx64, mDestinationId);
CommissioneeDeviceProxy * commissioneeDeviceProxy = nullptr;
- if (CHIP_NO_ERROR == CurrentCommissioner().GetDeviceBeingCommissioned(mNodeId, &commissioneeDeviceProxy))
+ if (CHIP_NO_ERROR == CurrentCommissioner().GetDeviceBeingCommissioned(mDestinationId, &commissioneeDeviceProxy))
{
return SendCommand(commissioneeDeviceProxy, mEndPointId);
}
- return CurrentCommissioner().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback);
+ return CurrentCommissioner().GetConnectedDevice(mDestinationId, &mOnDeviceConnectedCallback,
+ &mOnDeviceConnectionFailureCallback);
}
void ModelCommand::OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device)
diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h
index ae31d28..e6fd091 100644
--- a/examples/chip-tool/commands/clusters/ModelCommand.h
+++ b/examples/chip-tool/commands/clusters/ModelCommand.h
@@ -32,7 +32,9 @@
void AddArguments()
{
- AddArgument("node-id/group-id", 0, UINT64_MAX, &mNodeId);
+ AddArgument(
+ "destination-id", 0, UINT64_MAX, &mDestinationId,
+ "64-bit node or group identifier.\n Group identifiers are detected by being in the 0xFFFF'FFFF'FFFF'xxxx range.");
AddArgument("endpoint-id-ignored-for-group-commands", 0, UINT16_MAX, &mEndPointId);
AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
}
@@ -51,7 +53,7 @@
chip::Optional<uint16_t> mTimeout;
private:
- chip::NodeId mNodeId;
+ chip::NodeId mDestinationId;
std::vector<chip::EndpointId> mEndPointId;
static void OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device);