Skip to content

Commit

Permalink
Merge pull request #1382 from CIPop/asyncsamplefix1
Browse files Browse the repository at this point in the history
Async sample callback context fix.
  • Loading branch information
icraggs authored Oct 9, 2023
2 parents 707b0dc + 4f58560 commit 43a7b48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/samples/MQTTAsync_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/samples/MQTTAsync_publish_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 43a7b48

Please sign in to comment.