From 51a10328f39ce1ad666bbabef47f236eb034d64f Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 14 Oct 2015 18:56:23 +0800 Subject: [PATCH] PUBLISH_PACKET --- include/emqttd_protocol.hrl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/emqttd_protocol.hrl b/include/emqttd_protocol.hrl index c5adb66b3..b7f2c5743 100644 --- a/include/emqttd_protocol.hrl +++ b/include/emqttd_protocol.hrl @@ -209,20 +209,20 @@ #mqtt_packet{header = #mqtt_packet_header{type = ?CONNACK}, 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), - #mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH, - qos = Qos}, + #mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH, + qos = Qos}, variable = #mqtt_packet_publish{topic_name = Topic, packet_id = PacketId}, - payload = Payload}). - --define(PUBLISH(Qos, PacketId), - #mqtt_packet{header = #mqtt_packet_header{type = ?PUBLISH, - qos = Qos}, - variable = #mqtt_packet_publish{packet_id = PacketId}}). + payload = Payload}). -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}}). -define(PUBREL_PACKET(PacketId),