source: ntrip/trunk/BNC/src/serial/posix_qextserialport.h@ 9955

Last change on this file since 9955 was 9955, checked in by stuerze, 8 weeks ago

minor changes

File size: 1.6 KB
Line 
1
2#ifndef _POSIX_QEXTSERIALPORT_H_
3#define _POSIX_QEXTSERIALPORT_H_
4
5#include <stdio.h>
6#include <termios.h>
7#include <errno.h>
8#ifndef WIN32
9#include <unistd.h>
10#else
11#include <windows.h>
12#include <direct.h>
13#include <stdlib.h>
14#endif
15#include <sys/time.h>
16#include <sys/ioctl.h>
17#include <sys/select.h>
18#include "qextserialbase.h"
19
20class Posix_QextSerialPort:public QextSerialBase {
21public:
22 Posix_QextSerialPort();
23 Posix_QextSerialPort(const Posix_QextSerialPort& s);
24 Posix_QextSerialPort(const QString & name);
25 Posix_QextSerialPort(const PortSettings& settings);
26 Posix_QextSerialPort(const QString & name, const PortSettings& settings);
27 Posix_QextSerialPort& operator=(const Posix_QextSerialPort& s);
28 virtual ~Posix_QextSerialPort();
29
30 virtual void setBaudRate(BaudRateType);
31 virtual void setDataBits(DataBitsType);
32 virtual void setParity(ParityType);
33 virtual void setStopBits(StopBitsType);
34 virtual void setFlowControl(FlowType);
35 virtual void setTimeout(ulong, ulong);
36
37 virtual bool open(OpenMode mode=0);
38 virtual void close();
39 virtual void flush();
40
41 virtual qint64 size() const;
42 virtual qint64 bytesAvailable();
43
44 virtual void ungetChar(char c);
45
46 virtual void translateError(ulong error);
47
48 virtual void setDtr(bool set=true);
49 virtual void setRts(bool set=true);
50 virtual ulong lineStatus();
51
52protected:
53 QFile* Posix_File;
54 struct termios Posix_CommConfig;
55 struct timeval Posix_Timeout;
56 struct timeval Posix_Copy_Timeout;
57
58 virtual qint64 readData(char * data, qint64 maxSize);
59 virtual qint64 writeData(const char * data, qint64 maxSize);
60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.