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);