serial.read
Read a specified number of bytes from a serial port connection. Returns data as text, hex, or base64 within a configurable timeout.
Instructions
Read up to nbytes from a serial port. Returns immediately with whatever data is available within the timeout. Use serial.readline or serial.read_until for line-oriented reads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection_id | Yes | ||
| nbytes | No | Maximum bytes to read (default 256). | |
| timeout_ms | No | Override read timeout for this call only (milliseconds). | |
| as | No | Output format: text (decoded string), hex, or base64. Default text. | text |