Skip to content
Snippets Groups Projects
Commit 7e7b264d authored by Zbigniew Bodek's avatar Zbigniew Bodek
Browse files

main: Remove BLUEMIX topic


IBM Bluemix Watson topic format can be removed
to clean up a code a bit for the future.

Signed-off-by: default avatarZbigniew Bodek <zbigniew.bodek@huawei.com>
parent 1d49a5e0
No related branches found
No related tags found
No related merge requests found
...@@ -40,15 +40,4 @@ ...@@ -40,15 +40,4 @@
#define MQTT_CLIENTID "zephyr_publisher" #define MQTT_CLIENTID "zephyr_publisher"
/* Set the following to 1 to enable the Bluemix topic format */
#define APP_BLUEMIX_TOPIC 0
/* These are the parameters for the Bluemix topic format */
#if APP_BLUEMIX_TOPIC
#define BLUEMIX_DEVTYPE "sensor"
#define BLUEMIX_DEVID "carbon"
#define BLUEMIX_EVENT "status"
#define BLUEMIX_FORMAT "json"
#endif
#endif #endif
...@@ -241,28 +241,16 @@ void mqtt_evt_handler(struct mqtt_client *const client, ...@@ -241,28 +241,16 @@ void mqtt_evt_handler(struct mqtt_client *const client,
static char *get_mqtt_payload(enum mqtt_qos qos) static char *get_mqtt_payload(enum mqtt_qos qos)
{ {
#if APP_BLUEMIX_TOPIC
static char payload[30];
snprintk(payload, sizeof(payload), "{d:{temperature:%d}}",
(uint8_t)sys_rand32_get());
#else
static char payload[] = "DOORS:OPEN_QoSx"; static char payload[] = "DOORS:OPEN_QoSx";
payload[strlen(payload) - 1] = '0' + qos; payload[strlen(payload) - 1] = '0' + qos;
#endif
return payload; return payload;
} }
static char *get_mqtt_topic(void) static char *get_mqtt_topic(void)
{ {
#if APP_BLUEMIX_TOPIC
return "iot-2/type/"BLUEMIX_DEVTYPE"/id/"BLUEMIX_DEVID
"/evt/"BLUEMIX_EVENT"/fmt/"BLUEMIX_FORMAT;
#else
return "sensors"; return "sensors";
#endif
} }
static void subscribe(struct mqtt_client *client) static void subscribe(struct mqtt_client *client)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment