Common API¶
This document describes HBMQTT common API both used by MQTTClient API and Broker API reference.
Reference¶
ApplicationMessage¶
-
class
hbmqtt.session.ApplicationMessage(packet_id, topic, qos, data, retain)[source]¶ ApplicationMessage and subclasses are used to store published message information flow. These objects can contain different information depending on the way they were created (incoming or outgoing) and the quality of service used between peers.
-
build_publish_packet(dup=False)[source]¶ - Build
hbmqtt.mqtt.publish.PublishPacketfrom attributesParameters: dup – force dup flag Returns: hbmqtt.mqtt.publish.PublishPacketbuilt from ApplicationMessage instance attributes
-
data¶ Publish message payload data
-
packet_id¶ Publish message packet identifier
-
puback_packet¶ hbmqtt.mqtt.puback.PubackPacketinstance corresponding to the PUBACK packet in the messages flow.Noneif QoS != QOS_1 or if the PUBACK packet has not already been received or sent.
-
pubcomp_packet¶ hbmqtt.mqtt.puback.PubrelPacketinstance corresponding to the PUBCOMP packet in the messages flow.Noneif QoS != QOS_2 or if the PUBCOMP packet has not already been received or sent.
-
publish_packet¶ hbmqtt.mqtt.publish.PublishPacketinstance corresponding to the PUBLISH packet in the messages flow.Noneif the PUBLISH packet has not already been received or sent.
-
pubrec_packet¶ hbmqtt.mqtt.puback.PubrecPacketinstance corresponding to the PUBREC packet in the messages flow.Noneif QoS != QOS_2 or if the PUBREC packet has not already been received or sent.
-
pubrel_packet¶ hbmqtt.mqtt.puback.PubrelPacketinstance corresponding to the PUBREL packet in the messages flow.Noneif QoS != QOS_2 or if the PUBREL packet has not already been received or sent.
-
qos¶ Publish message Quality of Service
-
retain¶ Publish message retain flag
-
topic¶ Publish message topic
-
-
class
hbmqtt.session.IncomingApplicationMessage(packet_id, topic, qos, data, retain)[source]¶ Bases:
hbmqtt.session.ApplicationMessageIncoming
ApplicationMessage.
-
class
hbmqtt.session.OutgoingApplicationMessage(packet_id, topic, qos, data, retain)[source]¶ Bases:
hbmqtt.session.ApplicationMessageOutgoing
ApplicationMessage.