Hello kackle123
The web doc is out date from the code. There are two API
int MqttClient_WaitMessage_ex(MqttClient *client, MqttObject* msg,
int timeout_ms)
{
return MqttClient_WaitType(client, msg, MQTT_PACKET_TYPE_ANY, 0,
timeout_ms);
}
int MqttClient_WaitMessage(MqttClient *client, int timeout_ms)
{
if (client == NULL)
return MQTT_CODE_ERROR_BAD_ARG;
return MqttClient_WaitMessage_ex(client, &client->msg, timeout_ms);
}
As you can see, `MqttClient_WaitMessage` does take 2 parameters.
Are you trying to read an incoming publish, whose topic you have already subscribed? You should try setting up a publish callback. Here is an example:
https://github.com/wolfSSL/wolfMQTT/blo … ient.c#L58
Thanks,
Eric @ wolfSSL Support