Feng Lee пре 10 година
родитељ
комит
51a10328f3
1 измењених фајлова са 9 додато и 9 уклоњено
  1. 9 9
      include/emqttd_protocol.hrl

+ 9 - 9
include/emqttd_protocol.hrl

@@ -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,
-                                              qos = Qos},
+    #mqtt_packet{header   = #mqtt_packet_header{type = ?PUBLISH,
+                                                qos = Qos},
                  variable = #mqtt_packet_publish{topic_name = Topic,
                  variable = #mqtt_packet_publish{topic_name = Topic,
                                                  packet_id  = PacketId},
                                                  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),
 -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),