IoT Example
Dependencies: C12832 LM75B MMA7660 MQTT mbed-rtos mbed
Fork of IBMIoTClientEthernetExample by
Diff: main.cpp
- Revision:
- 9:44c5e1716e64
- Parent:
- 8:7bf351c1b125
- Child:
- 10:6b9104576512
--- a/main.cpp Mon Sep 29 11:43:52 2014 +0000 +++ b/main.cpp Tue Sep 30 15:52:18 2014 +0000 @@ -25,18 +25,10 @@ #include "rtos.h" // Configuration values needed to connect to IBM IoT Cloud -#define QUICKSTARTMODE 1 -#if (QUICKSTARTMODE) -#define ORG "quickstart" -#define ID "" -#define AUTH_TOKEN "" -#define TYPE DEFAULT_TYPE_NAME -#else -#define ORG "Replace with your org" -#define ID "Replace with your id" -#define TYPE "Replace with your type" -#define AUTH_TOKEN "Replace with your auth-token" -#endif +#define ORG "quickstart" // For a registered connection, replace with your org +#define ID "" // For a registered connection, replace with your id +#define AUTH_TOKEN "" // For a registered connection, replace with your auth-token +#define TYPE DEFAULT_TYPE_NAME // For a registered connection, replace with your type #define MQTT_PORT 1883 #define MQTT_TLS_PORT 8883 @@ -52,7 +44,7 @@ #include "K64F.h" #endif -bool quickstartMode = (QUICKSTARTMODE) ? true : false; +bool quickstartMode = true; char org[11] = ORG; char type[30] = TYPE; char id[30] = ID; // mac without colons @@ -352,6 +344,8 @@ int main() { + quickstartMode = (strcmp(org, "quickstart") == 0); + lcd.set_font((unsigned char*) Arial12x12); // Set a nice font for the LCD screen led2 = LED2_OFF; // K64F: turn off the main board LED