7 #include <AsyncMqttClient.h> 20 void set_will(
const char *topic, uint8_t qos,
bool retain,
const char *payload)
final {
25 #if ASYNC_TCP_SSL_ENABLED 26 void set_secure(
bool secure) { mqtt_client.setSecure(secure); }
34 auto async_callback = [callback](AsyncMqttClientDisconnectReason reason) {
36 callback(static_cast<MQTTClientDisconnectReason>(reason));
38 this->
mqtt_client_.onDisconnect(std::move(async_callback));
47 auto async_callback = [callback](
const char *topic,
const char *payload,
48 AsyncMqttClientMessageProperties async_properties,
size_t len,
size_t index,
49 size_t total) { callback(topic, payload, len, index, total); };
52 void set_on_publish(std::function<on_publish_user_callback_t> &&callback)
final {
61 bool publish(
const char *topic,
const char *payload,
size_t length, uint8_t qos,
bool retain)
final {
73 #endif // defined(USE_LIBRETINY) void set_on_connect(std::function< on_connect_callback_t > &&callback) final
void set_server(network::IPAddress ip, uint16_t port) final
bool unsubscribe(const char *topic) final
void set_will(const char *topic, uint8_t qos, bool retain, const char *payload) final
AsyncMqttClient mqtt_client_
void set_secure(bool secure)
void set_keep_alive(uint16_t keep_alive) final
bool connected() const final
void set_on_subscribe(std::function< on_subscribe_callback_t > &&callback) final
void set_on_publish(std::function< on_publish_user_callback_t > &&callback) final
void set_server(const char *host, uint16_t port) final
void set_on_disconnect(std::function< on_disconnect_callback_t > &&callback) final
bool subscribe(const char *topic, uint8_t qos) final
void set_clean_session(bool clean_session) final
void set_client_id(const char *client_id) final
void set_on_message(std::function< on_message_callback_t > &&callback) final
Implementation of SPI Controller mode.
void set_on_unsubscribe(std::function< on_unsubscribe_callback_t > &&callback) final
void add_server_fingerprint(const uint8_t *fingerprint)
void set_credentials(const char *username, const char *password) final
virtual bool publish(const char *topic, const char *payload, size_t length, uint8_t qos, bool retain)=0
bool publish(const char *topic, const char *payload, size_t length, uint8_t qos, bool retain) final