public MqttParcel(string topic, MqttPayload payload, QoS qos, bool retained ) { this.topic = topic; this.payload = payload; this.qos = qos; this.retained = retained; }
/// <summary> /// Constructs a ExtendedAckArrivedArgs object /// </summary> /// <param name="messageID">Message id</param> /// <param name="commondID">Message type id</param> /// <param name="status">Message commond status</param> /// <param name="payload">Message data</param> public ExtendedAckArrivedArgs(ulong messageID, int commondID, int status, MqttPayload payload) { _messageID = messageID; _commondID = commondID; _status = status; _payload = payload; }
public MqttParcel(string topic, MqttPayload payload, QoS qos, bool retained) { this.topic = topic; this.payload = payload; this.qos = qos; this.retained = retained; }
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; }
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; }
/// <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; }
public int Publish(string topic, MqttPayload payload, QoS qos, bool retained) { if (manager.IsConnected) { ushort messID = MessageID; manager.SendMessage(new MqttPublishMessage(messID, topic, payload.TrimmedBuffer, qos, retained)); return(messID); } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }
public ulong Publish2(string topic, MqttPayload payload, QoS qos, int ttl, string apn_json) { if (manager.IsConnected) { ulong messID = MessageID; manager.SendMessage(new MqttExtendedackMessage(messID, topic, payload.TrimmedBuffer, qos, ttl, apn_json)); return(messID); } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }
public int Publish(string topic, MqttPayload payload, QoS qos, bool retained) { if (manager.IsConnected) { // Reset the PINGREQ timer as this publish will reset the server's counter if (keepAliveTimer != null) { int kmillis = 1000 * _keepAlive; keepAliveTimer.Change(kmillis, kmillis); } ushort messID = MessageID; manager.SendMessage(new MqttPublishMessage(messID, topic, payload.TrimmedBuffer, qos, retained)); return(messID); } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }
public ulong Publish(string topic, MqttPayload payload, QoS qos, bool retained) { if (manager.IsConnected) { ulong messID = MessageID; manager.SendMessage(new MqttPublishMessage(messID, topic, payload.TrimmedBuffer, qos, retained)); // Reset the PINGREQ timer after the message is sent // as this publish will reset the server's counter. // But don't reset it before you successfully send this msgs if (keepAliveTimer != null) { int kmillis = 1000 * _keepAlive; keepAliveTimer.Change(kmillis, kmillis); } return(messID); } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }
public ulong Publish2Alias(string alias, MqttPayload payload, QoS qos, int ttl, string apn_json) { return Publish2(",yta/" + alias, payload, qos, ttl, apn_json); }
public void Connect(string willTopic, QoS willQoS, MqttPayload willMsg, bool willRetain, bool cleanStart) { DoConnect(new MqttConnectMessage( _clientID, _username, _password, _keepAlive, willTopic, willMsg.TrimmedBuffer, willQoS, willRetain, cleanStart )); }
public int Publish(string topic, MqttPayload payload, QoS qos, bool retained) { if (manager.IsConnected) { ushort messID = MessageID; manager.SendMessage(new MqttPublishMessage(messID, topic, payload.TrimmedBuffer, qos, retained)); return messID; } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }
public void Connect(string username, string password,string willTopic, QoS willQoS, MqttPayload willMsg, bool willRetain, bool cleanStart) { DoConnect(new MqttConnectMessage( _clientID, _keepAlive,username,password, willTopic, willMsg.TrimmedBuffer, willQoS, willRetain, cleanStart )); }
public void Connect(string willTopic, QoS willQoS, MqttPayload willMsg, bool willRetain) { DoConnect(new MqttConnectMessage( _clientID, _keepAlive, willTopic, willMsg.TrimmedBuffer, willQoS, willRetain, false )); }
public void Connect(string username, string password, string willTopic, QoS willQoS, MqttPayload willMsg, bool willRetain) { DoConnect(new MqttConnectMessage( _clientID, _keepAlive, username, password, willTopic, willMsg.TrimmedBuffer, willQoS, willRetain, false )); }
public ulong PublishWithToken(string topic, string token, MqttPayload payload, QoS qos, bool retained) { string topicWithToken = ",yam" + token + "_" + topic; return(Publish(topicWithToken, payload, qos, retained)); }
public ulong PublishToAliasWithToken(string alias, string token, MqttPayload payload, QoS qos, bool retained) { string AliasWithToken = ",yam" + token + "_" + ",yta/" + alias; return(Publish(AliasWithToken, payload, qos, retained)); }
public ulong Publish2Alias(string alias, MqttPayload payload, QoS qos, int ttl, string apn_json) { return(Publish2(",yta/" + alias, payload, qos, ttl, apn_json)); }
public ulong PublishToAlias(string alias, MqttPayload payload, QoS qos, bool retained) { return(Publish(",yta/" + alias, payload, qos, retained)); }
public ulong Publish2WithToken(string topic, string token, MqttPayload payload, QoS qos, int ttl, string apn_json) { string topicWithToken = ",yam" + token + "_" + topic; return(Publish2(topicWithToken, payload, qos, ttl, apn_json)); }
public ulong PublishToAlias(string alias, MqttPayload payload, QoS qos, bool retained) { return Publish(",yta/" + alias, payload, qos, retained); }
public ulong Publish2ToAliasWithToken(string alias, string token, MqttPayload payload, QoS qos, int ttl, string apn_json) { string AliasWithToken = ",yam" + token + "_" + ",yta/" + alias; return(Publish2(AliasWithToken, payload, qos, ttl, apn_json)); }
public ulong Publish2(string topic, MqttPayload payload, QoS qos, int ttl, string apn_json) { if (manager.IsConnected) { ulong messID = MessageID; manager.SendMessage(new MqttExtendedackMessage(messID, topic, payload.TrimmedBuffer, qos, ttl, apn_json)); return messID; } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }
public ulong Publish(string topic, MqttPayload payload, QoS qos, bool retained) { if (manager.IsConnected) { // Reset the PINGREQ timer as this publish will reset the server's counter if (keepAliveTimer != null) { int kmillis = 1000 * _keepAlive; keepAliveTimer.Change(kmillis, kmillis); } ulong messID = MessageID; manager.SendMessage(new MqttPublishMessage(messID, topic, payload.TrimmedBuffer, qos, retained)); return messID; } else { throw new MqttNotConnectedException("You need to connect to a broker before trying to Publish"); } }