expose CONNACK properties

Summary: resolves T13155

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Maniphest Tasks: T13155

Differential Revision: https://repo.mireo.local/D26681
This commit is contained in:
Korina Šimičević
2023-11-23 13:41:02 +01:00
parent e191679889
commit 5034734fc4
17 changed files with 228 additions and 8 deletions

View File

@@ -165,6 +165,28 @@ public:
});
}
/**
* \brief Retrieves the value of a specific property from the last \__CONNACK\__ packet received.
*
* \details The return type varies according to the property requested.
* For all properties, the return type will be `std::optional` of their respective value type.
* For `async_mqtt5::prop::user_property`, the return type is `std::vector<std::string>`.
*
* \param prop The \__CONNACK\__ property value to retrieve.
*
* \par Example
* \code
* std::optional<std::string> auth_method = client.connection_property(async_mqtt5::prop::authentication_method); // ok
* std::optional<std::string> c_type = client.connection_property(async_mqtt5::prop::content_type); // does not compile!
* \endcode
*
* \see See \__CONNACK_PROPS\__ for all eligible properties.
*/
template <uint8_t p>
decltype(auto) connection_property(std::integral_constant<uint8_t, p> prop) {
return _svc_ptr->connack_prop(prop);
}
/**
* \brief Assign a \ref will Message.
*