Any IoT device which is capable of receiving messages from the cloud makes a bidirectional command execution easy. The device can receive the message and process upon the instruction on the hardware side. Once the action is taken, an acknowledgement is sent to the cloud about the action completion. With the IoT Hub SDK for the device and the backend application, we can achieve this. We must follow the following steps:
Messaging - commands and control
How to do it...
In this section we will send a cloud-to-device message. Upon receiving it, the IoT device will perform an action:
- Send a cloud-to-device message from a cloud solution to an IoT device:
ServiceClient serviceClient;
serviceClient = ServiceClient.CreateFromConnectionString...