1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 17:01:19 +01:00

tests/emcute: add check for message ID with PUBLISH QoS 0

This commit is contained in:
Martine S. Lenders 2020-12-17 17:25:53 +01:00
parent 145c863ed1
commit eaa1b76227

View File

@ -101,6 +101,11 @@ class MQTTSNServer(Automaton):
def _check_pkt_qos(self, pkt):
qos_types = [mqttsn.PUBLISH, mqttsn.SUBSCRIBE]
# see MQTT-SN 1.2 spec 5.4.12
if (pkt.type == mqttsn.PUBLISH) and \
(pkt.qos not in [mqttsn.QOS_1, mqttsn.QOS_2]) and \
(pkt.mid != 0):
return False
return (pkt.type not in qos_types) or (pkt.qos == self._qos_flags)
def _get_tid(self, topic_name):