Exemplo n.º 1
0
        public static async Task PublishCommand(Guid thingId, ThingActions thingAction, MqttQualityOfService qos = MqttQualityOfService.AtMostOnce, bool retained = false)
        {
            var message = new MqttApplicationMessage($"command/{thingId}/{thingAction.ToString().ToLower()}", Array.Empty <byte>());

            await client.PublishAsync(message,
                                      qos,
                                      retained);
        }
Exemplo n.º 2
0
 public async Task SendMessageToThing(Guid ThingId, ThingActions thingAction)
 {
     await MQTTTask.PublishCommand(ThingId, thingAction);
 }