通信データの記録クラス More...
#include <ConnectionRecorder.h>

Public Types | |
| enum | { NoTimeout = -1 } |
Public Member Functions | |
| ConnectionRecorder (Connection *con) | |
| const char * | what (void) const |
| 内部状態を返す | |
| bool | connect (const char *device, long baudrate) |
| デバイスへの接続 | |
| void | disconnect (void) |
| 切断 | |
| bool | setBaudrate (long baudrate) |
| ボーレートの変更 | |
| long | baudrate (void) const |
| ボーレートを返す | |
| bool | isConnected (void) const |
| 接続状態を返す | |
| int | send (const char *data, size_t count) |
| 送信 | |
| int | receive (char *data, size_t count, int timeout) |
| 受信 | |
| size_t | size (void) const |
| 受信済みデータのバイト数を返す | |
| void | flush (void) |
| バッファの内容を強制的に出力する | |
| void | clear (void) |
| 送受信データのクリア | |
| void | ungetc (const char ch) |
| 1文字書き戻す | |
| void | setBasename (const char *basename) |
| 記録用のファイル名を変更する | |
通信データの記録クラス
Definition at line 22 of file ConnectionRecorder.h.
| const char * ConnectionRecorder::what | ( | void | ) | const [virtual] |
内部状態を返す
Implements qrk::Connection.
Definition at line 68 of file ConnectionRecorder.cpp.
| bool ConnectionRecorder::connect | ( | const char * | device, |
| long | baudrate | ||
| ) | [virtual] |
デバイスへの接続
| [in] | device | 接続デバイス名 |
| [in] | baudrate | 接続ボーレート |
| true | 成功 |
| false | 失敗 |
Implements qrk::Connection.
Definition at line 74 of file ConnectionRecorder.cpp.
| void ConnectionRecorder::disconnect | ( | void | ) | [virtual] |
| bool ConnectionRecorder::setBaudrate | ( | long | baudrate | ) | [virtual] |
ボーレートの変更
| [in] | baudrate | ボーレート |
| 0 | 正常 |
| < | 0 エラー |
Implements qrk::Connection.
Definition at line 86 of file ConnectionRecorder.cpp.
| long ConnectionRecorder::baudrate | ( | void | ) | const [virtual] |
ボーレートを返す
| ボーレート |
Implements qrk::Connection.
Definition at line 92 of file ConnectionRecorder.cpp.
| bool ConnectionRecorder::isConnected | ( | void | ) | const [virtual] |
接続状態を返す
| true | 接続中 |
| false | 切断中 |
Implements qrk::Connection.
Definition at line 98 of file ConnectionRecorder.cpp.
| int ConnectionRecorder::send | ( | const char * | data, |
| size_t | count | ||
| ) | [virtual] |
送信
| [in] | data | 送信データ |
| [in] | count | 送信バイト数 |
Implements qrk::Connection.
Definition at line 104 of file ConnectionRecorder.cpp.
| int ConnectionRecorder::receive | ( | char * | data, |
| size_t | count, | ||
| int | timeout | ||
| ) | [virtual] |
受信
| [out] | data | 受信用バッファ |
| [in] | count | 受信バッファの最大サイズ |
| [in] | timeout | タイムアウト時間 [msec] |
Implements qrk::Connection.
Definition at line 116 of file ConnectionRecorder.cpp.
| size_t ConnectionRecorder::size | ( | void | ) | const [virtual] |
受信済みデータのバイト数を返す
Implements qrk::Connection.
Definition at line 136 of file ConnectionRecorder.cpp.
| void ConnectionRecorder::flush | ( | void | ) | [virtual] |
| void ConnectionRecorder::clear | ( | void | ) | [virtual] |
送受信データのクリア
送信バッファ、受信済みデータをクリアする
Implements qrk::Connection.
Definition at line 148 of file ConnectionRecorder.cpp.
| void ConnectionRecorder::ungetc | ( | const char | ch | ) | [virtual] |
1文字書き戻す
| [in] | ch | 書き戻す文字 |
Implements qrk::Connection.
Definition at line 154 of file ConnectionRecorder.cpp.
| void ConnectionRecorder::setBasename | ( | const char * | basename | ) |
記録用のファイル名を変更する
以降の送受信データは、以下の2つのファイル名に出力される
| [in] | basename | ファイルの基本名 |
Definition at line 161 of file ConnectionRecorder.cpp.
1.7.6.1-20120122