Port to C027 (using AppShield and Ethernet)

Dependencies:   C12832 EthernetInterface LM75B MMA7660 MQTT mbed-rtos mbed

Fork of IBMIoTClientEthernetExample by IBM Watson IoT

Committer:
samdanbury
Date:
Wed Aug 20 12:45:14 2014 +0000
Revision:
6:37b6d0d56190
Code completely changed to improve the structure, flow and memory usage of the application

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samdanbury 6:37b6d0d56190 1 #if !defined(MQTT_LOGGING_H)
samdanbury 6:37b6d0d56190 2 #define MQTT_LOGGING_H
samdanbury 6:37b6d0d56190 3
samdanbury 6:37b6d0d56190 4 #define STREAM stdout
samdanbury 6:37b6d0d56190 5 #if !defined(DEBUG)
samdanbury 6:37b6d0d56190 6 #define DEBUG(...) \
samdanbury 6:37b6d0d56190 7 {\
samdanbury 6:37b6d0d56190 8 fprintf(STREAM, "DEBUG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
samdanbury 6:37b6d0d56190 9 fprintf(STREAM, ##__VA_ARGS__); \
samdanbury 6:37b6d0d56190 10 fflush(STREAM); \
samdanbury 6:37b6d0d56190 11 }
samdanbury 6:37b6d0d56190 12 #endif
samdanbury 6:37b6d0d56190 13 #if !defined(LOG)
samdanbury 6:37b6d0d56190 14 #define LOG(...) \
samdanbury 6:37b6d0d56190 15 {\
samdanbury 6:37b6d0d56190 16 fprintf(STREAM, "LOG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
samdanbury 6:37b6d0d56190 17 fprintf(STREAM, ##__VA_ARGS__); \
samdanbury 6:37b6d0d56190 18 fflush(STREAM); \
samdanbury 6:37b6d0d56190 19 }
samdanbury 6:37b6d0d56190 20 #endif
samdanbury 6:37b6d0d56190 21 #if !defined(WARN)
samdanbury 6:37b6d0d56190 22 #define WARN(...) \
samdanbury 6:37b6d0d56190 23 { \
samdanbury 6:37b6d0d56190 24 fprintf(STREAM, "WARN: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
samdanbury 6:37b6d0d56190 25 fprintf(STREAM, ##__VA_ARGS__); \
samdanbury 6:37b6d0d56190 26 fflush(STREAM); \
samdanbury 6:37b6d0d56190 27 }
samdanbury 6:37b6d0d56190 28 #endif
samdanbury 6:37b6d0d56190 29 #if !defined(ERROR)
samdanbury 6:37b6d0d56190 30 #define ERROR(...) \
samdanbury 6:37b6d0d56190 31 { \
samdanbury 6:37b6d0d56190 32 fprintf(STREAM, "ERROR: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
samdanbury 6:37b6d0d56190 33 fprintf(STREAM, ##__VA_ARGS__); \
samdanbury 6:37b6d0d56190 34 fflush(STREAM); \
samdanbury 6:37b6d0d56190 35 exit(1); \
samdanbury 6:37b6d0d56190 36 }
samdanbury 6:37b6d0d56190 37 #endif
samdanbury 6:37b6d0d56190 38
samdanbury 6:37b6d0d56190 39 #endif