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/Devices/Control/Firmware/lib/StreamCommunicator/StreamCommunicator.h

20 lines
No EOL
573 B
C++

#include "Stream.h"
class StreamCommunicator
{
protected:
Stream &stream;
char *messageBuffer;
__SIZE_TYPE__ bufferSize;
__SIZE_TYPE__ calculateMessageOutSize(__SIZE_TYPE__ numberOfValues);
void parseIDs(const int values[], __SIZE_TYPE__ numberOfValues, char *out);
public:
StreamCommunicator(Stream &s_out, __SIZE_TYPE__ bufferSize);
void sendMessage(int *values, __SIZE_TYPE__ numberOfValues);
void sendMessage(const char message[]);
char *receiveMessage();
char *getBuffer();
int getBufferSize();
Stream *getStream();
};