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/Communicator/Communicator.h

21 lines
No EOL
600 B
C++

#ifndef _COMMUNICATOR_INCLUDED_
#define _COMMUNICATOR_INCLUDED_
class Communicator
{
protected:
char *messageBuffer;
__SIZE_TYPE__ bufferSize;
__SIZE_TYPE__ calculateMessageOutSize(__SIZE_TYPE__ numberOfValues);
void parseIDs(const int values[], __SIZE_TYPE__ numberOfValues, char *out);
public:
Communicator(__SIZE_TYPE__ bufferSize);
virtual void sendMessage(int *values, __SIZE_TYPE__ numberOfValues);
virtual void sendMessage(const char message[]);
virtual char *receiveMessage();
char *getBuffer();
void clearBuffer();
int getBufferSize();
};
#endif