#include <mqtt_client.hpp>
|
| mqtt_client (const std::string &hostname, const uint32_t port, const std::string &client_id, const std::string &cafile, const std::string &certfile, const std::string &keyfile, std::function< int(const int, void *)> event_sender, std::function< void(const int, const unsigned long)> delayed_event_sender, std::function< int(const int, void *)> event_counter) |
|
sl_status_t | setup () |
|
sl_status_t | teardown () |
|
int | file_descriptor () |
|
void | poll () |
|
void | disconnect () |
|
void | event (const int incoming_event) |
|
void | publish (const std::string &topic, const std::string &message, size_t message_length, bool retain) |
|
void | unretain (const std::string &prefix_pattern) |
| Un-retain previously retained messages. More...
|
|
void | unretain_by_regex (const std::string ®ex) |
| Un-retain previously retained messages. More...
|
|
int | count_topics (const std::string &prefix_pattern) |
| Count the number of topics published. More...
|
|
void | subscribe (const std::string &topic, const callback_info &callback) |
|
void | resubscribe () |
|
void | unsubscribe (const std::string &topic, const callback_info &callback) |
|
void | on_connect_callback_set (mqtt_connection_callback_t) |
|
void | on_disconnect_callback_set (mqtt_connection_callback_t) |
|
void | before_disconnect_callback_set (mqtt_simple_callback_t) |
|
void | after_connect_callback_set (mqtt_simple_callback_t) |
|
void | on_connect (int return_code) |
|
void | on_disconnect (int return_code) |
|
void | on_message (const std::string &topic, const std::string &message, size_t message_length, int message_qos, bool message_retain) |
|
void | after_connect_callback_call () |
|
void | before_disconnect_callback_call () |
|
const char * | get_client_id () const |
|
bool | is_connected_to_broker () const |
|
◆ mqtt_client()
mqtt_client::mqtt_client |
( |
const std::string & |
hostname, |
|
|
const uint32_t |
port, |
|
|
const std::string & |
client_id, |
|
|
const std::string & |
cafile, |
|
|
const std::string & |
certfile, |
|
|
const std::string & |
keyfile, |
|
|
std::function< int(const int, void *)> |
event_sender, |
|
|
std::function< void(const int, const unsigned long)> |
delayed_event_sender, |
|
|
std::function< int(const int, void *)> |
event_counter |
|
) |
| |
◆ after_connect_callback_call()
void mqtt_client::after_connect_callback_call |
( |
| ) |
|
◆ after_connect_callback_set()
◆ before_disconnect_callback_call()
void mqtt_client::before_disconnect_callback_call |
( |
| ) |
|
◆ before_disconnect_callback_set()
◆ connect()
◆ count_topics()
int mqtt_client::count_topics |
( |
const std::string & |
prefix_pattern | ) |
|
Count the number of topics published.
This function counts the number of topics which has been published retained matching a pattern prefix.
- Parameters
-
- Returns
- int
◆ disconnect()
void mqtt_client::disconnect |
( |
| ) |
|
◆ event()
void mqtt_client::event |
( |
const int |
incoming_event | ) |
|
◆ file_descriptor()
int mqtt_client::file_descriptor |
( |
| ) |
|
◆ get_client_id()
const char * mqtt_client::get_client_id |
( |
| ) |
const |
◆ is_connected_to_broker()
bool mqtt_client::is_connected_to_broker |
( |
| ) |
const |
◆ on_connect()
void mqtt_client::on_connect |
( |
int |
return_code | ) |
|
◆ on_connect_callback_set()
◆ on_disconnect()
void mqtt_client::on_disconnect |
( |
int |
return_code | ) |
|
◆ on_disconnect_callback_set()
◆ on_message()
void mqtt_client::on_message |
( |
const std::string & |
topic, |
|
|
const std::string & |
message, |
|
|
size_t |
message_length, |
|
|
int |
message_qos, |
|
|
bool |
message_retain |
|
) |
| |
◆ poll()
void mqtt_client::poll |
( |
| ) |
|
◆ publish()
void mqtt_client::publish |
( |
const std::string & |
topic, |
|
|
const std::string & |
message, |
|
|
size_t |
message_length, |
|
|
bool |
retain |
|
) |
| |
◆ publish_messages_waiting()
bool mqtt_client::publish_messages_waiting |
( |
| ) |
|
|
private |
◆ publish_to_broker()
sl_status_t mqtt_client::publish_to_broker |
( |
bool |
flushing = false | ) |
|
|
private |
◆ resubscribe()
void mqtt_client::resubscribe |
( |
| ) |
|
◆ send_delayed_event()
void mqtt_client::send_delayed_event |
( |
const int |
outgoing_event, |
|
|
std::chrono::milliseconds |
delay_time |
|
) |
| |
|
private |
◆ send_event()
void mqtt_client::send_event |
( |
const int |
outgoing_event, |
|
|
void * |
procdata |
|
) |
| |
|
private |
◆ setup()
◆ subscribe()
void mqtt_client::subscribe |
( |
const std::string & |
topic, |
|
|
const callback_info & |
callback |
|
) |
| |
◆ subscribe_to_topic()
◆ subscription_messages_waiting()
bool mqtt_client::subscription_messages_waiting |
( |
| ) |
|
|
private |
◆ teardown()
◆ transition()
◆ unretain()
void mqtt_client::unretain |
( |
const std::string & |
prefix_pattern | ) |
|
Un-retain previously retained messages.
Any topic which has the prefix will be un-retained
- Parameters
-
◆ unretain_by_regex()
void mqtt_client::unretain_by_regex |
( |
const std::string & |
regex | ) |
|
Un-retain previously retained messages.
Any topic matches the regex pattern
- Parameters
-
◆ unsubscribe()
void mqtt_client::unsubscribe |
( |
const std::string & |
topic, |
|
|
const callback_info & |
callback |
|
) |
| |
◆ unsubscribe_from_topic()
◆ unsubscription_messages_waiting()
bool mqtt_client::unsubscription_messages_waiting |
( |
| ) |
|
|
private |
◆ mqtt_client_fsm_connected
◆ mqtt_client_fsm_connecting
◆ mqtt_client_fsm_disconnected
◆ after_connect_callbacks
◆ before_disconnect_callbacks
◆ connected_to_broker
bool mqtt_client::connected_to_broker = false |
|
private |
◆ current_state
◆ delayed_event_sender
std::function<void(const int, const unsigned long)> mqtt_client::delayed_event_sender |
◆ event_counter
std::function<int(const int, void *)> mqtt_client::event_counter |
◆ event_sender
std::function<int(const int, void *)> mqtt_client::event_sender |
◆ hostname
const std::string mqtt_client::hostname |
|
private |
◆ max_reconnect_backoff
std::chrono::milliseconds mqtt_client::max_reconnect_backoff |
|
private |
◆ mqtt_cafile
std::string mqtt_client::mqtt_cafile |
|
private |
◆ mqtt_certfile
std::string mqtt_client::mqtt_certfile |
|
private |
◆ mqtt_client_id
std::string mqtt_client::mqtt_client_id |
|
private |
◆ mqtt_client_library_instance
void* mqtt_client::mqtt_client_library_instance |
|
private |
◆ mqtt_keyfile
std::string mqtt_client::mqtt_keyfile |
|
private |
◆ next_reconnect_backoff
std::chrono::milliseconds mqtt_client::next_reconnect_backoff |
|
private |
◆ on_connect_callbacks
◆ on_disconnect_callbacks
◆ port
◆ publishing_queue
◆ retained_topics
std::set<std::string> mqtt_client::retained_topics |
|
private |
◆ socket_file_descriptor
int mqtt_client::socket_file_descriptor |
|
private |
◆ subscription_callbacks
std::map<std::string, std::vector<callback_info> > mqtt_client::subscription_callbacks |
|
private |
◆ subscription_queue
std::queue<std::string> mqtt_client::subscription_queue |
|
private |
◆ unsubscription_queue
std::queue<std::string> mqtt_client::unsubscription_queue |
|
private |
The documentation for this struct was generated from the following file: