read_bytes
Read up to a specified number of bytes from a serial port with configurable timeout and encoding.
Instructions
Read a specific number of bytes from the serial port.
Reads up to num_bytes, returning early if timeout is reached.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port_id | Yes | The port identifier | |
| num_bytes | Yes | Number of bytes to read | |
| timeout | No | Maximum time to wait in seconds | |
| encoding | No | Decode bytes using this encoding (or 'raw' for hex) | utf-8 |