serial_read
Retrieve output from an active serial shell session to inspect command responses or logs, with an option to clear the received data after reading.
Instructions
Read output from a serial shell session. Do NOT call this concurrently with serial_exec/serial_write on the same session_id — concurrent access to the same serial console corrupts the output buffer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Buffer clear flag: 1 (default) = clear buffer after reading, 0 = keep buffer | |
| session_id | Yes | The session ID returned by serial_open |