espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
603 stars 255 forks source link

Access QoS and dup on receiving events (IDFGH-5802) #200

Closed bertmelis closed 2 years ago

bertmelis commented 3 years ago

Is it possible to get the QoS, dup-flag and retain-flag when receiving messages or subacks?

I can't find any docs on this. Happy to create a PR if not yet implemented. (note: I did not try to implement yet)

david-cermak commented 3 years ago

@bertmelis Only the retain flag is available in the data event:

https://github.com/espressif/esp-mqtt/blob/master/mqtt_client.c#L958

qos and dup flags could be added in a similar way. PRs welcome :+1:

bertmelis commented 3 years ago

While implementing I overlooked something I also wanted: the payload from the SUBACK message. This payload contains the maximum granted qos level of the subscribe, or 0xF for failure.

OK to put in the same PR?

david-cermak commented 3 years ago

OK to put in the same PR?

Absolutely, but please make it a separate commit.