From 16e90c3082cc1674c11ad34269689829bc0f500b Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 4 Jul 2022 14:32:12 -0300 Subject: [PATCH] updated docs and example to recently exported MQTT result codes --- docs/README.md | 2 +- examples/mqtt-over-ws-client/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index a4729eaf..ed9a141e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1911,7 +1911,7 @@ Usage example: ```c // Iterate over all MQTT frames contained in buf, len struct mg_mqtt_message mm; -while ((mg_mqtt_parse(buf, len, &mm)) == 0) { +while ((mg_mqtt_parse(buf, len, &mm)) == MQTT_OK) { switch (mm.cmd) { case MQTT_CMD_CONNACK: ... diff --git a/examples/mqtt-over-ws-client/main.c b/examples/mqtt-over-ws-client/main.c index d1cd88c7..b760204e 100644 --- a/examples/mqtt-over-ws-client/main.c +++ b/examples/mqtt-over-ws-client/main.c @@ -40,7 +40,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { uint8_t version = c->is_mqtt5 ? 5 : 4; MG_INFO(("GOT %d bytes WS msg", (int) wm->data.len)); while ((mg_mqtt_parse((uint8_t *) wm->data.ptr, wm->data.len, version, - &mm)) == 0) { + &mm)) == MQTT_OK) { switch (mm.cmd) { case MQTT_CMD_CONNACK: mg_call(c, MG_EV_MQTT_OPEN, &mm.ack);