serial_write
Send data to a serial port device using a specified encoding. Requires an open connection ID and the data string; returns the number of bytes written or an error if the connection is invalid.
Instructions
Write data to a serial port connection.
Writes the specified data string to the serial port using the specified encoding.
Args: params (WriteDataInput): Validated input parameters containing: - connection_id (str): Connection ID returned by serial_open - data (str): Data to write as a string - encoding (str): Text encoding (default: 'utf-8') - timeout (float): Write timeout in seconds (default: 5.0)
Returns: str: Success message with bytes written or error message.
Success response: "Wrote 12 bytes to conn_1" Error response: "Error: Connection 'conn_1' not found or not open"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |