issue#33: QoS of PUBREL packet should be 1
This commit is contained in:
parent
3ca3552452
commit
161754871f
|
@ -230,9 +230,14 @@ make_packet(Type) when Type >= ?CONNECT andalso Type =< ?DISCONNECT ->
|
||||||
#mqtt_packet{ header = #mqtt_packet_header { type = Type } }.
|
#mqtt_packet{ header = #mqtt_packet_header { type = Type } }.
|
||||||
|
|
||||||
make_packet(PubAck, PacketId) when PubAck >= ?PUBACK andalso PubAck =< ?PUBCOMP ->
|
make_packet(PubAck, PacketId) when PubAck >= ?PUBACK andalso PubAck =< ?PUBCOMP ->
|
||||||
#mqtt_packet { header = #mqtt_packet_header { type = PubAck},
|
#mqtt_packet { header = #mqtt_packet_header { type = PubAck, qos = puback_qos(PubAck) },
|
||||||
variable = #mqtt_packet_puback { packet_id = PacketId}}.
|
variable = #mqtt_packet_puback { packet_id = PacketId}}.
|
||||||
|
|
||||||
|
puback_qos(?PUBACK) -> ?QOS_0;
|
||||||
|
puback_qos(?PUBREC) -> ?QOS_0;
|
||||||
|
puback_qos(?PUBREL) -> ?QOS_1;
|
||||||
|
puback_qos(?PUBCOMP) -> ?QOS_0;
|
||||||
|
|
||||||
-spec send_message(Message, State) -> {ok, NewState} when
|
-spec send_message(Message, State) -> {ok, NewState} when
|
||||||
Message :: mqtt_message(),
|
Message :: mqtt_message(),
|
||||||
State :: proto_state(),
|
State :: proto_state(),
|
||||||
|
|
Loading…
Reference in New Issue