Microsoft has its own SDK for interacting with IoT Hub (Microsoft.Azure.Devices) It features a client called ServiceClient that as I understand it is client you are supposed to use when sending messages from your backend to a device through IoT hub.
When initializing the ServiceClient like below the only supported TransportTypes are Amqp and Amqp_websockets_only. My devices only support MQTT. How should I go about that?
public async Task SendMessage()
{
var serviceClient = ServiceClient.CreateFromConnectionString("", TransportType.Amqp);
var commandMessage = new Message(Encoding.ASCII.GetBytes("Cloud to device message."));
await serviceClient.SendAsync("myFirstDevice", commandMessage);
}
According to the c2d guidelines "all protocols" are supported.
I have read through this documentation, but it only documents device to cloud, not cloud to device.
Looking at the SDK documentation it only lists AMQP for key features under device-to-cloud