From 2092461fd47d0cbab749529ba18ee894e1fe6e50 Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 10 Apr 2005 00:29:15 +0000 Subject: test_proto version pas light. Add: Proto::wait. --- 2005/i/robert/src/proto/proto.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to '2005/i/robert/src/proto/proto.cc') 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) -- cgit v1.2.3