espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
610 stars 257 forks source link

Feature Request: Access retained flag on received message (IDFGH-5297) #193

Closed calkoe closed 3 years ago

calkoe commented 3 years ago

@david-cermak

Feature Request:

It would be awesome to be able to check if a received message was a retained one and may be old. I'm controlling door locks via MQTT and this would be very important to me.

typedef struct {
     ...
     bool retained; /*!< true indicates the message was retained and may be old. */
     ...
} esp_mqtt_event_handle_t

image

Thanks!

david-cermak commented 3 years ago

Thanks for this useful suggestion.

You can evaluate this feature applying the below patch: Add-support-for-Retain-flag-in-messages-posted-by-ev.patch.txt