Polytech school project. RICM4 students, see http://air.imag.fr/index.php/Projets-2016-2017-Station_de_pompage_connect%C3%A9e for more information
Dependencies: SX1272Lib mbed WakeUp
Fork of SX1272PingPong by
trame.h@17:cce0eada6d82, 2017-04-01 (annotated)
- Committer:
- chevamax
- Date:
- Sat Apr 01 12:29:59 2017 +0000
- Revision:
- 17:cce0eada6d82
- Parent:
- 15:79a78f997f18
Version finale
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chevamax | 15:79a78f997f18 | 1 | #ifndef __TRAME_H |
chevamax | 15:79a78f997f18 | 2 | #define __TRAME_H |
chevamax | 15:79a78f997f18 | 3 | |
chevamax | 15:79a78f997f18 | 4 | #include "mbed.h" |
chevamax | 17:cce0eada6d82 | 5 | #define TAILLE_TRAME_DATA 5 //octets 4+1 for null char |
chevamax | 17:cce0eada6d82 | 6 | |
chevamax | 17:cce0eada6d82 | 7 | /** |
chevamax | 17:cce0eada6d82 | 8 | * Represente une trame de donnée |
chevamax | 17:cce0eada6d82 | 9 | **/ |
chevamax | 15:79a78f997f18 | 10 | |
chevamax | 15:79a78f997f18 | 11 | class TrameData { |
chevamax | 15:79a78f997f18 | 12 | private: |
chevamax | 15:79a78f997f18 | 13 | char idEmetteur; // 1 octet |
chevamax | 17:cce0eada6d82 | 14 | char idStation; //1 octet |
chevamax | 15:79a78f997f18 | 15 | char etatPompe; //1 bit |
chevamax | 15:79a78f997f18 | 16 | char nombreNiveau; //5 bits |
chevamax | 15:79a78f997f18 | 17 | char niveauCuve; //5 bits |
chevamax | 15:79a78f997f18 | 18 | char niveauBatterie; //4bits |
chevamax | 15:79a78f997f18 | 19 | char trame[TAILLE_TRAME_DATA]; |
chevamax | 15:79a78f997f18 | 20 | |
chevamax | 15:79a78f997f18 | 21 | public: |
chevamax | 17:cce0eada6d82 | 22 | //Creer un objet trame a partir de parametres |
chevamax | 17:cce0eada6d82 | 23 | TrameData(char idE, char idS, int nbNiveau, char etatP, char niveau, char batterie); |
chevamax | 17:cce0eada6d82 | 24 | //Creer un objet trame a partir d'un tableau de caracteres (ici le buffer) |
chevamax | 15:79a78f997f18 | 25 | char* creerTrame(); |
chevamax | 17:cce0eada6d82 | 26 | |
chevamax | 17:cce0eada6d82 | 27 | //Mise a jour des differents champs |
chevamax | 15:79a78f997f18 | 28 | void mettreAJourEtatPompe(char etatP); |
chevamax | 15:79a78f997f18 | 29 | void mettreAJourNiveauCuve(char niveau); |
chevamax | 15:79a78f997f18 | 30 | void mettreAJourNiveauBatterie(char niveau); |
chevamax | 15:79a78f997f18 | 31 | }; |
chevamax | 15:79a78f997f18 | 32 | |
chevamax | 15:79a78f997f18 | 33 | #endif // __TRAME_H |