mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
parent
82c867d2eb
commit
2feb420551
19 changed files with 163 additions and 461 deletions
63
Sockets.h
63
Sockets.h
|
|
@ -13,60 +13,6 @@ struct room_t {
|
|||
bool join(uint8_t num);
|
||||
bool leave(uint8_t num);
|
||||
};
|
||||
/*
|
||||
class ClientSocketEvent {
|
||||
private:
|
||||
uint8_t _objects = 0;
|
||||
uint8_t _arrays = 0;
|
||||
bool _nocomma = true;
|
||||
char _numbuff[25] = {0};
|
||||
protected:
|
||||
void _safecat(const char *val, bool escape = false);
|
||||
void _appendNumber(const char *name);
|
||||
public:
|
||||
ClientSocketEvent();
|
||||
ClientSocketEvent(const char *evt);
|
||||
//ClientSocketEvent(const char *evt, const char *data);
|
||||
char msg[2048] = "";
|
||||
void beginEmit(const char *evt);
|
||||
void endEmit();
|
||||
|
||||
void prepareMessage(const char *evt, const char *data);
|
||||
void prepareMessage(const char *evt, JsonDocument &doc);
|
||||
void appendMessage(const char *text);
|
||||
void appendElement(const char *elem, const char *val);
|
||||
|
||||
void beginObject(const char *name = nullptr);
|
||||
void endObject();
|
||||
void beginArray(const char *name = nullptr);
|
||||
void endArray();
|
||||
|
||||
void appendElem(const char *name = nullptr);
|
||||
void addElem(const char* val);
|
||||
void addElem(float fval);
|
||||
void addElem(int8_t nval);
|
||||
void addElem(uint8_t nval);
|
||||
void addElem(int16_t nval);
|
||||
void addElem(uint16_t nval);
|
||||
void addElem(int32_t nval);
|
||||
void addElem(uint32_t nval);
|
||||
void addElem(int64_t lval);
|
||||
void addElem(uint64_t lval);
|
||||
void addElem(bool bval);
|
||||
|
||||
void addElem(const char* name, float fval);
|
||||
void addElem(const char* name, int8_t nval);
|
||||
void addElem(const char* name, uint8_t nval);
|
||||
void addElem(const char* name, int16_t nval);
|
||||
void addElem(const char* name, uint16_t nval);
|
||||
void addElem(const char* name, int32_t nval);
|
||||
void addElem(const char* name, uint32_t nval);
|
||||
void addElem(const char* name, int64_t lval);
|
||||
void addElem(const char* name, uint64_t lval);
|
||||
void addElem(const char* name, bool bval);
|
||||
void addElem(const char *name, const char *val);
|
||||
};
|
||||
*/
|
||||
class SocketEmitter {
|
||||
protected:
|
||||
uint8_t newclients = 0;
|
||||
|
|
@ -86,15 +32,6 @@ class SocketEmitter {
|
|||
JsonSockEvent * beginEmit(const char *evt);
|
||||
void endEmit(uint8_t num = 255);
|
||||
void endEmitRoom(uint8_t num);
|
||||
/*
|
||||
bool sendToRoom(uint8_t room, ClientSocketEvent *evt);
|
||||
bool sendToClients(ClientSocketEvent *evt);
|
||||
bool sendToClient(uint8_t num, ClientSocketEvent *evt);
|
||||
bool sendToClients(const char *evt, const char *data);
|
||||
bool sendToClient(uint8_t num, const char *evt, const char *data);
|
||||
bool sendToClients(const char *evt, JsonDocument &doc);
|
||||
bool sendToClient(uint8_t num, const char *evt, JsonDocument &doc);
|
||||
*/
|
||||
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