serial_read
Reads serial port data non-blocking with early exit on regex match, idle timeout, or time limit. Returns text and HEX views plus match status.
Instructions
从串口读取数据(非阻塞,三条件提前退出)。 expect:正则,命中立即返回(如 expect="OK|ERROR" 等响应); idle_ms:静默超时(板子说完就走); seconds:总时长上限。返回文本视图 + HEX 视图 + 是否命中。 读到的内容同时累积进会话日志。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expect | No | ||
| handle | Yes | ||
| idle_ms | No | ||
| seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |