summaryrefslogtreecommitdiff
path: root/src/mqtt.c
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2024-10-29 23:30:39 +0100
committerThomas Schmucker <ts@its1.de>2024-10-29 23:30:39 +0100
commit0984a86f9243a8147b8f02882af6380ee5bff22e (patch)
treeb6923aca9d5728ea27be6913cc1295754ca22857 /src/mqtt.c
parent868d0a1ecbfbcd1f04b5c03403d6cffb439ce8fe (diff)
downloaduse-mosquitto-0984a86f9243a8147b8f02882af6380ee5bff22e.tar.gz
use-mosquitto-0984a86f9243a8147b8f02882af6380ee5bff22e.tar.bz2
use-mosquitto-0984a86f9243a8147b8f02882af6380ee5bff22e.zip
Bessere Namensgebung für Funktionen
Diffstat (limited to 'src/mqtt.c')
-rw-r--r--src/mqtt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mqtt.c b/src/mqtt.c
index 50cfa6a..ce89b0b 100644
--- a/src/mqtt.c
+++ b/src/mqtt.c
@@ -9,13 +9,13 @@
9#include "mqtt.h" 9#include "mqtt.h"
10 10
11struct mosquitto * 11struct mosquitto *
12connect(const char *clientid, // NOLINT 12mqtt_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
45void 45void
46run(struct mosquitto *client, const char *topics[], const volatile bool *quit) 46mqtt_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
64void 64void
65shutdown(struct mosquitto *client) 65mqtt_shutdown(struct mosquitto *client)
66{ 66{
67 mosquitto_disconnect(client); 67 mosquitto_disconnect(client);
68 mosquitto_destroy(client); 68 mosquitto_destroy(client);