summaryrefslogtreecommitdiff
path: root/include/mqtt.h
blob: fecb8841d71bdabc8d4f2ccc496ba569706e98e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

// mosquitto
#include <mosquitto.h>

struct mosquitto *mqtt_connect(const char *clientid, // NOLINT
                               const char *username, // NOLINT
                               const char *password, // NOLINT
                               const char *hostname, // NOLINT
                               int         port,
                               void       *userdata);

void mqtt_handle_messages(struct mosquitto    *client,
                          const char          *topics[],
                          void                 callback(struct mosquitto *, void *, const struct mosquitto_message *),
                          const volatile bool *quit);

void mqtt_shutdown(struct mosquitto *client);