summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/proto/proto.cc
diff options
context:
space:
mode:
authorschodet2005-04-10 00:29:15 +0000
committerschodet2005-04-10 00:29:15 +0000
commit2092461fd47d0cbab749529ba18ee894e1fe6e50 (patch)
tree12b15364419306915940287c78e377ec2c584eef /2005/i/robert/src/proto/proto.cc
parente46b1d36099f8792f88b77ee42730de2ecf93c26 (diff)
test_proto version pas light.
Add: Proto::wait.
Diffstat (limited to '2005/i/robert/src/proto/proto.cc')
-rw-r--r--2005/i/robert/src/proto/proto.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/2005/i/robert/src/proto/proto.cc b/2005/i/robert/src/proto/proto.cc
index 3a35ec3..20727a2 100644
--- a/2005/i/robert/src/proto/proto.cc
+++ b/2005/i/robert/src/proto/proto.cc
@@ -179,6 +179,16 @@ Proto::decode (const Frame &frame, const char *format, int &a0,
return true;
}
+/// Attend que des caractères soit disponible pendant un temps maximum en
+/// milliseconde et les traite. Renvois le résultat de sync (). Attention,
+/// fonction bloquante, n'utiliser que pour les tests.
+bool
+Proto::wait (int timeout/*-1*/)
+{
+ serial_.wait (timeout);
+ return sync ();
+}
+
/// Récupère les infos de l'AVR pour construire une frame
bool
Proto::getFrame(void)