hirotakaster / MQTT

MQTT for Photon, Spark Core
Other
216 stars 118 forks source link

Support for retain flag on published messages #22

Closed alistairg closed 8 years ago

alistairg commented 8 years ago

There is no way to set the "retain" flag on any message other than the "Will" on initial connect

hirotakaster commented 8 years ago

If want to use retain flag, set kep is true following function. publish(const char* topic, const uint8_t* payload, unsigned int plength, bool kept) publish(const char* topic, const uint8_t* payload, unsigned int plength, bool kept, EMQTT_QOS qos, uint16_t *messageid)

alistairg commented 8 years ago

My apologies. I looked at the example (mqttqostest.ino) rather than the source. :)