Skip to content

Commit

Permalink
use the new get all matches function in the example code
Browse files Browse the repository at this point in the history
  • Loading branch information
noah1510 committed Dec 15, 2023
1 parent 8b0b7ea commit f0646fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions samples/readInfinite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ int main (int argc, char **argv) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));

//get the first match of the pattern in the read buffer
auto result = rs232_interface.retrieveFirstMatch(pattern);
//auto result = rs232_interface.retrieveFirstMatch(pattern);
auto result = rs232_interface.retrieveAllMatches(pattern);

//don't output anything if there is no match
if (result.empty()) {
continue;
}

//output the result to the console
std::cout << result << std::endl;
for(const auto& res : result){
std::cout << res << std::endl;
}
}
}else{
while(true){
Expand Down

0 comments on commit f0646fe

Please sign in to comment.