This repository has been archived on 2023-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
old-monorepo/modules/control/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();
};