From 63f867581631f5a9cb6403fc5e3b524d99438d54 Mon Sep 17 00:00:00 2001 From: Markus Sattler Date: Fri, 29 Jan 2016 13:44:18 +0100 Subject: [PATCH] update README.md --- README.md | 25 +++++++++++++++++-------- library.properties | 4 ++-- src/WebSockets.h | 7 +++++-- src/WebSocketsClient.h | 6 +++++- src/WebSocketsServer.h | 4 ++++ 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index dbe3cb6..887161c 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,16 @@ a WebSocket Server and Client for Arduino based on RFC6455. ##### Supported Hardware ##### - ESP8266 [Arduino for ESP8266](https://github.com/Links2004/Arduino) - - ATmega328 with Ethernet Shield (alpha) - - ATmega328 with enc28j60 (alpha) - - ATmega2560 with Ethernet Shield (alpha) - - ATmega2560 with enc28j60 (alpha) + - ATmega328 with Ethernet Shield (ATmega branch) + - ATmega328 with enc28j60 (ATmega branch) + - ATmega2560 with Ethernet Shield (ATmega branch) + - ATmega2560 with enc28j60 (ATmega branch) + +###### Note: ###### + + version 2.0 is not compatible with AVR/ATmega, check ATmega branch. + + Arduino for AVR not supports std namespace of c++. ### wss / SSL ### supported for: @@ -32,10 +38,13 @@ a WebSocket Server and Client for Arduino based on RFC6455. ### ESP Async TCP ### -this libary can run in Async TCP mode on the ESP8266. -the mode can be aktivated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE define). -the ```ESPAsyncTCP``` libary is required. -Note: in this mode wss / SSL is not posible. +This libary can run in Async TCP mode on the ESP. + +The mode can be aktivated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE define). + +```ESPAsyncTCP``` libary is required. + +Note: in this mode wss / SSL is not possible. ### Issues ### Submit issues to: https://github.com/Links2004/arduinoWebSockets/issues diff --git a/library.properties b/library.properties index 92613b3..9e73afe 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ name=WebSockets -version=1.3 +version=2.0 author=Markus Sattler maintainer=Markus Sattler sentence=WebSockets for Arduino (Server + Client) -paragraph= +paragraph=use 2.0 for ESP and 1.3 for AVR category=Communication url=https://github.com/Links2004/arduinoWebSockets architectures=* diff --git a/src/WebSockets.h b/src/WebSockets.h index 8d4c2db..934c17e 100644 --- a/src/WebSockets.h +++ b/src/WebSockets.h @@ -27,7 +27,7 @@ #include -#define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ ) +//#define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ ) #ifndef DEBUG_WEBSOCKETS #define DEBUG_WEBSOCKETS(...) @@ -182,8 +182,11 @@ typedef struct { class WebSockets { protected: - +#ifdef __AVR__ + typedef void (*WSreadWaitCb)(WSclient_t * client, bool ok); +#else typedef std::function WSreadWaitCb; +#endif virtual void clientDisconnect(WSclient_t * client); virtual bool clientIsConnected(WSclient_t * client); diff --git a/src/WebSocketsClient.h b/src/WebSocketsClient.h index 478aa11..702ebd6 100644 --- a/src/WebSocketsClient.h +++ b/src/WebSocketsClient.h @@ -30,8 +30,12 @@ class WebSocketsClient: private WebSockets { public: - +#ifdef __AVR__ + typedef void (*WebSocketClientEvent)(WStype_t type, uint8_t * payload, size_t length); +#else typedef std::function WebSocketClientEvent; +#endif + WebSocketsClient(void); ~WebSocketsClient(void); diff --git a/src/WebSocketsServer.h b/src/WebSocketsServer.h index 3b25373..bd02038 100644 --- a/src/WebSocketsServer.h +++ b/src/WebSocketsServer.h @@ -36,7 +36,11 @@ class WebSocketsServer: private WebSockets { public: +#ifdef __AVR__ + typedef void (*WebSocketServerEvent)(uint8_t num, WStype_t type, uint8_t * payload, size_t length); +#else typedef std::function WebSocketServerEvent; +#endif WebSocketsServer(uint16_t port, String origin = "", String protocol = "arduino"); ~WebSocketsServer(void);