diff --git a/src/samples/MQTTAsync_publish.c b/src/samples/MQTTAsync_publish.c index 796adbc4..7695a745 100644 --- a/src/samples/MQTTAsync_publish.c +++ b/src/samples/MQTTAsync_publish.c @@ -152,7 +152,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - if ((rc = MQTTAsync_setCallbacks(client, NULL, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS) + if ((rc = MQTTAsync_setCallbacks(client, client, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS) { printf("Failed to set callback, return code %d\n", rc); exit(EXIT_FAILURE); diff --git a/src/samples/MQTTAsync_publish_time.c b/src/samples/MQTTAsync_publish_time.c index 08e312da..6aad601a 100644 --- a/src/samples/MQTTAsync_publish_time.c +++ b/src/samples/MQTTAsync_publish_time.c @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - if ((rc = MQTTAsync_setCallbacks(client, NULL, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS) + if ((rc = MQTTAsync_setCallbacks(client, client, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS) { printf("Failed to set callback, return code %d\n", rc); exit(EXIT_FAILURE);