123

Files at this revision

API Documentation at this revision

Comitter:
m_ahsan
Date:
Thu Jan 03 05:49:15 2019 +0000
Parent:
1:7fa362fa563f
Commit message:
test

Changed in this revision

MQTTSNPacket.c Show annotated file Show diff for this revision Revisions of this file
MQTTSNSerializePublish.c Show annotated file Show diff for this revision Revisions of this file
diff -r 7fa362fa563f -r 573d544b5d3c MQTTSNPacket.c
--- a/MQTTSNPacket.c	Wed Jan 06 14:19:27 2016 +0000
+++ b/MQTTSNPacket.c	Thu Jan 03 05:49:15 2019 +0000
@@ -48,7 +48,7 @@
  */
 int MQTTSNPacket_len(int length)
 {
-	return (length > 255) ? length + 3 : length + 1;
+	return (length > 256) ? length + 3 : length + 1;
 }
 
 
@@ -63,7 +63,7 @@
 	int rc = 0;
 
 	FUNC_ENTRY;
-	if (length > 255)
+	if (length > 1024)
 	{
 		buf[rc++] = 0x01;
 		MQTTSNPacket_writeInt(&buf, length);
diff -r 7fa362fa563f -r 573d544b5d3c MQTTSNSerializePublish.c
--- a/MQTTSNSerializePublish.c	Wed Jan 06 14:19:27 2016 +0000
+++ b/MQTTSNSerializePublish.c	Thu Jan 03 05:49:15 2019 +0000
@@ -33,7 +33,7 @@
 
 	if (topic.type == MQTTSN_TOPIC_TYPE_NORMAL && qos == 3)
 		len += topic.data.long_.len;
-
+	printf("payloadlen %d", payloadlen+len);
 	return payloadlen + len;
 }