//+---------------------------------------------------------------------------- // // File: serial.h // // Module: Kodak DC210 plus communication program // // Synopsis: A class to encapsulate communication to the serial port. // // Author: sgasch // // Created 4 Jun 1999 // //+---------------------------------------------------------------------------- #ifndef _SERIAL #define _SERIAL #include "global.h" class CSerialPort { public: CSerialPort(); CSerialPort(char *szDevice); ~CSerialPort(); bool Read(BYTE *buf, int iNumBytes); bool Write(BYTE *buf, int iNumBytes); int GetTimeout(void); void SetTimeout(int iNewTimeoutSec); int GetBaudrate(void); bool SetBaudrate(int iBps); bool WriteByte(BYTE bData); // bool ReadByte(BYTE *buf); // bool WriteByte(BYTE bData); private: int _iFd; int _iBaudRate; int _iTimeoutSec; bool _fInitialized; bool SetupLine(char *szDevice); }; #endif // _SERIAL