serial.read_bytes
serial.read_bytes
Function
Read raw bytes from the open serial port and return Bytes.
Syntax
device.open(config).read_bytes()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Bytes | The raw bytes currently read; empty Bytes is returned when there is no data. |
Code Example
port = device.open({type: 'serial', port: 'COM3'}) data = port.read_bytes() // Output: Bytes print type(data)
Notes
- Serial port reading is controlled by
device.open({timeout: ...}). - Return value length is limited by
BT_BYTES_LIMIT.