构建新的cmakelist工程
修改了 delay_tc函数 修返回频率为20hz 修改波特率修改后先重新设置通讯波特率在保存
This commit is contained in:
36
source/qtserialport.h
Normal file
36
source/qtserialport.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef QTSERIALPORT_H
|
||||
#define QTSERIALPORT_H
|
||||
|
||||
#include "serialportbase.h"
|
||||
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
#include <QtSerialPort/QSerialPortInfo>
|
||||
#include <qdebug.h>
|
||||
#include <QDebug>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
class QtSerialport :public SerialPortBase
|
||||
{
|
||||
// Q_OBJECT
|
||||
|
||||
public:
|
||||
// QtSerialport();
|
||||
// ~QtSerialport();
|
||||
|
||||
|
||||
int OpenSerialPort(string portName, int baudrate);
|
||||
int CloseSerialPort();
|
||||
int SetBaudrate(int baudrate);
|
||||
int SendData(const char chrSendBuffer[],const unsigned short usLen);
|
||||
int SendData1(const char *data, const unsigned int len);
|
||||
int ReadData(char * receivedData);
|
||||
|
||||
protected:
|
||||
private:
|
||||
QSerialPort * m_serial;
|
||||
};
|
||||
|
||||
|
||||
#endif // QTSERIALPORT_H
|
Reference in New Issue
Block a user