write_and_read
Send a command to a connected serial port and receive the response, with optional waiting for a specific prompt and configurable timeout.
Instructions
シリアルポートにコマンドを送信し、応答を受信して返す。 事前に connect を実行しておくこと。 行末には connect で設定した line_ending が自動付加される。 wait_for にプロンプト文字列(例: "> ")を指定すると、 その文字列が受信データに現れるまで待機する。 送受信データはすべてログファイルに記録される。
Args: command: 送信する文字列 wait_for: この文字列が出現するまで受信を待機する(省略可) timeout: 最大待機時間(秒)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| timeout | No | ||
| wait_for | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |