aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/mqtt.h
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-01-09 11:36:09 +0100
committercbdev <cb@cbcdn.com>2021-01-09 11:36:09 +0100
commitcbef6a61a92453afba5005c287873001354f5090 (patch)
treea99607e7cb7beb5d99d2ea25561fdf7fe69ba2dd /backends/mqtt.h
parent0175c84ad866e8f33a90d571e6207c6cc120075c (diff)
downloadmidimonster-cbef6a61a92453afba5005c287873001354f5090.tar.gz
midimonster-cbef6a61a92453afba5005c287873001354f5090.tar.bz2
midimonster-cbef6a61a92453afba5005c287873001354f5090.zip
Implement keepalive and protocol fallback
Diffstat (limited to 'backends/mqtt.h')
-rw-r--r--backends/mqtt.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/backends/mqtt.h b/backends/mqtt.h
index df63319..a0f5356 100644
--- a/backends/mqtt.h
+++ b/backends/mqtt.h
@@ -14,7 +14,7 @@ static int mqtt_shutdown(size_t n, instance** inst);
#define MQTT_TLS_PORT "8883"
#define MQTT_BUFFER_LENGTH 8192
#define MQTT_KEEPALIVE 10
-#define MQTT_VERSION 0x05
+#define MQTT_VERSION_DEFAULT 0x05
enum {
MSG_RESERVED = 0x00,
@@ -39,6 +39,7 @@ typedef struct /*_mqtt_instance_data*/ {
uint8_t tls;
char* host;
char* port;
+ uint8_t mqtt_version;
char* user;
char* password;
@@ -50,6 +51,8 @@ typedef struct /*_mqtt_instance_data*/ {
int fd;
uint8_t receive_buffer[MQTT_BUFFER_LENGTH];
size_t receive_offset;
+
+ uint64_t last_control;
} mqtt_instance_data;
//per-channel