read
Retrieve buffered serial data to capture device logs, sensor output, or late replies. Configure timeout, settle, and hex format to get exact bytes.
Instructions
Read and consume buffered data from the device (logs, sensor output, late replies).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | Port device from list_ports (e.g. /dev/cu.usbserial-0001, /dev/ttyUSB0, COM3), or a pyserial URL such as socket://host:port, rfc2217://host:port or loop://. | |
| as_hex | No | Also return the raw bytes as hex. | |
| max_bytes | No | Upper bound on returned bytes. | |
| settle_ms | No | After data starts arriving, keep collecting until the line is silent for this many ms (0 = return as soon as anything is available). Useful for multi-line replies. | |
| timeout_s | No | Seconds to wait for the first byte if nothing is buffered. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex | No | Raw bytes as hex when as_hex=true. | |
| text | Yes | Decoded data (undecodable bytes become U+FFFD). | |
| bytes | Yes | ||
| error | No | ||
| timed_out | Yes | True if nothing arrived before the timeout. |