From 792e6bf0b476a778e3b3fb4fcdb3aa4202654175 Mon Sep 17 00:00:00 2001 From: haller Date: Wed, 4 May 2005 11:35:46 +0000 Subject: Codage de getFd --- 2005/i/robert/src/asserv/asserv.cc | 6 ++++++ 2005/i/robert/src/asserv/asserv.hh | 2 ++ 2005/i/robert/src/es/es.cc | 6 ++++++ 2005/i/robert/src/es/es.hh | 2 ++ 2005/i/robert/src/motor/motor.cc | 6 ++++++ 2005/i/robert/src/motor/motor.hh | 2 ++ 2005/i/robert/src/proto/proto.cc | 6 ++++++ 2005/i/robert/src/proto/proto.hh | 3 +++ 8 files changed, 33 insertions(+) diff --git a/2005/i/robert/src/asserv/asserv.cc b/2005/i/robert/src/asserv/asserv.cc index ea82b57..662e52f 100644 --- a/2005/i/robert/src/asserv/asserv.cc +++ b/2005/i/robert/src/asserv/asserv.cc @@ -76,6 +76,12 @@ bool Asserv::wait(int timeout) return proto_.wait(timeout); } +/// Récupère le File Descriptor +int Asserv::getFd(void) +{ + return proto_.getFd(); +} + /// Commandes d'asservissement void Asserv::linearMove(double distance) { diff --git a/2005/i/robert/src/asserv/asserv.hh b/2005/i/robert/src/asserv/asserv.hh index de135c3..07bb731 100644 --- a/2005/i/robert/src/asserv/asserv.hh +++ b/2005/i/robert/src/asserv/asserv.hh @@ -101,6 +101,8 @@ class Asserv : public NonCopyable, public Proto::Receiver bool sync (void); /// Attend que toute les émissions soit terminées. bool wait (int timeout = -1); + /// Récupère le File Descriptor + int getFd(void); /// Commandes asservissement void linearMove(double distance); void angularMove(double angle); diff --git a/2005/i/robert/src/es/es.cc b/2005/i/robert/src/es/es.cc index 3673fb3..c9ca801 100644 --- a/2005/i/robert/src/es/es.cc +++ b/2005/i/robert/src/es/es.cc @@ -95,6 +95,12 @@ void Es::wait(int timeout) proto_.wait(timeout); } +/// Récupère le File Descriptor +int Es::getFd(void) +{ + return proto_.getFd(); +} + void Es::loadConfig(const Config & config) { tty_ = config.get("es.tty"); diff --git a/2005/i/robert/src/es/es.hh b/2005/i/robert/src/es/es.hh index 6bb0fc4..ebe9c9f 100644 --- a/2005/i/robert/src/es/es.hh +++ b/2005/i/robert/src/es/es.hh @@ -83,6 +83,8 @@ class Es : public Proto::Receiver void ventouses(void); /// On attend ... void wait(int timeout); + /// Récupère le File Descriptor + int getFd(void); /// Charge les paramètre du fichier de config void loadConfig(const Config & config); /// définition du receiver::receive diff --git a/2005/i/robert/src/motor/motor.cc b/2005/i/robert/src/motor/motor.cc index a9f90bf..fb4a6dd 100644 --- a/2005/i/robert/src/motor/motor.cc +++ b/2005/i/robert/src/motor/motor.cc @@ -178,6 +178,12 @@ void Motor::wait(int timeout) asserv_.wait(timeout); } +/// Récupère le File Descriptor +int Motor::getFd(void) +{ + return asserv_.getFd(); +} + bool Motor::jackState(void) { pinUpdated_ = false; diff --git a/2005/i/robert/src/motor/motor.hh b/2005/i/robert/src/motor/motor.hh index 6080850..79af4d8 100644 --- a/2005/i/robert/src/motor/motor.hh +++ b/2005/i/robert/src/motor/motor.hh @@ -93,6 +93,8 @@ class Motor : public Asserv::Receiver bool sync(void); /// On attend... void wait(int timeout); + /// Récupère le File Descriptor + int getFd(void); /// Retoure l'état du jack (false entrée et true sortie) bool jackState(void); /// Retourne la couleur selectionné diff --git a/2005/i/robert/src/proto/proto.cc b/2005/i/robert/src/proto/proto.cc index 5fc9265..4e04c83 100644 --- a/2005/i/robert/src/proto/proto.cc +++ b/2005/i/robert/src/proto/proto.cc @@ -200,6 +200,12 @@ Proto::wait (int timeout/*-1*/) return serial_.wait (timeout < timeout_ ? timeout : timeout_); } +/// Récupère le File Descriptor +int Proto::getFd(void) +{ + return serial_.getFd(); +} + /// Récupère les infos de l'AVR pour construire une frame bool Proto::getFrame(void) diff --git a/2005/i/robert/src/proto/proto.hh b/2005/i/robert/src/proto/proto.hh index 163c44c..11b1ae3 100644 --- a/2005/i/robert/src/proto/proto.hh +++ b/2005/i/robert/src/proto/proto.hh @@ -102,6 +102,9 @@ class Proto : public NonCopyable /// milliseconde et les traite. Renvois le résultat de sync (). Attention, /// fonction bloquante, n'utiliser que pour les tests. bool wait (int timeout = -1); + /// Récupère le File Descriptor + int getFd(void); + public: /// Les clients de Proto doivent dériver de Receiver. class Receiver -- cgit v1.2.3