wolfSSL / wolfMQTT

wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3.
https://www.wolfssl.com
GNU General Public License v2.0
521 stars 155 forks source link

Allow message callback to set reason code for response #287

Closed embhorn closed 2 years ago

embhorn commented 2 years ago

The application can set a reason code to be sent in the publish response (MQTTv5 only).

Example:

int mqtt_message_cb(MqttClient *client, MqttMessage *msg,
    byte msg_new, byte msg_done)
{
    msg->resp.reason_code = MQTT_REASON_IMPL_SPECIFIC_ERR;
    return 0;
}

This addresses an issue reported by ZD13865.

embhorn commented 2 years ago

Fix confirmed by customer. Ready for merge.