ME910 support

Dependents:   5_Dragonfly_Cayenne_Sprint_IKS01A1

Fork of Cayenne-MQTT-mbed-MTSAS by Peter Ferland

Branch:
feature/multivalue
Revision:
22:0dbabcc6e7b2
Parent:
0:09ef59d2d0f7
--- a/src/MQTTCommon/MQTTPacket.h	Tue Nov 08 18:48:37 2016 -0700
+++ b/src/MQTTCommon/MQTTPacket.h	Wed Jan 25 10:34:16 2017 -0700
@@ -18,6 +18,8 @@
 #ifndef MQTTPACKET_H_
 #define MQTTPACKET_H_
 
+#include <stddef.h>
+
 #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */
 extern "C" {
 #endif
@@ -74,7 +76,7 @@
 
 typedef struct
 {
-	int len;
+	size_t len;
 	char* data;
 } MQTTLenString;
 
@@ -86,20 +88,20 @@
 
 #define MQTTString_initializer {NULL, {0, NULL}}
 
-int MQTTstrlen(MQTTString mqttstring);
+size_t MQTTstrlen(MQTTString mqttstring);
 
 #include "MQTTConnect.h"
 #include "MQTTPublish.h"
 #include "MQTTSubscribe.h"
 #include "MQTTUnsubscribe.h"
 
-int MQTTSerialize_ack(unsigned char* buf, int buflen, unsigned char type, unsigned char dup, unsigned short packetid);
-int MQTTDeserialize_ack(unsigned char* packettype, unsigned char* dup, unsigned short* packetid, unsigned char* buf, int buflen);
+int MQTTSerialize_ack(unsigned char* buf, size_t buflen, unsigned char type, unsigned char dup, unsigned short packetid);
+int MQTTDeserialize_ack(unsigned char* packettype, unsigned char* dup, unsigned short* packetid, unsigned char* buf, size_t buflen);
 
-int MQTTPacket_len(int rem_len);
+size_t MQTTPacket_len(size_t rem_len);
 int MQTTPacket_equals(MQTTString* a, char* b);
 
-int MQTTPacket_encode(unsigned char* buf, int length);
+int MQTTPacket_encode(unsigned char* buf, size_t length);
 int MQTTPacket_decode(int (*getcharfn)(unsigned char*, int), int* value);
 int MQTTPacket_decodeBuf(unsigned char* buf, int* value);