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 Samuel Mokrani

Revision:
14:bf42271bde6a
Parent:
13:152b70450615
Child:
15:9df4ffc6ce48
--- a/Websocket.cpp	Thu Mar 31 14:12:33 2016 +0000
+++ b/Websocket.cpp	Thu Mar 31 20:38:54 2016 +0000
@@ -5,16 +5,16 @@
 
 //Debug is disabled by default
 #if 1
-#define DBG(x, ...) std::printf("[WebSocket : DBG]"x"\r\n", ##__VA_ARGS__); 
-#define WARN(x, ...) std::printf("[WebSocket : WARN]"x"\r\n", ##__VA_ARGS__); 
-#define ERR(x, ...) std::printf("[WebSocket : ERR]"x"\r\n", ##__VA_ARGS__); 
+#define DBG(x, ...) pc.printf("[WebSocket : DBG]"x"\r\n", ##__VA_ARGS__); 
+#define WARN(x, ...) pc.printf("[WebSocket : WARN]"x"\r\n", ##__VA_ARGS__); 
+#define ERR(x, ...) pc.printf("[WebSocket : ERR]"x"\r\n", ##__VA_ARGS__); 
 #else
 #define DBG(x, ...) 
 #define WARN(x, ...)
 #define ERR(x, ...) 
 #endif
 
-#define INFO(x, ...) std::printf("[WebSocket : INFO]"x"\r\n", ##__VA_ARGS__); 
+#define INFO(x, ...) pc.printf("[WebSocket : INFO]"x"\r\n", ##__VA_ARGS__); 
 
 Websocket::Websocket(char * url) {
     fillFields(url);