locked
SerialPort constants RRS feed

  • Question

  • Hello,

    I am migrating the MSCOMM legacy control to SerialPort class in VB.Net 2.0.
    I am looking for the corresponding SerialPort constants as it is available in the MSCOMM
    for example:

    comEvReceive
    comEvCD 
    comEvEOF

    I can find only Chars and EOF constant in SerialData class.

    or is there any other approach which can be followed in SerialPort implementaion in .Net 2.0?


    Thanks

    Tuesday, September 23, 2008 1:28 PM

Answers

  • The comEvReceive constant would map to the DataReceived event that gets raised whenever data arrives.

    comEvCD (and most other non-data transitions) cause a PinChanged event to be raised.  The argument to this event includes the SerialPinChange enumeration that specifies what pin has changed.  You can get the current state of the pins using the similiarly named properties.

    Michael Taylor - 9/23/08
    http://p3net.mvps.org


    • Marked as answer by Zhi-Xin Ye Monday, September 29, 2008 6:27 AM
    Tuesday, September 23, 2008 1:59 PM

All replies

  • The comEvReceive constant would map to the DataReceived event that gets raised whenever data arrives.

    comEvCD (and most other non-data transitions) cause a PinChanged event to be raised.  The argument to this event includes the SerialPinChange enumeration that specifies what pin has changed.  You can get the current state of the pins using the similiarly named properties.

    Michael Taylor - 9/23/08
    http://p3net.mvps.org


    • Marked as answer by Zhi-Xin Ye Monday, September 29, 2008 6:27 AM
    Tuesday, September 23, 2008 1:59 PM
  • EOF also triggers DataReceived.  A fruitful source of bugs to those that rely on ReceivedBytesThreshold.
    Hans Passant.
    Wednesday, September 24, 2008 12:26 PM