|
|
@ -25,8 +25,10 @@ void QTDataChannel::init() { |
|
|
|
// ZLOGI(TAG, "rx %d bytes", rx_cnt);
|
|
|
|
if (m_rxcb) m_rxcb(rx, rx_cnt); |
|
|
|
} |
|
|
|
this_thread::sleep_for(chrono::microseconds(100)); |
|
|
|
} else { |
|
|
|
this_thread::sleep_for(chrono::microseconds(10000)); |
|
|
|
} |
|
|
|
// this_thread::sleep_for(chrono::microseconds(1000));
|
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
@ -137,8 +139,8 @@ int QTDataChannel::com_receive(uint8_t *rxbuf, int rxbufsize) { |
|
|
|
COMMTIMEOUTS TimeOuts; |
|
|
|
GetCommTimeouts(m_CommHandler, &TimeOuts); |
|
|
|
TimeOuts.ReadIntervalTimeout = 0; // 读间隔超时
|
|
|
|
TimeOuts.ReadTotalTimeoutMultiplier = 0; // 读时间系数
|
|
|
|
TimeOuts.ReadTotalTimeoutConstant = 1; // 读时间常量
|
|
|
|
TimeOuts.ReadTotalTimeoutMultiplier = 0; // 读时间系数
|
|
|
|
TimeOuts.ReadTotalTimeoutConstant = 1; // 读时间常量
|
|
|
|
SetCommTimeouts(m_CommHandler, &TimeOuts); |
|
|
|
|
|
|
|
// PurgeComm(m_CommHandler, PURGE_RXCLEAR);
|
|
|
|