My Modify MQTTPacket Packet size 100 -> 400
Fork of MQTTPacket by
Revision 20:18bc6c007ce2, committed 2015-08-12
- Comitter:
- ericliang
- Date:
- Wed Aug 12 02:38:26 2015 +0000
- Parent:
- 18:bf36e077e7b8
- Commit message:
- Modify MQTTPacket Size to 400 Bytes
Changed in this revision
MQTTPacket.h | Show annotated file Show diff for this revision Revisions of this file |
MQTTSerializePublish.c | Show annotated file Show diff for this revision Revisions of this file |
diff -r bf36e077e7b8 -r 18bc6c007ce2 MQTTPacket.h --- a/MQTTPacket.h Mon Sep 29 11:31:13 2014 +0000 +++ b/MQTTPacket.h Wed Aug 12 02:38:26 2015 +0000 @@ -21,6 +21,8 @@ extern "C" { #endif +#define ADV_MAX_PACKET_SIZE 400 + enum errors { MQTTPACKET_BUFFER_TOO_SHORT = -2,
diff -r bf36e077e7b8 -r 18bc6c007ce2 MQTTSerializePublish.c --- a/MQTTSerializePublish.c Mon Sep 29 11:31:13 2014 +0000 +++ b/MQTTSerializePublish.c Wed Aug 12 02:38:26 2015 +0000 @@ -58,14 +58,15 @@ MQTTHeader header = {0}; int rem_len = 0; int rc = 0; - + printf("eric serial 1\n"); FUNC_ENTRY; if (MQTTPacket_len(rem_len = MQTTSerialize_publishLength(qos, topicName, payloadlen)) > buflen) { + printf("eric serial error payload=%d rem %d buflen=%d\n",payloadlen, rem_len, buflen); rc = MQTTPACKET_BUFFER_TOO_SHORT; goto exit; } - + printf("eric serial 2\n"); header.bits.type = PUBLISH; header.bits.dup = dup; header.bits.qos = qos;