Library for the EM-406 GPS module

Fork of GPS by Simon Ford

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GPS.h Source File

GPS.h

00001 #include "mbed.h"
00002 
00003 #ifndef MBED_GPS_H
00004 
00005 #define MBED_GPS_H
00006 
00007 /**  A GPS interface for reading from a Globalsat EM-406 GPS Module */
00008 class GPS {
00009 public:
00010     /* Create the GPS interface, connected to the specified serial port*/
00011      GPS(PinName tx, PinName rx);
00012      /* 
00013      Sample the incoming GPS data, returning whether there is a lock
00014      @return 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0
00015      */
00016     int sample();
00017     float old_sz,old_h,tav,vit,start,delta_t;
00018     struct data {
00019      int ora,perc,masodperc;
00020      char flag;
00021      float szel;
00022      char szb;
00023      float hossz;
00024      char hb;
00025      float sebesseg;
00026      float magassag;
00027      int ev,honap,nap;
00028     } poz;
00029     float tavolsag(float h1,float sz1,float h2,float sz2);
00030     
00031 private:
00032     void getline();
00033     void nincs_adat();
00034        
00035     Serial _gps;
00036     char msg[256];
00037 
00038 };
00039 
00040 #endif