Kart  1.1
BTS SN-IR La Salle Avignon 2018
communication.h
Aller à la documentation de ce fichier.
00001 #ifndef RECEPTION_H
00002 #define RECEPTION_H
00003 
00010 #include <QObject>
00011 #include <QStringList>
00012 #include "qextserialport.h"
00013 #include "telemetrie.h"
00014 
00015 #define PORT "/dev/ttyUSB0"     
00017 // Les numéros de champs
00018 #define CHAMP_IDKART        0   
00019 #define CHAMP_TEMPERATURE   1   
00020 #define CHAMP_TENSION       2   
00021 #define CHAMP_COURANT       3   
00022 #define CHAMP_VITESSE       4   
00023 #define CHAMP_CHARGE        5   
00035 class Communication : public QObject
00036 {
00037     Q_OBJECT
00038 
00039     private:
00040         QextSerialPort *port; 
00041         QString idKart;
00042         QString trame; 
00043         //QStringList trames;
00044 
00050         void creerPort();
00056         void ouvrirPort();
00062         void configurerPort();
00070         bool verifierTrame(QString &donneesLues);
00076         void extraireDonnees();
00082         void fermerPort();
00083 
00084     public:
00085         Communication(QObject *parent = 0);
00086         ~Communication();
00087 
00088         QString getIdKart();
00089         void setIdKart(QString idKart);
00090 
00091     signals:
00098         void nouvelEchantillon(Echantillon echantillon);
00099 
00100     public slots:
00106         void recevoir();
00107 };
00108 
00109 #endif // RECEPTION_H
 Tout Classes Fichiers Fonctions Variables Macros