An API for using MQTT over multiple transports

Dependencies:   FP MQTTPacket

Dependents:   Cellular_HelloMQTT IoTStarterKit GSwifiInterface_HelloMQTT IBMIoTClientEthernetExample ... more

This library is part of the EclipseTM Paho project; specifically the embedded client.

The goals of this API are:

  1. to be independent of any system library: hence templates parameters for networking, timer and threading classes
  2. not to rely on heap storage, only automatic (I think this is a good thing)
  3. to limit memory use, for instance by defining the size of the buffers and arrays used at object creation time
Committer:
icraggs
Date:
Tue Aug 18 09:57:19 2015 +0000
Revision:
46:e335fcc1a663
Parent:
43:21da1f744243
Latest update from Paho

Who changed what in which revision?

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