public void MesssageHeadersCanBeRead()
        {
            var msg1 = new MqttMessageBase(MessageType.Connect)
            {
                Duplicate = false,
                QualityOfService = QualityOfService.AtMostOnce,
                Retain = false
            };
            Assert.AreEqual(MessageType.Connect, msg1.MessageType);
            Assert.AreEqual(QualityOfService.AtMostOnce, msg1.QualityOfService);
            Assert.AreEqual(false, msg1.Duplicate);
            Assert.AreEqual(false, msg1.Retain);

            var msg2 = new MqttMessageBase(MessageType.ConnAck)
            {
                Duplicate = true,
                QualityOfService = QualityOfService.ExactlyOnce,
                Retain = true
            };
            Assert.AreEqual(MessageType.ConnAck, msg2.MessageType);
            Assert.AreEqual(QualityOfService.ExactlyOnce, msg2.QualityOfService);
            Assert.AreEqual(true, msg2.Duplicate);
            Assert.AreEqual(true, msg2.Retain);
        }
Exemple #2
0
 internal MqttPublishAckMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubAck);
 }
 internal MqttPublishMessage()
 {
     _msg = new MqttMessageBase(MessageType.Publish);
 }
 internal MqttPublishReceivedMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubRec);
 }
 internal MqttPingResponseMessage()
 {
     _msg = new MqttMessageBase(MessageType.PingResp);
 }
 internal MqttUnsubscribeAckMessage()
 {
     _msg = new MqttMessageBase(MessageType.UnsubAck);
 }
 internal MqttPublishReleaseMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubRel);
 }
 internal MqttUnsubscribeAckMessage()
 {
     _msg = new MqttMessageBase(MessageType.UnsubAck);
 }
 internal MqttPublishCompleteMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubComp);
 }
Exemple #10
0
 internal MqttSubscribeMessage()
 {
     _msg = new MqttMessageBase(MessageType.Subscribe);
 }
 internal MqttConnectMessage()
 {
     _msg = new MqttMessageBase(MessageType.Connect);
 }
Exemple #12
0
 internal MqttPublishReleaseMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubRel);
 }
 internal MqttConnectAckMessage()
 {
     _msg = new MqttMessageBase(MessageType.ConnAck);
 }
 internal MqttSubscribeMessage()
 {
     _msg = new MqttMessageBase(MessageType.Subscribe);
 }
Exemple #15
0
 internal MqttPingResponseMessage()
 {
     _msg = new MqttMessageBase(MessageType.PingResp);
 }
 internal MqttPublishCompleteMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubComp);
 }
Exemple #17
0
 internal MqttPublishReceivedMessage()
 {
     _msg = new MqttMessageBase(MessageType.PubRec);
 }
 internal MqttDisconnectMessage()
 {
     _msg = new MqttMessageBase(MessageType.Disconnect);
 }
Exemple #19
0
 internal MqttPingRequestMessage()
 {
     _msg = new MqttMessageBase(MessageType.PingReq);
 }
 internal MqttPingRequestMessage()
 {
     _msg = new MqttMessageBase(MessageType.PingReq);
 }
 internal MqttDisconnectMessage()
 {
     _msg = new MqttMessageBase(MessageType.Disconnect);
 }