send_serial_command
Transmit text or raw hex commands to a serial port and optionally capture the device response, enabling hardware debugging, firmware interaction, and serial device testing.
Instructions
Send a command string or raw hex bytes to a serial port and optionally read the response.
Args: port: Serial port device (e.g., '/dev/ttyUSB0'). data: Text string to send, or hex bytes string (e.g., 'AA 55 01 FF') when encoding='hex'. baudrate: Serial baud rate (default 115200). encoding: 'utf-8', 'ascii', or 'hex' for raw byte arrays. line_ending: Appended to text payloads ('\n', '\r\n', '\r', or '' for none). Ignored if encoding='hex'. read_response_sec: Seconds to listen for response after sending (0 to skip reading).
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": "<port>",
"data": "<data>"
},
"name": "send_serial_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| port | Yes | ||
| baudrate | No | ||
| encoding | No | utf-8 | |
| line_ending | No | ||
| read_response_sec | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||