diff options
Diffstat (limited to 'samples/net/mqtt_publisher/src/main.c')
-rw-r--r-- | samples/net/mqtt_publisher/src/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/samples/net/mqtt_publisher/src/main.c b/samples/net/mqtt_publisher/src/main.c index ce7289bb2..3b485b5bf 100644 --- a/samples/net/mqtt_publisher/src/main.c +++ b/samples/net/mqtt_publisher/src/main.c @@ -22,6 +22,8 @@ #include "config.h" +#define CLIENTID "zephyr_publisher" + /** * @brief mqtt_client_ctx Container of some structures used by the * publisher app. @@ -272,7 +274,8 @@ void publisher(void) * will be set to 0 also. Please don't do that, set always to 1. * Clean session = 0 is not yet supported. */ - client_ctx.connect_msg.client_id = "zephyr_publisher"; + client_ctx.connect_msg.client_id = CLIENTID; + client_ctx.connect_msg.client_id_len = strlen(CLIENTID); client_ctx.connect_msg.clean_session = 1; client_ctx.connect_data = "CONNECTED"; |