1
0
mirror of https://github.com/adafruit/Adafruit_MQTT_Library.git synced 2025-07-21 18:22:06 +03:00

settable keepalive interval

This commit is contained in:
brentru
2021-05-18 16:41:26 -04:00
parent ea2fb46de3
commit a1e64c039e
3 changed files with 31 additions and 4 deletions

View File

@ -184,6 +184,9 @@ public:
bool will(const char *topic, const char *payload, uint8_t qos = 0,
uint8_t retain = 0);
// Sets the KeepAlive Interval, in seconds.
bool setKeepAliveInterval(uint16_t keepAlive);
// Publish a message to a topic using the specified QoS level. Returns true
// if the message was published, false otherwise.
bool publish(const char *topic, const char *payload, uint8_t qos = 0);
@ -250,6 +253,7 @@ protected:
const char *will_payload;
uint8_t will_qos;
uint8_t will_retain;
uint16_t keepAliveInterval; // MQTT KeepAlive time interval, in seconds
uint8_t buffer[MAXBUFFERSIZE]; // one buffer, used for all incoming/outgoing
uint16_t packet_id_counter;