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

20 lines
No EOL
573 B
C++

#include <Communicator.h>
#include <ESPAsyncWebServer.h>
class WebsocketCommunicator : public Communicator
{
private:
void handleMessage(void *arg, uint8_t *data, size_t len);
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;
void clearBufferSafely();
};