-
Notifications
You must be signed in to change notification settings - Fork 55
/
posix_qextserialport.h
63 lines (50 loc) · 1.89 KB
/
posix_qextserialport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _POSIX_QEXTSERIALPORT_H_
#define _POSIX_QEXTSERIALPORT_H_
#include <stdio.h>
#include <termios.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include "qextserialbase.h"
class Posix_QextSerialPort:public QextSerialBase
{
private:
/*!
* This method is a part of constructor.
*/
void init();
protected:
QFile* Posix_File;
struct termios Posix_CommConfig;
struct timeval Posix_Timeout;
struct timeval Posix_Copy_Timeout;
virtual qint64 readData(char * data, qint64 maxSize);
virtual qint64 writeData(const char * data, qint64 maxSize);
public:
Posix_QextSerialPort();
Posix_QextSerialPort(const Posix_QextSerialPort& s);
Posix_QextSerialPort(const QString & name, QextSerialBase::QueryMode mode = QextSerialBase::Polling);
Posix_QextSerialPort(const PortSettings& settings, QextSerialBase::QueryMode mode = QextSerialBase::Polling);
Posix_QextSerialPort(const QString & name, const PortSettings& settings, QextSerialBase::QueryMode mode = QextSerialBase::Polling);
Posix_QextSerialPort& operator=(const Posix_QextSerialPort& s);
virtual ~Posix_QextSerialPort();
virtual void setBaudRate(BaudRateType);
virtual void setDataBits(DataBitsType);
virtual void setParity(ParityType);
virtual void setStopBits(StopBitsType);
virtual void setFlowControl(FlowType);
virtual void setTimeout(long);
virtual bool open(OpenMode mode);
virtual void close();
virtual void flush();
virtual qint64 size() const;
virtual qint64 bytesAvailable();
virtual void ungetChar(char c);
virtual void translateError(ulong error);
virtual void setDtr(bool set=true);
virtual void setRts(bool set=true);
virtual ulong lineStatus();
};
#endif