Basic C library for MQTT packet serialization and deserialization

Dependents:   MQTT MQTT MQTT MQTT ... more

Fork of MQTTPacket by MQTT

This library is part of the EclipseTM Paho project; specifically the embedded client.

A basic MQTT library in C for packet serialization and deserialization

Revision:
14:c2052aee81de
Parent:
12:cd99ac9cb25a
Child:
15:f0ae0b8d4418
--- a/MQTTUnsubscribeClient.c	Fri Aug 01 13:08:46 2014 +0100
+++ b/MQTTUnsubscribeClient.c	Fri Aug 01 15:34:04 2014 +0100
@@ -46,9 +46,10 @@
   * @param topicFilters - array of topic filter names
   * @return the length of the serialized data.  <= 0 indicates error
   */
-int MQTTSerialize_unsubscribe(char* buf, int buflen, int dup, int packetid, int count, MQTTString topicFilters[])
+int MQTTSerialize_unsubscribe(unsigned char* buf, int buflen, unsigned char dup, unsigned short packetid,
+		int count, MQTTString topicFilters[])
 {
-	char *ptr = buf;
+	unsigned char *ptr = buf;
 	MQTTHeader header;
 	int rem_len = 0;
 	int rc = -1;
@@ -88,9 +89,9 @@
   * @param buflen the length in bytes of the data in the supplied buffer
   * @return error code.  1 is success, 0 is failure
   */
-int MQTTDeserialize_unsuback(int* packetid, char* buf, int buflen)
+int MQTTDeserialize_unsuback(unsigned short* packetid, unsigned char* buf, int buflen)
 {
-	int type = 0;
+	unsigned char type = 0;
 	unsigned char dup = 0;
 	int rc = 0;