public MqttPublishMessage(string topic, MqttPayload payload,bool retained, QoS qos)
 {
     _topic = topic;
     _payload = payload;
     _retained = retained;
     _qos = qos;
 }
 /// <summary>
 /// Constructs a PublishArrivedArgs object
 /// </summary>
 /// <param name="topic">Source of message</param>
 /// <param name="payload">Message body</param>
 /// <param name="retained">Whether or not the message is retained</param>
 public PublishArrivedArgs(string topic, MqttPayload payload, bool retained, QoS qos)
 {
     _topic = topic;
     _payload = payload;
     _retained = retained;
     _qos = qos;
 }
Ejemplo n.º 3
0
 public MqttParcel(string topic, byte[] payload, QoS qos, bool retained)
 {
     this.topic = topic;
     this.payload = new MqttPayload(payload, 0);
     this.qos = qos;
     this.retained = retained;
 }
Ejemplo n.º 4
0
 public MqttParcel(string topic, MqttPayload payload, QoS qos, bool retained)
 {
     this.topic = topic;
     this.payload = payload;
     this.qos = qos;
     this.retained = retained;
 }
        private bool ParseSensorMessageValue(MqttPayload payload)
        {
            bool returnValue = false;

            if (payload.ToString().Equals("opened"))
            {
                returnValue = true;
            }
            else if (payload.ToString().Equals("closed"))
            {
                returnValue = false;
            }
            return returnValue;
        }
        private bool ParseBurglarMessageValue(MqttPayload payload)
        {
            bool returnValue = false;

            if (payload.ToString().Equals("on"))
            {
                returnValue = true;
            }
            else if (payload.ToString().Equals("off"))
            {
                returnValue = false;
            }
            return returnValue;
        }