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