From 7735ded57fbb5834efc2f6185fb668ec70923e7f Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 11 Jul 2026 13:59:01 +0200 Subject: zwei Topics, überflüssige Variable entfernt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/publish.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/publish.c') diff --git a/src/publish.c b/src/publish.c index 28a9c3a..542e5e9 100644 --- a/src/publish.c +++ b/src/publish.c @@ -18,12 +18,6 @@ # define MAX_COMMAND_LENGTH 100 #endif -static bool -streq(const char *lhs, const char *rhs) -{ - return strcmp(lhs, rhs) == 0; -} - static void application_cleanup(void) { @@ -37,6 +31,12 @@ application_init(void) (void) atexit(application_cleanup); } +static bool +streq(const char *lhs, const char *rhs) +{ + return strcmp(lhs, rhs) == 0; +} + static void application_run(struct mosquitto *client) { @@ -61,12 +61,11 @@ application_run(struct mosquitto *client) } else if ( streq(command, "send") ) { static const char payload[] = "ich bin ein payload"; - static const char topic[] = "testtopic"; int err = mosquitto_publish( client, NULL, - topic, + TOPIC, sizeof payload, payload, 0, -- cgit v1.3