detect_baud
Determine a serial device's baud rate by probing common rates and ranking replies by readable text clarity.
Instructions
Try common baud rates on a closed port and rank them by how readable the reply is. Use when the user doesn't know the device's rate.
Each candidate is opened briefly, probe (default: a bare return) is sent, and
whatever comes back is scored by its share of printable text. The right rate
yields clean text; wrong rates yield garbage or nothing. Note: opening a port
resets many Arduinos (DTR), and some devices (Kenwood CAT) only answer a real
command, so pass e.g. probe="ID;" with probe_line_ending="NONE".
Args: port: The port to probe (must not be open here). probe: Text to send at each rate. Empty sends only the line ending. probe_line_ending: Line ending appended to the probe ("NONE" for CAT). candidates: Rates to try. Default: 9600, 115200, 19200, 38400, 57600, 4800, 2400, 1200, 230400. settle: Seconds to wait for a reply at each rate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | ||
| probe | No | ||
| settle | No | ||
| candidates | No | ||
| probe_line_ending | No | CR |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |