diff options
Diffstat (limited to 'src/mqtt.c')
| -rw-r--r-- | src/mqtt.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -9,13 +9,13 @@ | |||
| 9 | #include "mqtt.h" | 9 | #include "mqtt.h" |
| 10 | 10 | ||
| 11 | struct mosquitto * | 11 | struct mosquitto * |
| 12 | connect(const char *clientid, // NOLINT | 12 | mqtt_connect(const char *clientid, // NOLINT |
| 13 | const char *username, // NOLINT | 13 | const char *username, // NOLINT |
| 14 | const char *password, // NOLINT | 14 | const char *password, // NOLINT |
| 15 | const char *hostname, // NOLINT | 15 | const char *hostname, // NOLINT |
| 16 | int port, | 16 | int port, |
| 17 | void callback(struct mosquitto *, void *, const struct mosquitto_message *), | 17 | void callback(struct mosquitto *, void *, const struct mosquitto_message *), |
| 18 | void *userdata) | 18 | void *userdata) |
| 19 | { | 19 | { |
| 20 | struct mosquitto *client = mosquitto_new(clientid, true, userdata); | 20 | struct mosquitto *client = mosquitto_new(clientid, true, userdata); |
| 21 | if ( client == NULL ) { | 21 | if ( client == NULL ) { |
| @@ -43,7 +43,7 @@ connect(const char *clientid, // NOLINT | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void | 45 | void |
| 46 | run(struct mosquitto *client, const char *topics[], const volatile bool *quit) | 46 | mqtt_run(struct mosquitto *client, const char *topics[], const volatile bool *quit) |
| 47 | { | 47 | { |
| 48 | for ( size_t idx = 0; topics[idx] != NULL; ++idx ) { | 48 | for ( size_t idx = 0; topics[idx] != NULL; ++idx ) { |
| 49 | mosquitto_subscribe(client, NULL, topics[idx], 0); | 49 | mosquitto_subscribe(client, NULL, topics[idx], 0); |
| @@ -62,7 +62,7 @@ run(struct mosquitto *client, const char *topics[], const volatile bool *quit) | |||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | void | 64 | void |
| 65 | shutdown(struct mosquitto *client) | 65 | mqtt_shutdown(struct mosquitto *client) |
| 66 | { | 66 | { |
| 67 | mosquitto_disconnect(client); | 67 | mosquitto_disconnect(client); |
| 68 | mosquitto_destroy(client); | 68 | mosquitto_destroy(client); |
