BytesToRead Property

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

Gets the number of bytes of data in the receive buffer.

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

public:
property int BytesToRead {
	int get ();
}

Property Value

Type: System..::..Int32
The number of bytes of data in the receive buffer.

The receive buffer includes the serial driver's receive buffer as well as internal buffering in the SerialPort object itself.

Because the BytesToRead property represents both the SerialPort buffer and the Windows-created buffer, it can return a greater value than the ReadBufferSize property, which represents only the Windows-created buffer.

Show: