-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththreads.h
More file actions
33 lines (27 loc) · 912 Bytes
/
threads.h
File metadata and controls
33 lines (27 loc) · 912 Bytes
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
#ifndef THREADS_H
#define THREADS_H
#include <QThread>
#include <QString>
class TA_SerialThread:public QThread
{
public:
TA_SerialThread();
~TA_SerialThread();
public:
uint8_t portCnt;
QSerialPort *m_arrSerial;//ptr point to an array,maxium port num is 5
public:
void SearchPort(void);
void InitPortName(uint8_t portIndex,const QString &portName);
void InitPortBaudRate(uint8_t portIndex,qint32 baudRate);
void InitPortDataBits(uint8_t portIndex,QSerialPort::DataBits dataBits);
void InitPortParity(uint8_t portIndex,QSerialPort::Parity parity);
void InitPortStopBits(uint8_t portIndex,QSerialPort::StopBits stopBits);
void OpenPort(uint8_t portIndex);
void ClosePort(uint8_t portIndex);
void SendDataBuf(uint8_t portIndex,const QByteArray &str);
QByteArray GetDataBuf(uint8_t portIndex);
private slots:
void run();
};
#endif // TASERIALTHREAD_H