Topic: Possible error on example on website

Hi there, as the title says i think there's a error on the webpage, maybe somebody else already noticed it or perhaps i'm wrong, but anyway here we go:

The URL is this: … szdkq94ege
The wrong example is 5.9 MQTTCLIENT_WAITMESSAGE
Screenshot:  attachment #1

According to the example on the webpage the MqttClient_WaitMessage should be used this way:

rc = MqttClient_WaitMessage(&client, &msg, DEFAULT_CMD_TIMEOUT_MS);

But if you take a look at the source code (wolfmqtt-1.2.0), the function just needs two parameters, the client and the timeout.

int MqttClient_WaitMessage(MqttClient *client, int timeout_ms)
    return MqttClient_WaitType(client, &client->msg, timeout_ms,

So if you tried the example there'll be a warning because the second pointer (&msg)

Thanks for you time smile

Post's attachments

mqtt_page.png 24 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Possible error on example on website


Thank you so much for pointing this out. The documentation was accurate at the time it was produced but a subsequent refactor of the MQTT code caused the two to become out of sync. We will get an update to the documentation on the next update.

Warm Regards,