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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"port_id": "<port_id>",
"num_bytes": "<num_bytes>"
},
"name": "read_bytes"
}
}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 |