Skip to content
Snippets Groups Projects
Commit 6d4cddee authored by George Oikonomou's avatar George Oikonomou
Browse files

Make the MQTT client example a little more configurable and verbose

Suitable for native run testing
parent 543ab203
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,11 @@
#include <strings.h>
/*---------------------------------------------------------------------------*/
#define LOG_MODULE "mqtt-client"
#ifdef MQTT_CLIENT_CONF_LOG_LEVEL
#define LOG_LEVEL MQTT_CLIENT_CONF_LOG_LEVEL
#else
#define LOG_LEVEL LOG_LEVEL_NONE
#endif
/*---------------------------------------------------------------------------*/
/* Controls whether the example will work in IBM Watson IoT platform mode */
#ifdef MQTT_CLIENT_CONF_WITH_IBM_WATSON
......@@ -305,6 +309,7 @@ pub_handler(const char *topic, uint16_t topic_len, const uint8_t *chunk,
}
if(strncmp(&topic[10], "leds", 4) == 0) {
LOG_DBG("Received MQTT SUB\n");
if(chunk[0] == '1') {
leds_on(LEDS_RED);
} else if(chunk[0] == '0') {
......
......@@ -52,7 +52,9 @@
* devices, set your Org ID here and then make sure you set the correct token
* through MQTT_CLIENT_CONF_AUTH_TOKEN.
*/
#ifndef MQTT_CLIENT_CONF_ORG_ID
#define MQTT_CLIENT_CONF_ORG_ID "quickstart"
#endif
/*
* The MQTT username.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment