summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/proto/proto.hh
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/proto/proto.hh')
-rw-r--r--2005/i/robert/src/proto/proto.hh13
1 files changed, 7 insertions, 6 deletions
diff --git a/2005/i/robert/src/proto/proto.hh b/2005/i/robert/src/proto/proto.hh
index 49c88e9..c8d0211 100644
--- a/2005/i/robert/src/proto/proto.hh
+++ b/2005/i/robert/src/proto/proto.hh
@@ -33,6 +33,7 @@
/// Classe de dialogue avec une carte électronique par le port série.
class Proto : public NonCopyable
{
+ public:
class Receiver;
/// Packet.
struct Frame
@@ -41,6 +42,7 @@ class Proto : public NonCopyable
std::vector<uint8_t> args;
bool operator==(const Frame& frame);
};
+ private:
Serial serial_;
Receiver &receiver_;
@@ -55,9 +57,8 @@ class Proto : public NonCopyable
// Etat de la réception de la frame
// 0 - Rien reçu
// 1 - Bang reçu
- // 2 - char 1 commande reçu
- // 3 - Commande reçu & nouveau argument
- // 4 - char 1 argument reçu
+ // 2 - Commande reçu & nouveau argument
+ // 3 - char 1 argument reçu
public:
/// Constructeur.
@@ -74,10 +75,10 @@ class Proto : public NonCopyable
/// Envois un packet. COMMAND est la commande à envoyer, FORMAT, donne le
/// format et le nombre de paramètres ('b' : 8 bits, 'w' : 16 bits, 'd' :
/// 32 bits, majuscule pour signé).
- void send (uint8_t command, const char *format = 0, int a0 = 0, int a1 = 0,
+ void send (char command, const char *format = 0, int a0 = 0, int a1 = 0,
int a2 = 0, int a3 = 0, bool fiable = true);
/// permet d'envoyer un packet robert
- void Proto::send_pas_fiable (uint8_t command, const char *format, int a0,
+ void Proto::send_pas_fiable (char command, const char *format, int a0,
int a1, int a2, int a3);
//@{
/// Teste si le packet correspond au format et décode les valeurs. Utilise
@@ -97,7 +98,7 @@ class Proto : public NonCopyable
{
public:
/// Recoit un packet.
- virtual void receive (uint8_t command, const Frame &frame) = 0;
+ virtual void receive (char command, const Frame &frame) = 0;
};
private:
/// Récupère les infos de l'AVR pour construire une frame