mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-16 08:42:06 +02:00
update README.md
This commit is contained in:
25
README.md
25
README.md
@ -21,10 +21,16 @@ a WebSocket Server and Client for Arduino based on RFC6455.
|
|||||||
|
|
||||||
##### Supported Hardware #####
|
##### Supported Hardware #####
|
||||||
- ESP8266 [Arduino for ESP8266](https://github.com/Links2004/Arduino)
|
- ESP8266 [Arduino for ESP8266](https://github.com/Links2004/Arduino)
|
||||||
- ATmega328 with Ethernet Shield (alpha)
|
- ATmega328 with Ethernet Shield (ATmega branch)
|
||||||
- ATmega328 with enc28j60 (alpha)
|
- ATmega328 with enc28j60 (ATmega branch)
|
||||||
- ATmega2560 with Ethernet Shield (alpha)
|
- ATmega2560 with Ethernet Shield (ATmega branch)
|
||||||
- ATmega2560 with enc28j60 (alpha)
|
- 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 ###
|
### wss / SSL ###
|
||||||
supported for:
|
supported for:
|
||||||
@ -32,10 +38,13 @@ a WebSocket Server and Client for Arduino based on RFC6455.
|
|||||||
|
|
||||||
### ESP Async TCP ###
|
### ESP Async TCP ###
|
||||||
|
|
||||||
this libary can run in Async TCP mode on the ESP8266.
|
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).
|
|
||||||
the ```ESPAsyncTCP``` libary is required.
|
The mode can be aktivated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE define).
|
||||||
Note: in this mode wss / SSL is not posible.
|
|
||||||
|
```ESPAsyncTCP``` libary is required.
|
||||||
|
|
||||||
|
Note: in this mode wss / SSL is not possible.
|
||||||
|
|
||||||
### Issues ###
|
### Issues ###
|
||||||
Submit issues to: https://github.com/Links2004/arduinoWebSockets/issues
|
Submit issues to: https://github.com/Links2004/arduinoWebSockets/issues
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
name=WebSockets
|
name=WebSockets
|
||||||
version=1.3
|
version=2.0
|
||||||
author=Markus Sattler
|
author=Markus Sattler
|
||||||
maintainer=Markus Sattler
|
maintainer=Markus Sattler
|
||||||
sentence=WebSockets for Arduino (Server + Client)
|
sentence=WebSockets for Arduino (Server + Client)
|
||||||
paragraph=
|
paragraph=use 2.0 for ESP and 1.3 for AVR
|
||||||
category=Communication
|
category=Communication
|
||||||
url=https://github.com/Links2004/arduinoWebSockets
|
url=https://github.com/Links2004/arduinoWebSockets
|
||||||
architectures=*
|
architectures=*
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ )
|
//#define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ )
|
||||||
|
|
||||||
#ifndef DEBUG_WEBSOCKETS
|
#ifndef DEBUG_WEBSOCKETS
|
||||||
#define DEBUG_WEBSOCKETS(...)
|
#define DEBUG_WEBSOCKETS(...)
|
||||||
@ -182,8 +182,11 @@ typedef struct {
|
|||||||
|
|
||||||
class WebSockets {
|
class WebSockets {
|
||||||
protected:
|
protected:
|
||||||
|
#ifdef __AVR__
|
||||||
|
typedef void (*WSreadWaitCb)(WSclient_t * client, bool ok);
|
||||||
|
#else
|
||||||
typedef std::function<void(WSclient_t * client, bool ok)> WSreadWaitCb;
|
typedef std::function<void(WSclient_t * client, bool ok)> WSreadWaitCb;
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual void clientDisconnect(WSclient_t * client);
|
virtual void clientDisconnect(WSclient_t * client);
|
||||||
virtual bool clientIsConnected(WSclient_t * client);
|
virtual bool clientIsConnected(WSclient_t * client);
|
||||||
|
@ -30,8 +30,12 @@
|
|||||||
|
|
||||||
class WebSocketsClient: private WebSockets {
|
class WebSocketsClient: private WebSockets {
|
||||||
public:
|
public:
|
||||||
|
#ifdef __AVR__
|
||||||
|
typedef void (*WebSocketClientEvent)(WStype_t type, uint8_t * payload, size_t length);
|
||||||
|
#else
|
||||||
typedef std::function<void (WStype_t type, uint8_t * payload, size_t length)> WebSocketClientEvent;
|
typedef std::function<void (WStype_t type, uint8_t * payload, size_t length)> WebSocketClientEvent;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
WebSocketsClient(void);
|
WebSocketsClient(void);
|
||||||
~WebSocketsClient(void);
|
~WebSocketsClient(void);
|
||||||
|
@ -36,7 +36,11 @@
|
|||||||
class WebSocketsServer: private WebSockets {
|
class WebSocketsServer: private WebSockets {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
#ifdef __AVR__
|
||||||
|
typedef void (*WebSocketServerEvent)(uint8_t num, WStype_t type, uint8_t * payload, size_t length);
|
||||||
|
#else
|
||||||
typedef std::function<void (uint8_t num, WStype_t type, uint8_t * payload, size_t length)> WebSocketServerEvent;
|
typedef std::function<void (uint8_t num, WStype_t type, uint8_t * payload, size_t length)> WebSocketServerEvent;
|
||||||
|
#endif
|
||||||
|
|
||||||
WebSocketsServer(uint16_t port, String origin = "", String protocol = "arduino");
|
WebSocketsServer(uint16_t port, String origin = "", String protocol = "arduino");
|
||||||
~WebSocketsServer(void);
|
~WebSocketsServer(void);
|
||||||
|
Reference in New Issue
Block a user