#include #include SerialCommunicator::SerialCommunicator(int baudRate, int timeout, __SIZE_TYPE__ bufferSize) : Communicator(bufferSize) { Serial.begin(baudRate); Serial.setTimeout(timeout); } void SerialCommunicator::sendMessage(int *values, int numberOfValues) { char message[calculateMessageOutSize(numberOfValues)]; parseIDs(values, numberOfValues, message); Serial.println(message); } void SerialCommunicator::sendMessage(char *message) { Serial.println(message); } char *SerialCommunicator::receiveMessage() { if (Serial.available()) { memset(getBuffer(), '\0', getBufferSize()); Serial.readBytesUntil('\n', getBuffer(), getBufferSize()); } return getBuffer(); }