EV_BREAK problem in NetSerialComm

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shizuka

    EV_BREAK problem in NetSerialComm

    I try using NetSerialComm at
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


    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?
Working...