public sealed class SendCommandToDeviceRequest : IMessage<SendCommandToDeviceRequest>, IEquatable<SendCommandToDeviceRequest>, IDeepCloneable<SendCommandToDeviceRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud IoT v1 API class SendCommandToDeviceRequest.
Required. The name of the device. For example,
projects/p0/locations/us-central1/registries/registry0/devices/device0 or
projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Optional subfolder for the command. If empty, the command will be delivered
to the /devices/{device-id}/commands topic, otherwise it will be delivered
to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
subfolders are allowed. This field must not have more than 256 characters,
and must not contain any MQTT wildcards ("+" or "#") or null characters.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eSendCommandToDeviceRequest\u003c/code\u003e class is 2.2.0, part of the Google Cloud IoT v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThis class is used to send commands to a device, inheriting from \u003ccode\u003eobject\u003c/code\u003e and implementing interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt allows for sending binary data to a device through the \u003ccode\u003eBinaryData\u003c/code\u003e property, which takes a \u003ccode\u003eByteString\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eName\u003c/code\u003e property is a required field specifying the full device name, while the \u003ccode\u003eSubfolder\u003c/code\u003e property allows for optional subfolder routing of commands.\u003c/p\u003e\n"],["\u003cp\u003eThere are available constructors for the \u003ccode\u003eSendCommandToDeviceRequest\u003c/code\u003e class, including a default constructor and one that accepts another \u003ccode\u003eSendCommandToDeviceRequest\u003c/code\u003e instance for cloning.\u003c/p\u003e\n"]]],[],null,["# Cloud IoT v1 API - Class SendCommandToDeviceRequest (2.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.0 (latest)](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1.SendCommandToDeviceRequest)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Iot.V1/2.1.0/Google.Cloud.Iot.V1.SendCommandToDeviceRequest)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Iot.V1/2.0.0/Google.Cloud.Iot.V1.SendCommandToDeviceRequest)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Iot.V1/1.2.0/Google.Cloud.Iot.V1.SendCommandToDeviceRequest)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Iot.V1/1.1.0/Google.Cloud.Iot.V1.SendCommandToDeviceRequest)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Iot.V1/1.0.0/Google.Cloud.Iot.V1.SendCommandToDeviceRequest) \n\n public sealed class SendCommandToDeviceRequest : IMessage\u003cSendCommandToDeviceRequest\u003e, IEquatable\u003cSendCommandToDeviceRequest\u003e, IDeepCloneable\u003cSendCommandToDeviceRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud IoT v1 API class SendCommandToDeviceRequest.\n\nRequest for `SendCommandToDevice`. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SendCommandToDeviceRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SendCommandToDeviceRequest](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1.SendCommandToDeviceRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SendCommandToDeviceRequest](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1.SendCommandToDeviceRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SendCommandToDeviceRequest](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1.SendCommandToDeviceRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Iot.V1](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Iot.V1.dll\n\nConstructors\n------------\n\n### SendCommandToDeviceRequest()\n\n public SendCommandToDeviceRequest()\n\n### SendCommandToDeviceRequest(SendCommandToDeviceRequest)\n\n public SendCommandToDeviceRequest(SendCommandToDeviceRequest other)\n\nProperties\n----------\n\n### BinaryData\n\n public ByteString BinaryData { get; set; }\n\nRequired. The command data to send to the device.\n\n### DeviceName\n\n public DeviceName DeviceName { get; set; }\n\n[DeviceName](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1.DeviceName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Iot.V1/latest/Google.Cloud.Iot.V1.SendCommandToDeviceRequest#Google_Cloud_Iot_V1_SendCommandToDeviceRequest_Name) resource name property.\n\n### Name\n\n public string Name { get; set; }\n\nRequired. The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.\n\n### Subfolder\n\n public string Subfolder { get; set; }\n\nOptional subfolder for the command. If empty, the command will be delivered\nto the /devices/{device-id}/commands topic, otherwise it will be delivered\nto the /devices/{device-id}/commands/{subfolder} topic. Multi-level\nsubfolders are allowed. This field must not have more than 256 characters,\nand must not contain any MQTT wildcards (\"+\" or \"#\") or null characters."]]