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: https://www.wolfssl.com/docs/wolfmqtt-m … 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,
        MQTT_PACKET_TYPE_ANY, 0, NULL);
}

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

Thanks for you time smile
======================================================
http://www.edx-twin3.org