write_data
Write string or hex data to an open serial port. Specify port, data, encoding, and hex mode.
Instructions
Write data to an open serial port.
Data can be a regular string (encoded with the specified encoding) or a hex string if hex_mode 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": {
"port_id": "<port_id>",
"data": "<data>"
},
"name": "write_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port_id | Yes | The port identifier | |
| data | Yes | Data to write (string or hex if hex_mode is True) | |
| encoding | No | Text encoding for string data | utf-8 |
| hex_mode | No | Interpret data as hex string (e.g., '48454C4C4F') |