read

abstract fun read(data: ByteArray?, length: Int): Int

Read data from the serial communication port. Timeout default 3 seconds.

Return

int - Number of bytes read.

Parameters

data

Read buffer.

length

Length to read.


abstract fun read(data: ByteArray?, length: Int, timeout: Int): Int

Read data from the serial communication port.

Return

int - Number of bytes read.

Parameters

data

Read buffer.

length

Length to read.

timeout

Timeout for the read operation.