1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/net/application_layer/emcute
Martine S. Lenders 89afc378a9 emcute: fix length field calculation
The length field in an MQTT packet carries the _total_ length of the
packet. If it is below 256 (i.e. fits in one byte) only one byte is
used for the length field. If it is larger than that 3 bytes are used,
with the first byte having the value `0x01` and the remaining bytes
representing the length in as a 2 byte unsigned integer in network byte
order. Resulting from that it can be assessed that the check in
`emcutes`'s `set_len()` function is wrong as it needs to be checked if
`len` is lesser or equal to `0xff - 1`. `len <= (0xff - 1)` can be
simplified to `len < 0xff`. For some larger packages this safes 2 bytes
of wasted packet space.
2019-08-05 13:08:20 +02:00
..
emcute_internal.h net: added emCute - introducing MQTT-SN support 2017-02-28 16:58:29 +01:00
emcute_str.c net: added emCute - introducing MQTT-SN support 2017-02-28 16:58:29 +01:00
emcute.c emcute: fix length field calculation 2019-08-05 13:08:20 +02:00
Makefile net: added emCute - introducing MQTT-SN support 2017-02-28 16:58:29 +01:00