Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Repo_Noeud_Mobile by
Diff: Communication/Xbee.cpp
- Revision:
- 24:1a16e7eabb0c
- Parent:
- 23:5bb76b7c35da
- Child:
- 30:389d09853cd1
- Child:
- 31:658b90e226b9
--- a/Communication/Xbee.cpp Thu Mar 26 15:40:56 2015 +0000 +++ b/Communication/Xbee.cpp Thu Mar 26 17:08:26 2015 +0000 @@ -95,9 +95,10 @@ } //Le noeud mobile va recevoir certaines informations comme le type de jeux et les signaux de depart/fin de parties +//Structure de reception sera Fixe_Vers_Mobile void Xbee::Recevoir() { - Mobile_Vers_Fixe receivedData; + Fixe_Vers_Mobile receivedData; int index = 0; char buffer[8]; while(true) { @@ -119,27 +120,18 @@ index++; } while (index != 13); - //GantsID - receivedData.gants = XbeePin->getc(); - - //AccelData - receivedData.accelData.x = XbeePin->getc(); - receivedData.accelData.y = XbeePin->getc(); - receivedData.accelData.z = XbeePin->getc(); + //Game + receivedData.game = XbeePin->getc(); - //Should be the byte containing the states of the flexo - receivedData.flexSensor.index = XbeePin->getc(); - receivedData.flexSensor.majeur = XbeePin->getc(); - receivedData.flexSensor.annulaire = XbeePin->getc(); -#if VALEURFLEX - receivedData.flexSensor.indexU32 = XbeePin->getc(); - receivedData.flexSensor.majeurU32 = XbeePin->getc(); - receivedData.flexSensor.annulaireU32 = XbeePin->getc(); -#endif + //Etat + buffer[0] = XbeePin->getc(); + receivedData.etat = buffer[0] == 0 ? false : true; + + //Est-ce qu'il y a un minimum de byte dans les data? //Validate end byte if (XbeePin->getc() == 0x7E) { - message *emile = Mailbox.alloc(); + message_vers_mobile *emile = Mailbox.alloc(); // Verifier si mail pointe pas vers 0 [boite pleine] while (emile == 0) {