Stream.findUntil()

名称

Stream.findUntil()

説明

Stream.findUntil()は、指定した長さの文字列もしくは指定した終端文字列が見つかるまでストリームからデータを読むか、タイムアウトする(Stream.setTimeout()参照)。

指定した文字列が見つかればtrueを返し、文字列が見つからずにタイムアウトすればfalseを返す。

この関数はStreamクラスの一部であり、このクラスを継承したすべてのクラス(例えばWireやSerialなど)から呼び出すことができる。Streamのメインページにより多くの情報があるので参照のこと。

書式

bool findUntil(char *target, char *terminator);

bool findUntil(uint8_t *target, char *terminator)

bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen);

bool findUntil(uint8_t *target, size_t targetLen, char *terminate, size_t termLen)

引数

target検索対象の文字列。
terminator, terminate 検索する終端文字列。
targetLen 検索文字列の長さ。
termLen 終端文字列の長さ。

戻り値

指定した文字列が見つかればtrue、文字列が見つからずにタイムアウトすればfalse。

参照

オリジナルのページ

https://www.arduino.cc/reference/en/language/functions/communication/stream/streamfinduntil/

Last Revision: 2019/02/21

実装の解析

まだ解析していません。

最終更新日

January 4, 2024

inserted by FC2 system