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
Diff: MQTTConnectServer.c
- Revision:
- 14:c2052aee81de
- Parent:
- 13:5e60cd1a52e7
- Child:
- 16:d0b3886ada32
--- a/MQTTConnectServer.c Fri Aug 01 13:08:46 2014 +0100 +++ b/MQTTConnectServer.c Fri Aug 01 15:34:04 2014 +0100 @@ -48,12 +48,12 @@ * @param len the length in bytes of the data in the supplied buffer * @return error code. 1 is success, 0 is failure */ -int MQTTDeserialize_connect(MQTTPacket_connectData* data, char* buf, int len) +int MQTTDeserialize_connect(MQTTPacket_connectData* data, unsigned char* buf, int len) { MQTTHeader header; MQTTConnectFlags flags; - char* curdata = buf; - char* enddata = &buf[len]; + unsigned char* curdata = buf; + unsigned char* enddata = &buf[len]; int rc = 0; MQTTString Protocol; int version; @@ -61,7 +61,6 @@ FUNC_ENTRY; header.byte = readChar(&curdata); - header.byte = header.byte; // hush compiler warnings curdata += MQTTPacket_decodeBuf(curdata, &mylen); /* read remaining length */ @@ -114,11 +113,11 @@ * @param connack_rc the integer connack return code to be used * @return serialized length, or error if 0 */ -int MQTTSerialize_connack(char* buf, int buflen, int connack_rc) +int MQTTSerialize_connack(unsigned char* buf, int buflen, unsigned char connack_rc) { MQTTHeader header; int rc = 0; - char *ptr = buf; + unsigned char *ptr = buf; FUNC_ENTRY; if (buflen < 2)