40 virtual void set_keep_alive(uint16_t keep_alive) = 0;
41 virtual void set_client_id(
const char *client_id) = 0;
42 virtual void set_clean_session(
bool clean_session) = 0;
43 virtual void set_credentials(
const char *username,
const char *password) = 0;
44 virtual void set_will(
const char *topic, uint8_t qos,
bool retain,
const char *payload) = 0;
46 virtual void set_server(
const char *host, uint16_t port) = 0;
47 virtual void set_on_connect(std::function<on_connect_callback_t> &&callback) = 0;
48 virtual void set_on_disconnect(std::function<on_disconnect_callback_t> &&callback) = 0;
49 virtual void set_on_subscribe(std::function<on_subscribe_callback_t> &&callback) = 0;
50 virtual void set_on_unsubscribe(std::function<on_unsubscribe_callback_t> &&callback) = 0;
51 virtual void set_on_message(std::function<on_message_callback_t> &&callback) = 0;
52 virtual void set_on_publish(std::function<on_publish_user_callback_t> &&callback) = 0;
53 virtual bool connected()
const = 0;
54 virtual void connect() = 0;
55 virtual void disconnect() = 0;
56 virtual bool subscribe(
const char *topic, uint8_t qos) = 0;
57 virtual bool unsubscribe(
const char *topic) = 0;
58 virtual bool publish(
const char *topic,
const char *payload,
size_t length, uint8_t qos,
bool retain) = 0;
internal struct for MQTT messages.
void(uint16_t packet_id) on_unsubscribe_callback_t
void(const char *topic, const char *payload, size_t len, size_t index, size_t total) on_message_callback_t
void(MQTTClientDisconnectReason reason) on_disconnect_callback_t
void(uint16_t packet_id) on_publish_user_callback_t
void(bool session_present) on_connect_callback_t
MQTTClientDisconnectReason
void(uint16_t packet_id, uint8_t qos) on_subscribe_callback_t
Implementation of SPI Controller mode.
virtual bool publish(const MQTTMessage &message)
uint8_t qos
QoS. Only for last will testaments.