From 7d1f86949f4b72895aaf675a1f001d834160369b Mon Sep 17 00:00:00 2001 From: haller Date: Sun, 24 Apr 2005 21:27:07 +0000 Subject: Début d'implémentation des fonctions Y'a encore du boulot --- 2005/i/robert/src/es/es.cc | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to '2005/i/robert/src/es/es.cc') diff --git a/2005/i/robert/src/es/es.cc b/2005/i/robert/src/es/es.cc index b494d6d..b4aab7e 100644 --- a/2005/i/robert/src/es/es.cc +++ b/2005/i/robert/src/es/es.cc @@ -23,3 +23,61 @@ // // }}} +#include "es/es.hh" + +/// Constructeur +Es::Es (const Config & config) + :proto_(*this), vitesseAsc(/*XXX*/), couleur(/*comment on la récup?*/), jackOut(/*idem*/) +{ + init(); +} + +void Es::init(void) +{ + // On reset l'AVR + proto_.send('z'); // XXX z = reset AVR + // on récup les données de couleur_ et de jackOut(mais comment??) + proto_.sync(); +} + +bool Es::stateJack(void) +{ + proto_.sync(); + return jackOut_; // XXX Ou autre methode +} + +bool Es::capteursContact(void) +{ + proto_.sync(); + return stateCapteurs_; +} + +levelAsc Es::stateAsc(void) // XXX Probleme dans le nom +{ + proto_sync(); + return stateAsc_; +} + +void Es::moveAsc(levelAsc niveau) +{ + proto.sync(); + if(niveau == HAUT) + proto_.send('a',"b",2); + else if(niveau == MILIEU) + proto_.send('a',"b",1); + else + proto_.send('a',"b",0); + ascIdle_ == false; +} + +void Es::ventouses(void) +{ + proto_.sync(); + proto_.send('v'); +} + +void receive(char command, const Proto::Frame & frame) +{ + // XXX Voir comment on fait +} + -- cgit v1.2.3