base-station/Firmware/lib/WebsocketCommunicator/WebsocketCommunicator.h

20 lines
573 B
C
Raw Normal View History

#include <Communicator.h>
#include <ESPAsyncWebServer.h>
class WebsocketCommunicator : public Communicator
{
private:
void handleMessage(void *arg, uint8_t *data, size_t len);
2022-04-13 19:09:03 +02:00
bool msgRead;
protected:
AsyncWebSocket &socket;
AsyncWebServer &server;
public:
WebsocketCommunicator(AsyncWebSocket &socket, AsyncWebServer &server, __SIZE_TYPE__ bufferSize);
void sendMessage(int *values, __SIZE_TYPE__ numberOfValues) override;
void sendMessage(const char message[]) override;
char *receiveMessage() override;
2022-04-13 19:09:03 +02:00
void clearBufferSafely();
};