Skip to content

Commit 2eaff1a

Browse files
committed
add description of retain flag
1 parent fc813ab commit 2eaff1a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/mqtt.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ int __cheri_compartment("MQTT") mqtt_publish(Timeout *t,
181181
* include the zero terminator and must be at least one-character long).
182182
*
183183
* `qos` indicates the level of QoS (0, 1, or 2).
184+
*
185+
* `retain` indicates whether the message should be published as retained or
186+
* not. The broker stores the last retained message and the corresponding QoS
187+
* for that topic. Each client that subscribes to a topic pattern that matches
188+
* the topic of the retained message receives the retained message immediately
189+
* after they subscribe. The broker stores only one retained message per topic.
190+
* Retained messages are cleared by publishing a zero length message with the
191+
* retain flag set.
184192
*
185193
* The filter buffer must remain valid during the execution of this function.
186194
* If the caller frees it during the execution of this function, the subscribe

0 commit comments

Comments
 (0)