Add 'PUBLISH_PACKET(QoS, Topic, PacketId)' macro

This commit is contained in:
Feng Lee 2019-06-25 14:29:26 +08:00
parent 3877c4db1a
commit 795fe4e0bc
3 changed files with 7 additions and 0 deletions

View File

@ -351,6 +351,13 @@
variable = #mqtt_packet_publish{packet_id = PacketId}
}).
-define(PUBLISH_PACKET(QoS, Topic, PacketId),
#mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH,
qos = QoS},
variable = #mqtt_packet_publish{topic_name = Topic,
packet_id = PacketId}
}).
-define(PUBLISH_PACKET(QoS, Topic, PacketId, Payload),
#mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH,
qos = QoS},