PinChange enumeration

How can I PinChange enumeration for Ring indicator

Please, send me an example for case when ring pin of com1 is active , I read received bytes.




Answer this question

PinChange enumeration

  • Leclerc

    Unfortunately I’m not too skilled in the low level details of RS232... however if I understand you right you want to read data after the Ring line has toggled... in that case, try using this as an Event Handler:

    private void serialPort1_PinChanged(object sender, System.IO.Ports.SerialPinChangedEventArgs e)
    {
    if (e.EventType == System.IO.Ports.SerialPinChange.Ring)
    {
    string data = serialPort1.ReadExisting()
    }
    }

    I cannot say for sure if this will work though as I do not know the order of buffer population vs Ring being in effect. Sadly the MSDN page on the enum does not tell us much.



  • informass

    Could you be more clear on what you would like to achieve

    Thank you,
    Bhanu.



  • PinChange enumeration