Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 |
--- 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,
--- 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;
