mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-15 16:36:52 +01:00
@@ -53,7 +53,7 @@ const char* MQTTSNPacket_name(int code)
|
|||||||
*/
|
*/
|
||||||
int MQTTSNPacket_len(int length)
|
int MQTTSNPacket_len(int length)
|
||||||
{
|
{
|
||||||
return (length > 255) ? length + 3 : length + 1;
|
return (length >= 255) ? length + 3 : length + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +67,7 @@ int MQTTSNPacket_encode(unsigned char* buf, int length)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
FUNC_ENTRY;
|
FUNC_ENTRY;
|
||||||
if (length > 255)
|
if (length >= 255)
|
||||||
{
|
{
|
||||||
writeChar(&buf, 0x01);
|
writeChar(&buf, 0x01);
|
||||||
writeInt(&buf, length);
|
writeInt(&buf, length);
|
||||||
|
|||||||
Reference in New Issue
Block a user