Exemplo n.º 1
0
 public void ReceivedInteger(ILogoVariable <short> logoVariable, byte[] payload)
 {
     if (mqttFormat.ToValue(payload, out short value))
     {
         logoVariable.Set(value);
     }
 }
Exemplo n.º 2
0
 public void ReceivedByte(ILogoVariable <byte> logoVariable, byte[] payload)
 {
     if (mqttFormat.ToValue(payload, out byte value))
     {
         logoVariable.Set(value);
     }
 }
Exemplo n.º 3
0
 public void ReceivedFloat(ILogoVariable <float> logoVariable, byte[] payload)
 {
     if (mqttFormat.ToValue(payload, out float value))
     {
         logoVariable.Set(value);
     }
 }
Exemplo n.º 4
0
        public async Task PublishFloat(ILogoVariable <float> logoVariable, string topic, bool retain, MqttQualityOfServiceLevel qualityOfService)
        {
            var value = logoVariable.Get();

            await Publish(topic, MqttFormat.ToPayload(value), retain, qualityOfService).ConfigureAwait(false);
        }
Exemplo n.º 5
0
 public NotificationContext(int address, int length, ILogoVariable <T> logoVariable, Action <ILogoVariable <T> > onChanged)
     : base(address, length)
 {
     this.logoVariable = logoVariable;
     this.onChanged    = onChanged;
 }