Пример #1
0
/*!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();
    }
}
Пример #2
0
/*!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));
}