Projet S5 Info / Mbed 2 deprecated Projet-xbee-mbed_fixe

Dependencies:   mbed

Fork of APP4 by S5info_H14

Files at this revision

API Documentation at this revision

Comitter:
RufflesAllD
Date:
Tue Apr 29 16:27:28 2014 +0000
Parent:
7:a6f58e5d1188
Commit message:
commentaires

Changed in this revision

coordinateur.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
trame.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a6f58e5d1188 -r ecc7c75a37ee coordinateur.cpp
--- a/coordinateur.cpp	Wed Apr 09 19:16:59 2014 +0000
+++ b/coordinateur.cpp	Tue Apr 29 16:27:28 2014 +0000
@@ -29,10 +29,11 @@
 {
     if (xbee.readable())
     {
-        etatTrame(xbee.getc());
+        etatTrame(xbee.getc()); // Envoie les char recu en sans-fil dans la machine à état
     }
 }
 
+// Machine à état qui reconstruit la trame
 void Coordinateur::etatTrame(char c)
 {
     switch (etat)
@@ -73,15 +74,15 @@
             else
             {
                 //trame.checkTrame(data, c, length_int);
-                pc.putc(0xFF);
-                wait(0.1);
-                pc.putc(data[12]);
-                wait(0.1);
-                pc.putc(data[13]);
-                wait(0.1);
-                pc.putc(data[14]);
-                wait(0.1);
-                pc.putc(data[15]);
+                pc.putc(0xFF);      // delimiter pour l'application sur l'ordinateur
+                wait(0.1);          // 
+                pc.putc(data[12]);  // 
+                wait(0.1);          // 
+                pc.putc(data[13]);  // envoie sur le port usb des 4 char déterminant le code du mouvement à exécuter
+                wait(0.1);          // 
+                pc.putc(data[14]);  // 
+                wait(0.1);          // 
+                pc.putc(data[15]);  // 
                 etat = Start;
             }
             break;
diff -r a6f58e5d1188 -r ecc7c75a37ee main.cpp
--- a/main.cpp	Wed Apr 09 19:16:59 2014 +0000
+++ b/main.cpp	Tue Apr 29 16:27:28 2014 +0000
@@ -2,14 +2,14 @@
 
 int main()
 {
-    Coordinateur coord(p13, p14);
+    Coordinateur coord(p13, p14);   // Initialiaze the coordonator
     
-    //coord.setPanID("ACE");
+    //coord.setPanID("ACE");  // Set PAN ID
     
     wait(2);
     
     while(true)
     {
-        coord.getBytes();   // Attend pour recevoir les trames
+        coord.getBytes();   // Wait to recieve new data to put on the usb port
     }
 }
diff -r a6f58e5d1188 -r ecc7c75a37ee trame.cpp
--- a/trame.cpp	Wed Apr 09 19:16:59 2014 +0000
+++ b/trame.cpp	Tue Apr 29 16:27:28 2014 +0000
@@ -30,6 +30,7 @@
     delete trm;
 }
 
+// Calcul du crc8
 unsigned char Trame::crc8(const char* data, int length)
 {
     unsigned char crc = 0;
@@ -39,6 +40,7 @@
     return (0xFF - crc);
 }
 
+// fonction de debugage pour afficher toutes les informations sortie de la trame reçue
 void Trame::checkTrame(char *data, char check, int length)
 {
     Serial pc(USBTX, USBRX);