Class pour trame Nmea.
Dependents: Test_gps_event_vitesse_bluetooth gpsmpu60500 Test_gps_event_vitesse_bluetooth_ok
Fork of gps_event_vitesse by
Diff: gps_event_vitesse.h
- Revision:
- 0:ba9bedfe1044
diff -r 000000000000 -r ba9bedfe1044 gps_event_vitesse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gps_event_vitesse.h Mon May 16 21:40:59 2016 +0000 @@ -0,0 +1,46 @@ +#ifndef _Sf_gps_rs232_ +#define _Sf_gps_rs232_ +#include "mbed.h" +#define trame_nmea_max 84 + +const double pi = 3.14159265; +const double rayon = 6378137.0; + +class Gps : public Serial +{ +public: + Gps(PinName Txd, PinName Rxd); + void receive(); //recoit les data gps et les stocks puis produit les donnees en cas de reception + double time(); // date + double latitude(); + char ns(); // nombre satellite. + double longitude(); + char ew(); + int lock(); + int nbsattelite(); + char sample(); + float vitesse(); + char vitesse_ok(); + float vitesse_gps(); + char vitesse_gps_ok(); +private: + unsigned int _num; // nombre caractere recu dans la phrase gps en court + char _msg[trame_nmea_max+1]; // + float _time; // date + float _old_time; + float _latitude; + float _old_latitude; + char _ns; + float _longitude; + float _old_longitude; + char _ew; + int _lock; + int _old_lock; + int _nbsattelite; + char _gps_data_ok; + double _trunc(double v); + double _time_sec(double time); + float _vitesse_gps; + char _vitesse_gps_ok; +}; +#endif \ No newline at end of file