MQTT library (clone of https://os.mbed.com/teams/mqtt/code/MQTT/)

Dependencies:   FP MQTTPacket

Dependents:   NuMaker-mbed-AWS-IoT-example NuMaker-mbed-OS-6-AWS-IoT-example

Revision:
62:50950f0d9c96
Parent:
61:20d53aa127ea
diff -r 20d53aa127ea -r 50950f0d9c96 MQTTClient.h
--- a/MQTTClient.h	Tue Apr 16 16:37:11 2019 +0800
+++ b/MQTTClient.h	Tue Apr 16 16:22:26 2019 +0800
@@ -857,11 +857,12 @@
     Timer timer(command_timeout_ms);
     int len = 0;
     MQTTString topic = {(char*)topicFilter, {0, 0}};
+    int qos_int = qos;
 
     if (!isconnected)
         goto exit;
 
-    len = MQTTSerialize_subscribe(sendbuf, MAX_MQTT_PACKET_SIZE, 0, packetid.getNext(), 1, &topic, (int*)&qos);
+    len = MQTTSerialize_subscribe(sendbuf, MAX_MQTT_PACKET_SIZE, 0, packetid.getNext(), 1, &topic, &qos_int);
     if (len <= 0)
         goto exit;
     if ((rc = sendPacket(len, timer)) != SUCCESS) // send the subscribe packet