X2 Standard  Version 1.24
serxinterface.h
1 #ifndef _SerXInterface_
2 #define _SerXInterface_
3 
4 #define SerXInterface_Name "com.bisque.TheSkyX.staticlibs.serx.SerXInterface/1.0"
5 
18 {
19 public:
21  virtual ~SerXInterface(){}
22 
24  enum Parity
25  {
31  };
32 
33 public:
42  virtual int open(const char * pszPort,
43  const unsigned long & dwBaudRate = 9600,
44  const Parity & parity = B_NOPARITY,
45  const char * pszSession = 0) = 0;
46 
48  virtual int close() = 0;
49 
51  virtual bool isConnected(void) const = 0;
52 
55  virtual int flushTx(void) = 0;
56 
58  virtual int purgeTxRx(void) = 0;
59 
64  virtual int waitForBytesRx(const int& nNumber,
65  const int& nTimeOutMilli) = 0;
66 
73  virtual int readFile(void* lpBuf,
74  const unsigned long dwTot,
75  unsigned long& dwRed,
76  const unsigned long& dwTimeOut = 1000) = 0;
77 
83  virtual int writeFile(void* lpBuf,
84  const unsigned long& dwTot,
85  unsigned long& dwRote) = 0;
86 
88  virtual int bytesWaitingRx(int &nBytesWaiting) = 0;
89 
96  virtual void abortTimeout(){setAbortTimeout(true);}
100  virtual bool didAbortTimeout() const {return m_bAbortTimeout;}
104  virtual void setAbortTimeout(const bool& bYes) {m_bAbortTimeout=bYes;}
105 
106 private:
107  bool m_bAbortTimeout;
108 };
109 
110 #endif // _SerXInterface_
111 
112 //Linux wants a 'newline' at the end of every source file - don't delete the one after this line
SerXInterface::bytesWaitingRx
virtual int bytesWaitingRx(int &nBytesWaiting)=0
SerXInterface::B_EVENPARITY
@ B_EVENPARITY
Definition: serxinterface.h:28
SerXInterface::writeFile
virtual int writeFile(void *lpBuf, const unsigned long &dwTot, unsigned long &dwRote)=0
SerXInterface::isConnected
virtual bool isConnected(void) const =0
SerXInterface::purgeTxRx
virtual int purgeTxRx(void)=0
SerXInterface::abortTimeout
virtual void abortTimeout()
Definition: serxinterface.h:96
SerXInterface::close
virtual int close()=0
SerXInterface::setAbortTimeout
virtual void setAbortTimeout(const bool &bYes)
Definition: serxinterface.h:104
SerXInterface::B_ODDPARITY
@ B_ODDPARITY
Definition: serxinterface.h:27
SerXInterface::didAbortTimeout
virtual bool didAbortTimeout() const
Definition: serxinterface.h:100
SerXInterface::B_MARKPARITY
@ B_MARKPARITY
Definition: serxinterface.h:29
SerXInterface::open
virtual int open(const char *pszPort, const unsigned long &dwBaudRate=9600, const Parity &parity=B_NOPARITY, const char *pszSession=0)=0
SerXInterface::flushTx
virtual int flushTx(void)=0
SerXInterface::Parity
Parity
Definition: serxinterface.h:25
SerXInterface::readFile
virtual int readFile(void *lpBuf, const unsigned long dwTot, unsigned long &dwRed, const unsigned long &dwTimeOut=1000)=0
SerXInterface
The SerXInterface is a cross-plaform serial port.
Definition: serxinterface.h:18
SerXInterface::B_NOPARITY
@ B_NOPARITY
Definition: serxinterface.h:26
SerXInterface::waitForBytesRx
virtual int waitForBytesRx(const int &nNumber, const int &nTimeOutMilli)=0
SerXInterface::B_SPACEPARITY
@ B_SPACEPARITY
Definition: serxinterface.h:30
X2 Examples
(C) Software Bisque, Inc. All rights reserved.