I try using NetSerialComm at
However, In ReceiveThread() , it always cause IO Error [003a] Exception
and a dead-loop in ReadFile()
.......
if (errs == Win32Com.CE_BRE AK)
{
eventMask |= Win32Com.EV_BRE AK;
}
else
{
throw new CommPortExcepti on("IO Error [003a]"
+ " eventMask:" + eventMask.ToStr ing() + " errs:" +
errs.ToString() );
}
.......
do
{
gotbytes = 0;
if (!Win32Com.Read File(hPort, buf, 1, out gotbytes, unmanagedOv))
{
int x = Marshal.GetLast Win32Error();
throw new CommPortExcepti on("IO Error [004]");
}
if (gotbytes == 1) OnRxChar(buf[0]);
} while (gotbytes > 0);
......
I found it may be caused by EV_BREAK problem. Am I got any wrong
settings on something?
However, In ReceiveThread() , it always cause IO Error [003a] Exception
and a dead-loop in ReadFile()
.......
if (errs == Win32Com.CE_BRE AK)
{
eventMask |= Win32Com.EV_BRE AK;
}
else
{
throw new CommPortExcepti on("IO Error [003a]"
+ " eventMask:" + eventMask.ToStr ing() + " errs:" +
errs.ToString() );
}
.......
do
{
gotbytes = 0;
if (!Win32Com.Read File(hPort, buf, 1, out gotbytes, unmanagedOv))
{
int x = Marshal.GetLast Win32Error();
throw new CommPortExcepti on("IO Error [004]");
}
if (gotbytes == 1) OnRxChar(buf[0]);
} while (gotbytes > 0);
......
I found it may be caused by EV_BREAK problem. Am I got any wrong
settings on something?