serial_send
Send a string to the connected STM32 board over serial and optionally wait to read the response, enabling command-response debugging and hardware-in-the-loop tests.
Instructions
Send data over serial and optionally read the response.
Sends the data string (plus line ending) to the connected board. If read_response is true, waits for and returns the response using a polling loop (50ms inter-byte, 200ms silence break).
Args: connection_id: Connection ID from serial_connect. data: The string to send. read_response: If true, wait for and return response data. read_timeout: Max seconds to wait for response (default 2.0). line_ending: Line ending to append — "lf" (default), "cr", "crlf", or "none".
Returns: What was sent, and the response if read_response is true.
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": {
"connection_id": "<connection_id>",
"data": "<data>"
},
"name": "serial_send"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| line_ending | No | lf | |
| read_timeout | No | ||
| connection_id | Yes | ||
| read_response | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |