Simple websocket client based on the original with a few added features such as: - setBaud() - set the baud rate for the communication - Initialize() - mimics the constructor - chaged read() to readmsg() to avoid confusion with other functions
Dependents: IoT_Ex BatteryModelTester BatteryModelTester
Fork of WebSocketClient by
Diff: Websocket.cpp
- Revision:
- 20:ae675d49fa7f
- Parent:
- 19:aa3d163e457e
- Child:
- 21:420b83755885
--- a/Websocket.cpp Wed May 04 22:08:35 2016 +0000 +++ b/Websocket.cpp Tue Jun 28 16:22:40 2016 +0000 @@ -4,15 +4,25 @@ #define MAX_TRY_READ 10 // #define DEBUG +#define WARNMESSAGES +#define ERRMESSAGES #define INFOMESSAGES -//Debug is disabled by default + #ifdef DEBUG -#define DBG(x, ...) pc.printf("[WebSocket : DBG] "x"\r\n", ##__VA_ARGS__); +#define DBG(x, ...) pc.printf("[WebSocket : DBG] "x"\r\n", ##__VA_ARGS__); +#else +#define DBG(x, ...) +#endif + +#ifdef WARNMESSAGES #define WARN(x, ...) pc.printf("[WebSocket : WARN] "x"\r\n", ##__VA_ARGS__); +#else +#define WARN(x, ...) +#endif + +#ifdef ERRMESSAGES #define ERR(x, ...) pc.printf("[WebSocket : ERR] "x"\r\n", ##__VA_ARGS__); #else -#define DBG(x, ...) -#define WARN(x, ...) #define ERR(x, ...) #endif