mqtt_cpp
|
#include <endpoint.hpp>
Public Types | |
using | async_handler_t = std::function< void(error_code ec)> |
using | packet_id_t = typename packet_id_type< PacketIdBytes >::type |
Public Member Functions | |
endpoint (as::io_context &ioc, protocol_version version=protocol_version::undetermined, bool async_send_store=false) | |
Constructor for client. More... | |
endpoint (as::io_context &ioc, std::shared_ptr< MQTT_NS::socket > socket, protocol_version version=protocol_version::undetermined, bool async_send_store=false) | |
Constructor for server. socket should have already been connected with another endpoint. More... | |
endpoint (this_type const &)=delete | |
endpoint (this_type &&)=delete | |
endpoint & | operator= (this_type const &)=delete |
endpoint & | operator= (this_type &&)=delete |
bool | clean_session () const |
Get clean session. More... | |
bool | clean_start () const |
Get clean start. More... | |
std::size_t | get_total_bytes_received () const |
get_total_bytes_received More... | |
std::size_t | get_total_bytes_sent () const |
get_total_bytes_sent More... | |
void | set_auto_pub_response (bool b=true, bool async=true) |
Set auto publish response mode. More... | |
void | set_auto_map_topic_alias_send (bool b=true) |
Set topic alias send auto mapping enable flag. More... | |
void | set_auto_replace_topic_alias_send (bool b=true) |
Set topic alias send auto replacing enable flag. More... | |
void | set_packet_bulk_read_limit (std::size_t size) |
void | set_props_bulk_read_limit (std::size_t size) |
void | set_topic_alias_maximum (topic_alias_t max) |
set topic alias maximum for receiving More... | |
void | start_session (any session_life_keeper=any()) |
start session with a connected endpoint. More... | |
template<typename T , typename... Params> | |
std::enable_if_t< ! std::is_convertible< std::decay_t< T >, packet_id_t >::value, packet_id_t > | publish (T &&t, Params &&... params) |
Publish. More... | |
template<typename T , typename... Params> | |
std::enable_if_t< ! std::is_convertible< std::decay_t< T >, packet_id_t >::value, packet_id_t > | subscribe (T &&t, Params &&... params) |
Subscribe. More... | |
template<typename T , typename... Params> | |
std::enable_if_t< ! std::is_convertible< std::decay_t< T >, packet_id_t >::value, packet_id_t > | unsubscribe (T &&t, Params &&... params) |
Unsubscribe. More... | |
void | disconnect (v5::disconnect_reason_code reason=v5::disconnect_reason_code::normal_disconnection, v5::properties props={}) |
Disconnect Send a disconnect packet to the connected broker. It is a clean disconnecting sequence. The broker disconnects the endpoint after receives the disconnect packet. When the endpoint disconnects using disconnect(), a will won't send. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901205 More... | |
void | force_disconnect () |
Disconnect by endpoint Force disconnect. It is not a clean disconnect sequence. When the endpoint disconnects using force_disconnect(), a will will send. More... | |
void | publish (packet_id_t packet_id, std::string topic_name, std::string contents, publish_options pubopts={}, v5::properties props={}, any life_keeper={}) |
Publish with already acquired packet identifier. More... | |
template<typename ConstBufferSequence > | |
std::enable_if< as::is_const_buffer_sequence< ConstBufferSequence >::value >::type | publish (packet_id_t packet_id, as::const_buffer topic_name, ConstBufferSequence contents, publish_options pubopts, v5::properties props, any life_keeper) |
Publish with already acquired packet identifier. More... | |
template<typename ConstBufferSequence > | |
std::enable_if< as::is_const_buffer_sequence< ConstBufferSequence >::value >::type | publish (packet_id_t packet_id, as::const_buffer topic_name, ConstBufferSequence contents, publish_options pubopts, any life_keeper) |
Publish with already acquired packet identifier. More... | |
template<typename BufferSequence > | |
std::enable_if< is_buffer_sequence< BufferSequence >::value >::type | publish (packet_id_t packet_id, buffer topic_name, BufferSequence contents, publish_options pubopts={}, any life_keeper={}) |
Publish with already acquired packet identifier. More... | |
template<typename BufferSequence > | |
std::enable_if< is_buffer_sequence< BufferSequence >::value >::type | publish (packet_id_t packet_id, buffer topic_name, BufferSequence contents, publish_options pubopts, v5::properties props, any life_keeper={}) |
Publish with already acquired packet identifier. More... | |
void | subscribe (packet_id_t packet_id, string_view topic_filter, subscribe_options option, v5::properties props={}) |
Subscribe with already acquired packet identifier. More... | |
void | subscribe (packet_id_t packet_id, as::const_buffer topic_filter, subscribe_options option, v5::properties props={}) |
Subscribe with already acquired packet identifier. More... | |
void | subscribe (packet_id_t packet_id, std::vector< std::tuple< string_view, subscribe_options >> params, v5::properties props={}) |
Subscribe with already acquired packet identifier. More... | |
void | subscribe (packet_id_t packet_id, std::vector< std::tuple< buffer, subscribe_options >> params, v5::properties props={}) |
Subscribe with already acquired packet identifier. More... | |
void | unsubscribe (packet_id_t packet_id, string_view topic_filter, v5::properties props={}) |
Unsubscribe with already acquired packet identifier. More... | |
void | unsubscribe (packet_id_t packet_id, as::const_buffer topic_filter, v5::properties props={}) |
Unsubscribe with already acquired packet identifier. More... | |
void | unsubscribe (packet_id_t packet_id, std::vector< string_view > params, v5::properties props={}) |
Unsubscribe with already acquired packet identifier. More... | |
void | unsubscribe (packet_id_t packet_id, std::vector< as::const_buffer > params, v5::properties props={}) |
Unsubscribe with already acquired packet identifier. More... | |
void | unsubscribe (packet_id_t packet_id, std::vector< buffer > params, v5::properties props={}) |
Unsubscribe with already acquired packet identifier. More... | |
void | pingreq () |
Send pingreq packet. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901195. More... | |
void | pingresp () |
Send pingresp packet. This function is for broker. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200. More... | |
void | auth (v5::auth_reason_code reason_code=v5::auth_reason_code::success, v5::properties props={}) |
Send auth packet. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718086. More... | |
void | connect (std::string const &client_id, optional< std::string > const &user_name, optional< std::string > const &password, optional< will > w, std::uint16_t keep_alive_sec, v5::properties props={}) |
Send connect packet. More... | |
void | connect (buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > w, std::uint16_t keep_alive_sec, v5::properties props={}) |
Send connect packet. More... | |
void | connack (bool session_present, variant< connect_return_code, v5::connect_reason_code > reason_code, v5::properties props={}) |
Send connack packet. This function is for broker. More... | |
void | puback (packet_id_t packet_id, v5::puback_reason_code reason_code=v5::puback_reason_code::success, v5::properties props={}) |
Send puback packet. More... | |
void | pubrec (packet_id_t packet_id, v5::pubrec_reason_code reason_code=v5::pubrec_reason_code::success, v5::properties props={}) |
Send packet. More... | |
void | pubrel (packet_id_t packet_id, v5::pubrel_reason_code reason_code=v5::pubrel_reason_code::success, v5::properties props={}, any life_keeper={}) |
Send pubrel packet. More... | |
void | pubcomp (packet_id_t packet_id, v5::pubcomp_reason_code reason_code=v5::pubcomp_reason_code::success, v5::properties props={}) |
Send pubcomp packet. More... | |
void | suback (packet_id_t packet_id, variant< suback_return_code, v5::suback_reason_code > reason, v5::properties props={}) |
Send suback packet. This function is for broker. More... | |
void | suback (packet_id_t packet_id, variant< std::vector< suback_return_code >, std::vector< v5::suback_reason_code >> reasons, v5::properties props={}) |
Send suback packet. This function is for broker. More... | |
void | unsuback (packet_id_t packet_id) |
Send unsuback packet. This function is for broker. More... | |
void | unsuback (packet_id_t packet_id, v5::unsuback_reason_code reason, v5::properties props={}) |
Send unsuback packet. This function is for broker. More... | |
void | unsuback (packet_id_t packet_id, std::vector< v5::unsuback_reason_code > reasons, v5::properties props={}) |
Send unsuback packet. This function is for broker. More... | |
template<typename T , typename... Params> | |
std::enable_if_t< ! std::is_convertible< std::decay_t< T >, packet_id_t >::value > | async_publish (T &&t, Params &&... params) |
Publish. More... | |
void | async_disconnect (async_handler_t func={}) |
Disconnect. More... | |
void | async_disconnect (v5::disconnect_reason_code reason, v5::properties props, async_handler_t func={}) |
Disconnect. More... | |
template<typename T , typename... Params> | |
std::enable_if_t< ! std::is_convertible< std::decay_t< T >, packet_id_t >::value > | async_subscribe (T &&t, Params &&... params) |
Subscribe. More... | |
template<typename T , typename... Params> | |
std::enable_if_t< ! std::is_convertible< std::decay_t< T >, packet_id_t >::value > | async_unsubscribe (T &&t, Params &&... params) |
Unsubscribe. More... | |
void | async_publish (packet_id_t packet_id, std::string topic_name, std::string contents, publish_options pubopts={}, async_handler_t func={}) |
Publish with a manual set packet identifier. More... | |
void | async_publish (packet_id_t packet_id, std::string topic_name, std::string contents, publish_options pubopts, v5::properties props, any life_keeper={}, async_handler_t func={}) |
Publish with a manual set packet identifier. More... | |
template<typename ConstBufferSequence > | |
std::enable_if< as::is_const_buffer_sequence< ConstBufferSequence >::value >::type | async_publish (packet_id_t packet_id, as::const_buffer topic_name, ConstBufferSequence contents, publish_options pubopts={}, any life_keeper={}, async_handler_t func={}) |
Publish with a manual set packet identifier. More... | |
template<typename ConstBufferSequence > | |
std::enable_if< as::is_const_buffer_sequence< ConstBufferSequence >::value >::type | async_publish (packet_id_t packet_id, as::const_buffer topic_name, ConstBufferSequence contents, publish_options pubopts, v5::properties props, any life_keeper={}, async_handler_t func={}) |
Publish with a manual set packet identifier. More... | |
template<typename BufferSequence > | |
std::enable_if< is_buffer_sequence< BufferSequence >::value >::type | async_publish (packet_id_t packet_id, buffer topic_name, BufferSequence contents, publish_options pubopts={}, any life_keeper={}, async_handler_t func={}) |
Publish with a manual set packet identifier. More... | |
template<typename BufferSequence > | |
std::enable_if< is_buffer_sequence< BufferSequence >::value >::type | async_publish (packet_id_t packet_id, buffer topic_name, BufferSequence contents, publish_options pubopts, v5::properties props, any life_keeper={}, async_handler_t func={}) |
Publish with a manual set packet identifier. More... | |
void | async_subscribe (packet_id_t packet_id, std::string topic_filter, subscribe_options option, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::string topic_filter, subscribe_options option, v5::properties props, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, as::const_buffer topic_filter, subscribe_options option, async_handler_t func) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, as::const_buffer topic_filter, subscribe_options option, v5::properties props, async_handler_t func) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, buffer topic_filter, subscribe_options option, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, buffer topic_filter, subscribe_options option, v5::properties props, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::vector< std::tuple< std::string, subscribe_options >> params, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::vector< std::tuple< std::string, subscribe_options >> params, v5::properties props, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::vector< std::tuple< as::const_buffer, subscribe_options >> params, async_handler_t func) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::vector< std::tuple< as::const_buffer, subscribe_options >> params, v5::properties props, async_handler_t func) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::vector< std::tuple< buffer, subscribe_options >> params, async_handler_t func={}) |
Subscribe. More... | |
void | async_subscribe (packet_id_t packet_id, std::vector< std::tuple< buffer, subscribe_options >> params, v5::properties props, async_handler_t func={}) |
Subscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::string topic_filter, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, as::const_buffer topic_filter, async_handler_t func) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, buffer topic_filter, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, buffer topic_filter, v5::properties props, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::vector< std::string > params, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::vector< std::string > params, v5::properties props, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::vector< as::const_buffer > params, async_handler_t func) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::vector< as::const_buffer > params, v5::properties props, async_handler_t func) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::vector< buffer > params, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_unsubscribe (packet_id_t packet_id, std::vector< buffer > params, v5::properties props, async_handler_t func={}) |
Unsubscribe. More... | |
void | async_pingreq (async_handler_t func={}) |
Send pingreq packet. More... | |
void | async_pingresp (async_handler_t func={}) |
Send pingresp packet. This function is for broker. More... | |
void | async_auth (v5::auth_reason_code reason_code=v5::auth_reason_code::success, v5::properties props={}, async_handler_t func={}) |
Send auth packet. More... | |
void | async_connect (buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > w, std::uint16_t keep_alive_sec, async_handler_t func={}) |
Send connect packet. More... | |
void | async_connect (buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > w, std::uint16_t keep_alive_sec, v5::properties props, async_handler_t func={}) |
Send connect packet. More... | |
void | async_connack (bool session_present, variant< connect_return_code, v5::connect_reason_code > reason_code, async_handler_t func={}) |
Send connack packet. This function is for broker. More... | |
void | async_connack (bool session_present, variant< connect_return_code, v5::connect_reason_code > reason_code, v5::properties props, async_handler_t func={}) |
Send connack packet. This function is for broker. More... | |
void | async_puback (packet_id_t packet_id, async_handler_t func={}) |
Send puback packet. More... | |
void | async_puback (packet_id_t packet_id, v5::puback_reason_code reason_code, v5::properties props, async_handler_t func={}) |
Send puback packet. More... | |
void | async_pubrec (packet_id_t packet_id, async_handler_t func={}) |
Send pubrec packet. More... | |
void | async_pubrec (packet_id_t packet_id, v5::pubrec_reason_code reason_code, v5::properties props, async_handler_t func={}) |
Send pubrec packet. More... | |
void | async_pubrel (packet_id_t packet_id, async_handler_t func={}) |
Send pubrel packet. More... | |
void | async_pubrel (packet_id_t packet_id, v5::pubrel_reason_code reason_code, v5::properties props={}, any life_keeper={}, async_handler_t func={}) |
Send pubrel packet. More... | |
void | async_pubcomp (packet_id_t packet_id, async_handler_t func={}) |
Send pubcomp packet. More... | |
void | async_pubcomp (packet_id_t packet_id, v5::pubcomp_reason_code reason_code, v5::properties props, async_handler_t func={}) |
Send pubcomp packet. More... | |
void | async_suback (packet_id_t packet_id, variant< suback_return_code, v5::suback_reason_code > reason, async_handler_t func={}) |
Send suback packet. This function is for broker. More... | |
void | async_suback (packet_id_t packet_id, variant< suback_return_code, v5::suback_reason_code > reason, v5::properties props, async_handler_t func={}) |
Send suback packet. This function is for broker. More... | |
void | async_suback (packet_id_t packet_id, variant< std::vector< suback_return_code >, std::vector< v5::suback_reason_code >> reasons, async_handler_t func={}) |
Send suback packet. This function is for broker. More... | |
void | async_suback (packet_id_t packet_id, variant< std::vector< suback_return_code >, std::vector< v5::suback_reason_code >> reasons, v5::properties props, async_handler_t func={}) |
Send suback packet. This function is for broker. More... | |
void | async_unsuback (packet_id_t packet_id, v5::unsuback_reason_code reason, async_handler_t func={}) |
Send unsuback packet. This function is for broker. More... | |
void | async_unsuback (packet_id_t packet_id, v5::unsuback_reason_code reason, v5::properties props, async_handler_t func={}) |
Send unsuback packet. This function is for broker. More... | |
void | async_unsuback (packet_id_t packet_id, std::vector< v5::unsuback_reason_code > reasons, async_handler_t func={}) |
Send unsuback packet. This function is for broker. More... | |
void | async_unsuback (packet_id_t packet_id, std::vector< v5::unsuback_reason_code > reasons, v5::properties props, async_handler_t func={}) |
Send unsuback packet. This function is for broker. More... | |
void | async_unsuback (packet_id_t packet_id, async_handler_t func={}) |
Send ununsuback packet. This function is for broker. More... | |
void | clear_stored_publish (packet_id_t packet_id) |
Clear stored publish message that has packet_id. More... | |
void | for_each_store (std::function< void(char const *, std::size_t)> const &f) |
Apply f to stored messages. More... | |
void | for_each_store (std::function< void(basic_store_message_variant< PacketIdBytes >)> const &f) |
Apply f to stored messages. More... | |
void | for_each_store_with_life_keeper (std::function< void(basic_store_message_variant< PacketIdBytes >, any)> const &f) |
Apply f to stored messages. More... | |
packet_id_t | acquire_unique_packet_id () |
Acquire the new unique packet id. If all packet ids are already in use, then throw packet_id_exhausted_error exception. After acquiring the packet id, you can call acquired_* functions. The ownership of packet id is moved to the library. Or you can call release_packet_id to release it. More... | |
optional< packet_id_t > | acquire_unique_packet_id_no_except () |
Acquire the new unique packet id. If all packet ids are already in use, then returns nullopt After acquiring the packet id, you can call acquired_* functions. The ownership of packet id is moved to the library. Or you can call release_packet_id to release it. More... | |
bool | register_packet_id (packet_id_t packet_id) |
Register packet_id to the library. After registering the packet_id, you can call acquired_* functions. The ownership of packet id is moved to the library. Or you can call release_packet_id to release it. More... | |
void | release_packet_id (packet_id_t packet_id) |
Release packet_id. More... | |
template<typename Iterator > | |
std::enable_if_t< std::is_convertible< typename Iterator::value_type, char >::value > | restore_serialized_message (Iterator b, Iterator e) |
Restore serialized publish and pubrel messages. This function should be called before connect. More... | |
void | restore_serialized_message (basic_publish_message< PacketIdBytes > msg, any life_keeper={}) |
Restore serialized publish message. This function should be called before connect. More... | |
void | restore_serialized_message (basic_pubrel_message< PacketIdBytes > msg, any life_keeper={}) |
Restore serialized pubrel message. This function should be called before connect. More... | |
template<typename Iterator > | |
std::enable_if_t< std::is_convertible< typename Iterator::value_type, char >::value > | restore_v5_serialized_message (Iterator b, Iterator e) |
Restore serialized publish and pubrel messages. This function shouold be called before connect. More... | |
void | restore_v5_serialized_message (v5::basic_publish_message< PacketIdBytes > msg, any life_keeper={}) |
Restore serialized publish message. This function shouold be called before connect. More... | |
void | restore_v5_serialized_message (v5::basic_pubrel_message< PacketIdBytes > msg, any life_keeper={}) |
Restore serialized pubrel message. This function shouold be called before connect. More... | |
void | restore_serialized_message (basic_store_message_variant< PacketIdBytes > msg, any life_keeper={}) |
void | send_store_message (basic_store_message_variant< PacketIdBytes > msg, any life_keeper) |
void | async_send_store_message (basic_store_message_variant< PacketIdBytes > msg, any life_keeper, async_handler_t func) |
bool | connected () const |
Check connection status. More... | |
bool | underlying_connected () const |
Check underlying layer connection status. More... | |
void | async_read_next_message (any session_life_keeper) |
Trigger next mqtt message manually. If you call this function, you need to set manual receive mode using set_auto_next_read(false);. More... | |
void | set_max_queue_send_count (std::size_t count) |
Set maximum number of queued message sending. When async message sending function called during asynchronous processing, the message is enqueued. When current asynchronous message is processed, then concatenate queued messages and send it. This value limits the maximum number of concatenating messages. The default value is 1. More... | |
void | set_max_queue_send_size (std::size_t size) |
Set maximum size of queued message sending. When async message sending function called during asynchronous processing, the message is enqueued. When current asynchronous message is processed, then concatenate queued messages and send it. This value limits the maximum size of concatenating messages. The default value is 0. More... | |
protocol_version | get_protocol_version () const |
MQTT_NS::socket const & | socket () const |
MQTT_NS::socket & | socket () |
auto | get_executor () |
void | set_pingresp_timeout (std::chrono::steady_clock::duration tim) |
Set pingresp timeout. More... | |
Protected Member Functions | |
virtual void | on_close () noexcept=0 |
Close handler. More... | |
virtual void | on_error (error_code ec) noexcept=0 |
Error handler. More... | |
virtual void | on_pre_send () noexcept=0 |
Pre-send handler This handler is called when any mqtt control packet is decided to send. More... | |
virtual MQTT_ALWAYS_INLINE void | on_mqtt_message_processed (any session_life_keeper) |
next read handler This handler is called when the current mqtt message has been processed. More... | |
std::shared_ptr< MQTT_NS::socket > & | socket_sp_ref () |
Get shared_ptr of socket. More... | |
void | async_read_control_packet_type (any session_life_keeper) |
bool | handle_close_or_error (error_code ec) |
void | set_connect () |
void | set_protocol_version (protocol_version version) |
void | clear_session_data () |
~endpoint ()=default | |
Protected Attributes | |
bool | clean_start_ {false} |
Friends | |
struct | process_connect |
struct | process_connack |
struct | process_publish |
struct | process_puback |
struct | process_pubrec |
struct | process_pubrel |
struct | process_pubcomp |
struct | process_subscribe |
struct | process_suback |
struct | process_unsubscribe |
struct | process_unsuback |
struct | process_disconnect |
struct | process_auth |
using MQTT_NS::endpoint< Mutex, LockGuard, PacketIdBytes >::async_handler_t = std::function<void(error_code ec)> |
using MQTT_NS::endpoint< Mutex, LockGuard, PacketIdBytes >::packet_id_t = typename packet_id_type<PacketIdBytes>::type |
|
inline |
Constructor for client.
|
inlineexplicit |
Constructor for server. socket should have already been connected with another endpoint.
|
delete |
|
delete |
|
protecteddefault |
|
inline |
Acquire the new unique packet id. If all packet ids are already in use, then throw packet_id_exhausted_error exception. After acquiring the packet id, you can call acquired_* functions. The ownership of packet id is moved to the library. Or you can call release_packet_id to release it.
|
inline |
Acquire the new unique packet id. If all packet ids are already in use, then returns nullopt After acquiring the packet id, you can call acquired_* functions. The ownership of packet id is moved to the library. Or you can call release_packet_id to release it.
|
inline |
Send auth packet.
reason_code | AUTH Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901220 3.15.2.1 Authenticate Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901221 3.15.2.2 AUTH Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718086 |
|
inline |
Send connack packet. This function is for broker.
session_present | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349255 |
return_code | See connect_return_code.hpp and https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349256 |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718033 |
|
inline |
Send connack packet. This function is for broker.
session_present | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349255 |
return_code | See connect_return_code.hpp and https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349256 |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901080 3.2.2.3 CONNACK Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718033 |
|
inline |
Send connect packet.
client_id | The client id to use for this connection See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901059 3.1.3.1 Client Identifier (ClientID) |
user_name | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901071 3.1.3.5 User Name |
password | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901072 3.1.3.6 Password |
w | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc479576982 3.1.2.5 Will Flag |
keep_alive_sec | Keep Alive See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901045 3.1.2.10 Keep Alive |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718028 |
|
inline |
Send connect packet.
client_id | The client id to use for this connection See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901059 3.1.3.1 Client Identifier (ClientID) |
user_name | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901071 3.1.3.5 User Name |
password | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901072 3.1.3.6 Password |
w | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc479576982 3.1.2.5 Will Flag |
keep_alive_sec | Keep Alive See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901045 3.1.2.10 Keep Alive |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901046 3.1.2.11 CONNECT Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718028 |
|
inline |
Disconnect.
func | functor object who's operator() will be called when the async operation completes. Send a disconnect packet to the connected broker. It is a clean disconnecting sequence. The broker disconnects the endpoint after receives the disconnect packet. When the endpoint disconnects using disconnect(), a will won't send. |
|
inline |
Disconnect.
reason | DISCONNECT Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901208 3.14.2.1 Disconnect Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901209 3.14.2.2 DISCONNECT Properties |
func | functor object who's operator() will be called when the async operation completes. Send a disconnect packet to the connected broker. It is a clean disconnecting sequence. The broker disconnects the endpoint after receives the disconnect packet. When the endpoint disconnects using disconnect(), a will won't send. |
|
inline |
Send pingreq packet.
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901195 |
|
inline |
Send pingresp packet. This function is for broker.
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200 |
|
inline |
Send puback packet.
packet_id | packet id corresponding to publish |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Send puback packet.
packet_id | packet id corresponding to publish |
reason_code | PUBACK Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901124 3.4.2.1 PUBACK Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901125 3.4.2.2 PUBACK Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Send pubcomp packet.
packet_id | packet id corresponding to publish |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Send pubcomp packet.
packet_id | packet id corresponding to publish |
reason_code | PUBCOMP Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901154 3.7.2.1 PUBCOMP Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901155 3.7.2.2 PUBCOMP Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Publish with a manual set packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
func | functor object who's operator() will be called when the async operation completes. |
|
inline |
Publish with a manual set packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
func | functor object who's operator() will be called when the async operation completes. |
|
inline |
Publish with a manual set packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
func | functor object who's operator() will be called when the async operation completes. |
|
inline |
Publish with a manual set packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
func | functor object who's operator() will be called when the async operation completes. |
|
inline |
Publish with a manual set packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
func | functor object who's operator() will be called when the async operation completes. |
|
inline |
Publish with a manual set packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents to publish |
pubopts | qos, retain flag, and dup flag. |
func | functor object who's operator() will be called when the async operation completes. |
|
inline |
Publish.
topic_name | A topic name to publish |
contents | The contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Send pubrec packet.
packet_id | packet id corresponding to publish |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Send pubrec packet.
packet_id | packet id corresponding to publish |
reason_code | PUBREC Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901134 3.5.2.1 PUBREC Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901135 3.5.2.2 PUBREC Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Send pubrel packet.
packet_id | packet id corresponding to publish |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
|
inline |
Send pubrel packet.
packet_id | packet id corresponding to publish |
reason_code | PUBREL Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901144 3.6.2.1 PUBREL Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901145 3.6.2.2 PUBREL Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718043 |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inlineprotected |
|
inline |
Trigger next mqtt message manually. If you call this function, you need to set manual receive mode using set_auto_next_read(false);.
|
inline |
|
inline |
Send suback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | a collection of reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Send suback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | a collection of reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901174 3.9.2.1 SUBACK Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Send suback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Send suback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901174 3.9.2.1 SUBACK Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
func | functor object who's operator() will be called when the async operation completes. This object should hold the lifetime of the buffers for topic_filter. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. This object should hold the lifetime of the buffers for topic_filter, and properties. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the pair of topic_filter and qos to subscribe. |
func | functor object who's operator() will be called when the async operation completes. This object should hold the lifetime of the buffers for params. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the pair of topic_filter and option to subscribe. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
func | functor object who's operator() will be called when the async operation completes. This object should hold the lifetime of the buffers for params. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the pair of topic_filter and qos to subscribe. |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the pair of topic_filter and option to subscribe. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the pair of topic_filter and option to subscribe. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the pair of topic_filter and option to subscribe. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
topic_name | A topic name to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
func | functor object who's operator() will be called when the async operation completes. packet_id is automatically generated. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Send ununsuback packet. This function is for broker.
packet_id | packet id corresponding to unsubscribe |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718077 |
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reasons | a collection of reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reasons | a collection of reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901190 3.11.2.1 UNSUBACK Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901190 3.11.2.1 UNSUBACK Properties |
func | functor object who's operator() will be called when the async operation completes. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718068 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | topic_filter |
func | functor object who's operator() will be called when the async operation completes. This object should hold the lifetime of the buffer for topic_filter. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | topic_filter |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | topic_filter |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | topic_filter |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the topic filter to unsubscribe |
func | functor object who's operator() will be called when the async operation completes. This object may hold the lifetime of the buffers for topic_filter and contents. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the topic filter to unsubscribe |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. This object should hold the lifetime of the buffers for params. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the topic filter to unsubscribe |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the topic filter to unsubscribe |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the topic filter to unsubscribe |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | A collection of the topic filter to unsubscribe |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
func | functor object who's operator() will be called when the async operation completes. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
topic_name | A topic name to unsubscribe |
func | functor object who's operator() will be called when the async operation completes. packet_id is automatically generated. You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Send auth packet. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718086.
reason_code | AUTH Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901220 3.15.2.1 Authenticate Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901221 3.15.2.2 AUTH Properties |
|
inline |
Get clean session.
See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349231
3.1.2.4 Clean Session
After constructing a endpoint, the clean session is set to false.
|
inline |
Get clean start.
See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901039
3.1.2.4 Clean Start
After constructing a endpoint, the clean start is set to false.
|
inlineprotected |
|
inline |
Clear stored publish message that has packet_id.
packet_id | packet id corresponding to stored publish |
|
inline |
Send connack packet. This function is for broker.
session_present | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349255 |
reason_code | See reason_code.hpp and https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349256 |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901080 3.2.2.3 CONNACK Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718033 |
|
inline |
Send connect packet.
|
inline |
Send connect packet.
|
inline |
Check connection status.
|
inline |
Disconnect Send a disconnect packet to the connected broker. It is a clean disconnecting sequence. The broker disconnects the endpoint after receives the disconnect packet.
When the endpoint disconnects using disconnect(), a will won't send.
See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901205
reason_code | DISCONNECT Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901208 3.14.2.1 Disconnect Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901209 3.14.2.2 DISCONNECT Properties |
|
inline |
Apply f to stored messages.
f | applying function. f should be void(store_message_variant) |
|
inline |
Apply f to stored messages.
f | applying function. f should be void(char const*, std::size_t) |
|
inline |
Apply f to stored messages.
f | applying function. f should be void(store_message_variant, any) |
|
inline |
Disconnect by endpoint Force disconnect. It is not a clean disconnect sequence.
When the endpoint disconnects using force_disconnect(), a will will send.
|
inline |
|
inline |
|
inline |
get_total_bytes_received
|
inline |
get_total_bytes_sent
|
inlineprotected |
|
protectedpure virtualnoexcept |
Close handler.
This handler is called if the client called disconnect()
and the server closed the socket cleanly. If the socket is closed by other reasons, error_handler is called.
Implemented in MQTT_NS::server_endpoint< Mutex, LockGuard, PacketIdBytes >, MQTT_NS::client< Socket, PacketIdBytes >, and MQTT_NS::client< Socket, 2 >.
|
protectedpure virtualnoexcept |
Error handler.
This handler is called if the socket is closed without client's disconnect()
call.
ec | error code |
Implemented in MQTT_NS::server_endpoint< Mutex, LockGuard, PacketIdBytes >, MQTT_NS::client< Socket, PacketIdBytes >, and MQTT_NS::client< Socket, 2 >.
|
inlineprotectedvirtual |
next read handler This handler is called when the current mqtt message has been processed.
func | A callback function that is called when async operation will finish. |
|
protectedpure virtualnoexcept |
Pre-send handler This handler is called when any mqtt control packet is decided to send.
Implemented in MQTT_NS::server_endpoint< Mutex, LockGuard, PacketIdBytes >, MQTT_NS::client< Socket, PacketIdBytes >, and MQTT_NS::client< Socket, 2 >.
|
delete |
|
delete |
|
inline |
Send pingreq packet. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901195.
|
inline |
Send pingresp packet. This function is for broker. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200.
|
inline |
Send puback packet.
packet_id | packet id corresponding to publish |
reason_code | PUBACK Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901124 3.4.2.1 PUBACK Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901125 3.4.2.2 PUBACK Properties |
|
inline |
Send pubcomp packet.
packet_id | packet id corresponding to publish |
reason_code | PUBCOMP Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901154 3.7.2.1 PUBCOMP Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901155 3.7.2.2 PUBCOMP Properties |
|
inline |
Publish with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Publish with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Publish with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Publish with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents or the range of the contents to publish |
pubopts | qos, retain flag, and dup flag. |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Publish with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. If qos == qos::at_most_once, packet_id must be 0. But not checked in release mode due to performance. |
topic_name | A topic name to publish |
contents | The contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Publish.
topic_name | A topic name to publish |
contents | The contents to publish |
pubopts | qos, retain flag, and dup flag. |
props | (optional) Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
life_keeper | (optional) An object that stays alive as long as the library holds a reference to any other parameters. If topic_name, contents, or props do not have built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Send packet.
packet_id | packet id corresponding to publish |
reason_code | Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901134 3.5.2.1 Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901135 3.5.2.2 Properties |
|
inline |
Send pubrel packet.
packet_id | packet id corresponding to publish |
reason_code | PUBREL Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901144 3.6.2.1 PUBREL Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901145 3.6.2.2 PUBREL Properties |
life_keeper | An object that stays alive as long as the library holds a reference to any other parameters. If your props are not using built-in lifetime management, (e.g. buffer) use this parameter to manage their lifetime. |
|
inline |
Register packet_id to the library. After registering the packet_id, you can call acquired_* functions. The ownership of packet id is moved to the library. Or you can call release_packet_id to release it.
|
inline |
Release packet_id.
packet_id | packet id to release. only the packet_id gotten by acquire_unique_packet_id, or register_packet_id is permitted. |
|
inline |
Restore serialized publish message. This function should be called before connect.
msg | publish message. |
life_keeper | An object that stays alive (but is moved with force_move()) until the stored message is sent. |
|
inline |
Restore serialized pubrel message. This function should be called before connect.
msg | pubrel message. |
|
inline |
|
inline |
Restore serialized publish and pubrel messages. This function should be called before connect.
b | iterator begin of the message |
e | iterator end of the message |
|
inline |
Restore serialized publish and pubrel messages. This function shouold be called before connect.
b | iterator begin of the message |
e | iterator end of the message Empty topic_name on MQTT v5 publish message is prohibited. |
|
inline |
Restore serialized publish message. This function shouold be called before connect.
msg | publish message. Empty topic_name is prohibited. |
life_keeper | An object that stays alive (but is moved with force_move()) until the stored message is sent. |
|
inline |
Restore serialized pubrel message. This function shouold be called before connect.
msg | pubrel message. |
life_keeper | An object that stays alive (but is moved with force_move()) until the stored message is sent. |
|
inline |
|
inline |
Set topic alias send auto mapping enable flag.
b | set value |
If set true then topic alias is automatically used. topic alias is allocated and reused by LRU algorithm. topic alias that is set manually can be used with this flag.
|
inline |
Set auto publish response mode.
b | set value |
async | auto publish ressponse send asynchronous |
When set auto publish response mode to true, puback, pubrec, pubrel,and pub comp automatically send.
|
inline |
Set topic alias send auto replacing enable flag.
b | set value |
If set true when publish without topic alias and topic alias send map has corresponding entry, then use the alias. topic alias that is set manually can be used with this flag.
|
inlineprotected |
|
inline |
Set maximum number of queued message sending. When async message sending function called during asynchronous processing, the message is enqueued. When current asynchronous message is processed, then concatenate queued messages and send it. This value limits the maximum number of concatenating messages. The default value is 1.
count | maximum number of queued message sending. 0 means infinity. |
|
inline |
Set maximum size of queued message sending. When async message sending function called during asynchronous processing, the message is enqueued. When current asynchronous message is processed, then concatenate queued messages and send it. This value limits the maximum size of concatenating messages. The default value is 0.
size | maximum size of queued message sending. 0 means infinity. |
|
inline |
|
inline |
Set pingresp timeout.
tim | timeout value |
If tim is not zero, when the client sends PINGREQ, set a timer. The timer cancels when PINGRESP is received. If the timer is fired, then force_disconnect from the client side.
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901045
3.1.2.10 Keep Alive
|
inline |
|
inlineprotected |
|
inline |
set topic alias maximum for receiving
max | maximum value |
|
inline |
|
inline |
|
inlineprotected |
Get shared_ptr of socket.
|
inline |
start session with a connected endpoint.
func | finish handler that is called when the session is finished |
|
inline |
Send suback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reasons | a collection of reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901174 3.9.2.1 SUBACK Properties |
|
inline |
Send suback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901174 3.9.2.1 SUBACK Properties |
|
inline |
Subscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | a vector of the subscribe_entry. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | a vector of the topic_filter and qos pair. |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901161 |
|
inline |
Subscribe.
topic_name | A topic name to subscribe |
option | subscription options See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901169 3.8.3.1 Subscription Options |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
|
inline |
Check underlying layer connection status.
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reasons | a collection of reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901190 3.11.2.1 UNSUBACK Properties |
|
inline |
Send unsuback packet. This function is for broker.
packet_id | packet id corresponding to subscribe |
reason | reason_code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901190 3.11.2.1 UNSUBACK Properties |
|
inline |
Unsubscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to unsubscribe |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | a collection of topic_filter |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | a collection of topic_filter |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
params | a collection of topic_filter |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe with already acquired packet identifier.
packet_id | packet identifier. It should be acquired by acquire_unique_packet_id, or register_packet_id. The ownership of the packet_id moves to the library. |
topic_filter | A topic filter to unsubscribe |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties You can subscribe multiple topics all at once. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901179 |
|
inline |
Unsubscribe.
topic_name | A topic name to unsubscribe |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |