日期:2014-05-17 浏览次数:21102 次
while (i > 0)
{
int readBufCount = SerialPortClient.BytesToRead;
if (readBufCount > 8)
{
m_autoPortEvent.WaitOne(40, false);
readBufCount = SerialPortClient.BytesToRead;
recvData = new byte[readBufCount];
SerialPortClient.Read(recvData, 0, recvData.Length);
return recvData;
}
i--;
}
if (recvData == null)
{
throw new Exception("time out for getData");
}