void CReceiverThread::ReceiveData( ) { Win_QextSerialPort* pPort = ( Win_QextSerialPort* ) sender( ); QByteArray byData = pPort->readAll( ); //QString strParkID = pPort->objectName( ); //qint32 nLen = byData.length( ); //qDebug( ) << Q_FUNC_INFO << "Length=" << QString::number( nLen ) << endl // << "ASCII: " << QString( byData ) << endl // << "Hex: " << QString( byData.toHex( ) ) << endl; pParserThread->PostData( byData ); }
/*!Win_QextSerialPort::Win_QextSerialPort(const Win_QextSerialPort&) Copy constructor. */ Win_QextSerialPort::Win_QextSerialPort(const Win_QextSerialPort& s) : QextSerialBase(s.port) { m_WinHandle=INVALID_HANDLE_VALUE; _queryMode = s._queryMode; m_BytesToWrite = s.m_BytesToWrite; m_pBytesToWriteLock = new tQReadWriteLock("Win_QextSerialPort.m_pBytesToWriteLock"); m_pOverlapThread = new Win_QextSerialThread(this); memcpy(& m_Overlap, & s.m_Overlap, sizeof(OVERLAPPED)); memcpy(& m_OverlapWrite, & s.m_OverlapWrite, sizeof(OVERLAPPED)); setOpenMode(s.openMode()); lastErr=s.lastErr; port = s.port; Settings.FlowControl=s.Settings.FlowControl; Settings.Parity=s.Settings.Parity; Settings.DataBits=s.Settings.DataBits; Settings.StopBits=s.Settings.StopBits; Settings.BaudRate=s.Settings.BaudRate; m_WinHandle=s.m_WinHandle; memcpy(&m_WinCommConfig, &s.m_WinCommConfig, sizeof(COMMCONFIG)); memcpy(&m_WinCommTimeouts, &s.m_WinCommTimeouts, sizeof(COMMTIMEOUTS)); if (s.m_pOverlapThread->isRunning()) { m_pOverlapThread->start(); } }
/*!Win_QextSerialPort::Win_QextSerialPort(const Win_QextSerialPort&) Copy constructor. */ Win_QextSerialPort::Win_QextSerialPort(const Win_QextSerialPort& s):QextSerialBase(s.port) { Win_Handle=INVALID_HANDLE_VALUE; setOpenMode(s.openMode()); lastErr=s.lastErr; port = s.port; Settings.FlowControl=s.Settings.FlowControl; Settings.Parity=s.Settings.Parity; Settings.DataBits=s.Settings.DataBits; Settings.StopBits=s.Settings.StopBits; Settings.BaudRate=s.Settings.BaudRate; Win_Handle=s.Win_Handle; memcpy(&Win_CommConfig, &s.Win_CommConfig, sizeof(COMMCONFIG)); memcpy(&Win_CommTimeouts, &s.Win_CommTimeouts, sizeof(COMMTIMEOUTS)); }