mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Initial commit
This commit is contained in:
commit
ee367e7111
28 changed files with 53359 additions and 0 deletions
24
Sockets.h
Normal file
24
Sockets.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <WebSocketsServer.h>
|
||||
#ifndef sockets_h
|
||||
#define sockets_h
|
||||
#include <ArduinoJson.h>
|
||||
class ClientSocketEvent {
|
||||
public:
|
||||
char msg[1024];
|
||||
void prepareMessage(const char *evt, const char *data);
|
||||
};
|
||||
class SocketEmitter {
|
||||
ClientSocketEvent evt;
|
||||
public:
|
||||
void startup();
|
||||
void begin();
|
||||
void loop();
|
||||
void end();
|
||||
void disconnect();
|
||||
bool sendToClients(const char *evt, const char *data);
|
||||
bool sendToClient(uint8_t num, const char *evt, const char *data);
|
||||
bool sendToClients(const char *evt, JsonObject &obj);
|
||||
bool sendToClient(uint8_t num, const char *evt, JsonObject &obj);
|
||||
static void wsEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t length);
|
||||
};
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue