#include "serialThread.h"
#include <QDebug>
#include "ui_serial.h"
#include "serial.h"
#include <QMessageBox>
int sendcount1=1;
QString GetHex="";
SerialThread::SerialThread(QString portName,BaudRateType baud, DataBitsType databits, ParityType parity, StopBitsType stopbits, FlowType flow, long timeout)
{
struct PortSettings ttySetting; // s3c2440--{BAUD115200,DATA_8,PAR_NONE,STOP_1,FLOW_OFF,500};
myCom = new Posix_QextSerialPort(portName,ttySetting,QextSerialBase::Polling);
myCom->open(QIODevice::ReadWrite); //以可读写方式打开串口
myCom->setBaudRate(baud);
myCom->setDataBits(databits);
myCom->setParity(parity);
myCom->setStopBits(stopbits);
myCom->setFlowControl(flow);
myCom->setTimeout(timeout);}
//qDeb