summaryrefslogtreecommitdiff
path: root/nrfdemo/src/mqtt_connection.h
diff options
context:
space:
mode:
authorMichal Hanus <hanus.michal@divelit.cz>2025-04-23 13:43:14 +0200
committerMichal Hanus <hanus.michal@divelit.cz>2025-04-23 13:43:14 +0200
commitd1c04e8b36bc206eb520f7b79183d5c015855252 (patch)
tree469857024814e16b8ed27c52c5b8689358455f33 /nrfdemo/src/mqtt_connection.h
parent851d92974af6cefa00de1379dad8b8076c2dd107 (diff)
parent0dee9f28ef79d54ec06f460b5e1deb10a8efd303 (diff)
Merge remote-tracking branch 'refs/remotes/xyz/master'
Diffstat (limited to 'nrfdemo/src/mqtt_connection.h')
-rw-r--r--nrfdemo/src/mqtt_connection.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/nrfdemo/src/mqtt_connection.h b/nrfdemo/src/mqtt_connection.h
new file mode 100644
index 0000000..51765e8
--- /dev/null
+++ b/nrfdemo/src/mqtt_connection.h
@@ -0,0 +1,21 @@
+#ifndef _MQTTCONNECTION_H_
+#define _MQTTCONNECTION_H_
+#define LED_CONTROL_OVER_MQTT DK_LED1 /* Stratus LED to control over MQTT */
+#define IMEI_LEN 15
+#define CGSN_RESPONSE_LENGTH (IMEI_LEN + 6 + 1) /* Add 6 for \r\nOK\r\n and 1 for \0 */
+#define CLIENT_ID_LEN sizeof("nrf-") + IMEI_LEN
+
+/**@brief Initialize the MQTT client structure
+ */
+int client_init(struct mqtt_client *client);
+
+/**@brief Initialize the file descriptor structure used by poll.
+ */
+int fds_init(struct mqtt_client *c, struct pollfd *fds);
+
+/**@brief Function to publish data on the configured topic
+ */
+int data_publish(struct mqtt_client *c, enum mqtt_qos qos,
+ uint8_t *data, size_t len);
+
+#endif /* _CONNECTION_H_ */