2021-04-11 03:28:04 +00:00
|
|
|
#include "sharedata.h"
|
|
|
|
|
|
|
|
ShareData::ShareData(QObject *parent) : QObject(parent)
|
2021-04-12 15:39:06 +00:00
|
|
|
{
|
|
|
|
mSerialController = new SerialController(nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
int ShareData::OpenUart(QString port, QString baudRate, QString dataBits, QString stopBits, QString flow)
|
|
|
|
{
|
|
|
|
qDebug()<<port<<baudRate<<dataBits<<stopBits<<flow;
|
|
|
|
if(mSerialController->OpenSerial(port,baudRate,dataBits,stopBits,flow) == 0){
|
|
|
|
qDebug()<<"openserial ok";
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
qDebug()<<"openserial failed";
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int ShareData::CloseSerial()
|
2021-04-11 03:28:04 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|