forked from boostorg/mqtt5
Summary: related to T12804 Reviewers: ivica Reviewed By: ivica Subscribers: iljazovic, miljen Differential Revision: https://repo.mireo.local/D26219
41 lines
2.2 KiB
Plaintext
41 lines
2.2 KiB
Plaintext
[/
|
|
Copyright (c) 2023 Mireo
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
]
|
|
|
|
[section:will_props Will properties]
|
|
The Will Properties consist of the properties that determine when to publish the [reflink2 will Will] Message
|
|
and the Application Message properties to be sent with the [reflink2 will Will] Message.
|
|
The Will Properties consists of a Property Length and the Properties.
|
|
A Property consists of an Identifier and a value.
|
|
|
|
This section lists all possible [reflink2 will Will] Properties and describes their usage:
|
|
|
|
[table:will_props Will properties
|
|
[[Identifier] [Value type] [Description]]
|
|
[[will_delay_interval] [`int32_t`] [The delay in seconds that need to pass before Server publishes the Client's Will Message.]]
|
|
[[payload_format_indicator] [`uint8_t`] [Value of 0 indicates that the Will Message is in unspecified bytes. Value of 1 indicates that the Will Message is UTF-8 Encoded Character Data.]]
|
|
[[message_expiry_interval] [`int32_t`] [The lifetime of the Will Message in seconds. It is send as Publication Expiry Interval when it is published.]]
|
|
[[content_type] [`std::string`] [A UTF-8 Encoded String describing the content of the Will Message.]]
|
|
[[response_topic] [`std::string`] [A UTF-8 Encoded String which is used as the Topic Name for a response message.]]
|
|
[[correlation_data] [`std::string`] [Binary Data used by the sender of the Request Message to identify which request the Response Message is for when it is received.]]
|
|
[[user_property] [`std::vector<std::string>`] [A list of name, value pairs (__UTF8_STRING_PAIR__) defining User Properties.
|
|
The meaning of these properties is not defined by the specification.]]
|
|
]
|
|
|
|
[h4 Usage]
|
|
After creating an instance of [reflink2 will `async_mqtt5::will`], the subscript operator can be used to access a Property.
|
|
|
|
The Identifiers listed in the table above are available within the `async_mqtt5::prop` namespace for Property access.
|
|
|
|
[h4 Example]
|
|
|
|
[!c++]
|
|
async_mqtt5::will will;
|
|
will[async_mqtt5::prop::message_expiry_interval] = 90;
|
|
will[async_mqtt5::prop::content_type] = "Notification";
|
|
|
|
[endsect]
|