serial_open
Open a serial port such as COM3 or /dev/ttyUSB0 and return a handle for reading or writing embedded hardware; configure baud rate, data bits, parity, and stop bits.
Instructions
打开串口,返回句柄 handle。port 形如 "COM3" 或 "/dev/ttyUSB0"。 波特率不确定就先用 115200(STM32 HAL 默认)或 9600(老例程/模块默认)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | ||
| parity | No | N | |
| baudrate | No | ||
| data_bits | No | ||
| stop_bits | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |