#ifndef SERIALCOM_H
#define SERIALCOM_H
#include <stdint.h>

#include <unistd.h>

//#define USE_SERIAL_PORT
//#define USE_SERIAL_STREAM
#define USE_PLAIN_SERIAL

#ifdef USE_SERIAL_PORT
    #include <SerialPort.h>
#endif // USE_SERIAL_PORT
#ifdef USE_SERIAL_STREAM
    #include <SerialStream.h>
    using namespace LibSerial;
#endif // USE_SERIAL_STREAM

#ifdef USE_PLAIN_SERIAL
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <termios.h>
#endif
//using namespace LibSerial;


class SerialCom
{
public:
    unsigned char receiveSerial();
    void sendSerial(unsigned char sendByte);


    SerialCom();
    ~SerialCom();

private:
#ifdef USE_SERIAL_STREAM
    SerialStream serial_stream;
#endif // USE_SERIAL_STREAM

#ifdef USE_PLAIN_SERIAL
    int tty_fd;
#endif // USE_PLAIN_SERIAL
};

#endif // SERIALCOM_H

