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.
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 |