PUBLISH_PACKET

This commit is contained in:
Feng Lee 2015-10-14 18:56:23 +08:00
parent 1a0d536cd0
commit 51a10328f3
1 changed files with 9 additions and 9 deletions

View File

@ -209,20 +209,20 @@
#mqtt_packet{header = #mqtt_packet_header{type = ?CONNACK}, #mqtt_packet{header = #mqtt_packet_header{type = ?CONNACK},
variable = #mqtt_packet_connack{return_code = ReturnCode}}). variable = #mqtt_packet_connack{return_code = ReturnCode}}).
-define(PUBLISH_PACKET(Qos, PacketId),
#mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH,
qos = Qos},
variable = #mqtt_packet_publish{packet_id = PacketId}}).
-define(PUBLISH_PACKET(Qos, Topic, PacketId, Payload), -define(PUBLISH_PACKET(Qos, Topic, PacketId, Payload),
#mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH, #mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH,
qos = Qos}, qos = Qos},
variable = #mqtt_packet_publish{topic_name = Topic, variable = #mqtt_packet_publish{topic_name = Topic,
packet_id = PacketId}, packet_id = PacketId},
payload = Payload}). payload = Payload}).
-define(PUBLISH(Qos, PacketId),
#mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH,
qos = Qos},
variable = #mqtt_packet_publish{packet_id = PacketId}}).
-define(PUBACK_PACKET(Type, PacketId), -define(PUBACK_PACKET(Type, PacketId),
#mqtt_packet{header = #mqtt_packet_header{type = Type}, #mqtt_packet{header = #mqtt_packet_header{type = Type},
variable = #mqtt_packet_puback{packet_id = PacketId}}). variable = #mqtt_packet_puback{packet_id = PacketId}}).
-define(PUBREL_PACKET(PacketId), -define(PUBREL_PACKET(PacketId),