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:
@ -27,7 +27,7 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#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<void(WSclient_t * client, bool ok)> WSreadWaitCb;
|
||||
#endif
|
||||
|
||||
virtual void clientDisconnect(WSclient_t * client);
|
||||
virtual bool clientIsConnected(WSclient_t * client);
|
||||
|
@ -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<void (WStype_t type, uint8_t * payload, size_t length)> WebSocketClientEvent;
|
||||
#endif
|
||||
|
||||
|
||||
WebSocketsClient(void);
|
||||
~WebSocketsClient(void);
|
||||
|
@ -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<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(void);
|
||||
|
Reference in New Issue
Block a user