serial.write
Write data to a serial port, specifying encoding, newline appending, and data format (text, hex, or base64). Returns the number of bytes written.
Instructions
Write data to a serial port. Returns the number of bytes written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection_id | Yes | ||
| data | Yes | Data to write. | |
| encoding | No | Override encoding for this call (defaults to connection encoding). | |
| append_newline | No | Append the connection's newline character after data (default false). | |
| newline | No | Override newline for append_newline (defaults to connection newline). | |
| as | No | How to interpret 'data': text (encode with encoding), hex, or base64. | text |