DataReceived Event

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents the method that will handle the data received event of a SerialPort object.

Namespace:  System.IO.Ports
Assembly:  Microsoft.SPOT.Hardware.SerialPort (in Microsoft.SPOT.Hardware.SerialPort.dll)

public event SerialDataReceivedEventHandler DataReceived

Serial received events can be caused by any of the items in the SerialData enumeration. Because the operating system determines whether to raise this event or not, not all parity errors may be reported.

DataReceived and ErrorReceived events may be called out of order, and there may be a slight delay between when the underlying stream reports the error and when the event handler is executed. Only one event handler can execute at a time.

The DataReceived event is not guaranteed to be raised for every byte received. Use the BytesToRead property to determine how much data is left to be read in the buffer.

Show: