summaryrefslogtreecommitdiffstats
path: root/aclk/mqtt.h
diff options
context:
space:
mode:
authorTimotej Šiškovič <6674623+underhood@users.noreply.github.com>2020-02-14 10:54:26 +0100
committerGitHub <noreply@github.com>2020-02-14 10:54:26 +0100
commitf4e1012f5ffe1231c25e22f7350d2928b443c69f (patch)
tree1df86a02ed77533854e08d3dc78b389e93a225c5 /aclk/mqtt.h
parentffbfdc44043e5920ee40fc9f2d9b17f8df518cbc (diff)
initial MQTT over Secure Websockets support for ACLK (#7988)
* add aclk_lws_wss_client * shorten the thread name in case more threads are necessary * Draft libmosquitto<->libwebsockets integration * use ringbuffer for recvd data * Some code cleanup * if mqtt connection fails close lws connection and reconect * clear buffers on connection closed * work on better loop integration * move mosquitto read out of loop * remove useless code when using websockets * LWS - make host and port configurable * make default port 9002 as we use MQTT over WSS now * wait for link up before subscribing start query thread after connection has been made * cleanup - remove useless var * if there is anything to write send it immediatelly * cleanup: move buffers into engine instace * allow MQTT IO from multiple threads (although preffered is MQTT IO to be done by single thread) * add warning to future self * add some comments for whoever reviews * add destroy fnc - start work on cleanup * minor - add mosquitto to .gitignore * fix codacy errors * do not reconnect automatically by default * minor - remove outdated comment * tab -> spaces Co-Authored-By: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com> * address thiagoftsm valid comments * add usefull logs in case of trouble * fix -Wall -Wextra -Wformat-signedness warnings * log error when connection fails * update .gitignore to match new installer * Fwd LWS logs to Netdata logs * minor - tabulation fixes * fix comments from thiago * force SSL * move UNUSED to libnetdata.h @thiago correctly pointed out it might be usefull for others * minor - rename function for clarity * minor - remove commented out code Co-authored-by: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com>
Diffstat (limited to 'aclk/mqtt.h')
-rw-r--r--aclk/mqtt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/aclk/mqtt.h b/aclk/mqtt.h
index 4ba3a30d90..fd51c2af70 100644
--- a/aclk/mqtt.h
+++ b/aclk/mqtt.h
@@ -15,7 +15,9 @@ int _link_subscribe(char *topic, int qos);
int _link_send_message(char *topic, char *message);
const char *_link_strerror(int rc);
-extern int aclk_connection_initialized;
int aclk_handle_cloud_request(char *);
+extern int aclk_connection_initialized;
+extern int aclk_mqtt_connected;
+
#endif //NETDATA_MQTT_H