posix_qextserialport.h

00001 #ifndef _POSIX_QEXTSERIALPORT_H_
00002 #define _POSIX_QEXTSERIALPORT_H_
00003 
00004 #include <stdio.h>
00005 #include <termios.h>
00006 #include <errno.h>
00007 #include <unistd.h>
00008 #include <sys/time.h>
00009 #include <sys/ioctl.h>
00010 #include <sys/select.h>
00011 #include <fcntl.h>
00012 #include "qextserialbase.h"
00013 #include "teglobal.h"
00014 
00015 /* Get rid of QFile in TSerialPort */
00016 // Move to lib.pro
00017 //#define NOQFILE 
00018 
00019 /*ensure handling of CRTSCTS constant*/
00020 #ifdef CNEW_RTSCTS
00021 #ifndef CRTSCTS
00022 #define CRTSCTS CNEW_RTSCTS
00023 #endif  //CRTSCTS
00024 #else 
00025 #ifndef CRTSCTS
00026 #define CRTSCTS     0
00027 #endif  //CRTSCTS
00028 #endif  //CNEW_RTSCTS
00029 
00030 #ifndef CMSPAR
00031     #define CMSPAR   010000000000
00032 #endif
00033 
00034 //weird scoping issue with gcc 2.95 - this should fix it
00035 #ifdef QT_LARGE_FILE_SUPPORT
00036     typedef off_t Offset;
00037 #else
00038     typedef Q_ULONG Offset;
00039 #endif
00040 
00041 class Posix_QextSerialPort:public QextSerialBase {
00042 public:
00043     Posix_QextSerialPort();           
00044     Posix_QextSerialPort(const Posix_QextSerialPort& s);
00045     Posix_QextSerialPort(const char* name);
00046     Posix_QextSerialPort(const PortSettings& settings);
00047     Posix_QextSerialPort(const char* name, const PortSettings& settings);
00048     Posix_QextSerialPort& operator=(const Posix_QextSerialPort& s);
00049     virtual ~Posix_QextSerialPort();
00050     virtual bool open(int mode=0);
00051     virtual void close();
00052     virtual void flush();
00053     virtual Offset size() const;
00054     virtual int getch();
00055     virtual int putch(int);
00056     virtual int ungetch(int);
00057     virtual void setFlowControl(FlowType);
00058     virtual void setParity(ParityType);
00059     virtual void setDataBits(DataBitsType);
00060     virtual void setStopBits(StopBitsType);
00061     virtual void setBaudRate(BaudRateType);
00062     virtual void setDtr(bool set=true);
00063     virtual void setRts(bool set=true);
00064     virtual unsigned long lineStatus(void);
00065     virtual int bytesWaiting();
00066     virtual void translateError(unsigned long);
00067     virtual void setTimeout(unsigned long=0, unsigned long=0);
00068 
00069 #ifdef QTVER_PRE_30
00070     virtual Q_LONG readBlock(char *data, uint maxlen);
00071     virtual Q_LONG writeBlock(const char *data, uint len);
00072 #else
00073     virtual Q_LONG readBlock(char *data, unsigned long maxlen);
00074     virtual Q_LONG writeBlock(const char *data, unsigned long len);
00075 #endif
00076 
00077 protected:
00078 #ifdef NOQFILE
00079     int m_fdFile;
00080 #else
00081     QFile* Posix_File;
00082 #endif
00083 //protected:
00084 //    QFile* Posix_File;
00085     struct termios Posix_CommConfig;
00086     struct timeval Posix_Timeout;
00087     struct timeval Posix_Copy_Timeout;
00088     void construct(void);
00089 };
00090 
00091 #endif

Документация по Общая библиотека для работы с торговым оборудованием.. Последние изменения: Sun Jul 2 23:38:24 2006. Создано системой  doxygen 1.4.7