Remove whitespace, update email addresses and URLs.
[kodak.git] / serial.h
1 //+----------------------------------------------------------------------------
2 //
3 // File:     serial.h
4 //
5 // Module:   Kodak DC210 plus communication program
6 //
7 // Synopsis: A class to encapsulate communication to the serial port.
8 //
9 // Author:       sgasch
10 //
11 // Created    4 Jun 1999
12 //
13 //+----------------------------------------------------------------------------
14
15 #ifndef _SERIAL
16 #define _SERIAL
17
18 #include "global.h"
19
20 class CSerialPort
21 {
22
23 public:
24         CSerialPort();
25         CSerialPort(char *szDevice);
26         ~CSerialPort();
27
28         bool Read(BYTE *buf, int iNumBytes);
29         bool Write(BYTE *buf, int iNumBytes);
30         int GetTimeout(void);
31         void SetTimeout(int iNewTimeoutSec);
32         int GetBaudrate(void);
33         bool SetBaudrate(int iBps);
34         bool WriteByte(BYTE bData);
35
36 //      bool ReadByte(BYTE *buf);
37 //      bool WriteByte(BYTE bData);
38
39 private:
40         int _iFd;
41         int _iBaudRate;
42         int _iTimeoutSec;
43         bool _fInitialized;
44         
45         bool SetupLine(char *szDevice);
46
47 };
48
49 #endif // _SERIAL
50
51
52
53