32 lines
542 B
C++
32 lines
542 B
C++
#ifndef QTSERIALPORT_H
|
|
#define QTSERIALPORT_H
|
|
|
|
#include "serialportbase.h"
|
|
|
|
#include <QtSerialPort/QSerialPort>
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
|
|
class QtSerialport :public SerialPortBase
|
|
{
|
|
// Q_OBJECT
|
|
|
|
public:
|
|
// QtSerialport();
|
|
// ~QtSerialport();
|
|
|
|
|
|
int OpenSerialPort(string portName);
|
|
int CloseSerialPort();
|
|
int SetBaudrate(int baudrate);
|
|
int SendData(const char chrMessage[], const unsigned short usLen);
|
|
int ReadData();
|
|
|
|
protected:
|
|
private:
|
|
QSerialPort * m_serial;
|
|
};
|
|
|
|
|
|
#endif // QTSERIALPORT_H
|