/* * Author: Manash Kumar Mandal * Modified Library introduced in Arduino Playground which does not work * This works perfectly * LICENSE: MIT */ #ifndef SERIALPORT_H #define SERIALPORT_H #define ARDUINO_WAIT_TIME 2000 #define MAX_DATA_LENGTH 255 #include #include #include class SerialPort { private: HANDLE handler; bool connected; COMSTAT status; DWORD errors; public: SerialPort(char *portName); ~SerialPort(); int readSerialPort(char *buffer, unsigned int buf_size); bool writeSerialPort(char *buffer, unsigned int buf_size); bool isConnected(); }; #endif // SERIALPORT_H