serial_write_hex
Write raw hex bytes to a serial port for binary protocols like Modbus, bootloader commands, or firmware upload. Provides exact byte-level control without newline appended.
Instructions
Write raw bytes (specified as hex) to the serial port.
Use this for binary protocols (Modbus, bootloader commands, firmware upload, raw UART framing) where you need exact byte-level control. No newline is appended.
Examples: - Send Modbus query: serial_write_hex(hex_string="01 03 00 00 00 0A C5 CD") - Send break byte: serial_write_hex(hex_string="FF") - STM32 bootloader: serial_write_hex(hex_string="7F")
Args: hex_string: Hex-encoded bytes separated by spaces (e.g. "AA 55 01 03 FF") session_id: Port name of the session. Optional if only one session is open.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex_string | Yes | ||
| session_id | No |