Allows for a GPS module to be connected to a serial port and exposes an easy to use API to get the GPS data. New feature, added Mbed/LPC17xx RTC synchronisation
Fork of MODGPS by
GPS_Geodetic.h@6:64771e31464e, 2011-04-21 (annotated)
- Committer:
- AjK
- Date:
- Thu Apr 21 14:06:17 2011 +0000
- Revision:
- 6:64771e31464e
- Parent:
- 0:db98027c0bbb
1.16 See ChangeLog.c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AjK | 0:db98027c0bbb | 1 | /* |
AjK | 0:db98027c0bbb | 2 | Copyright (c) 2010 Andy Kirkham |
AjK | 0:db98027c0bbb | 3 | |
AjK | 0:db98027c0bbb | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy |
AjK | 0:db98027c0bbb | 5 | of this software and associated documentation files (the "Software"), to deal |
AjK | 0:db98027c0bbb | 6 | in the Software without restriction, including without limitation the rights |
AjK | 0:db98027c0bbb | 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
AjK | 0:db98027c0bbb | 8 | copies of the Software, and to permit persons to whom the Software is |
AjK | 0:db98027c0bbb | 9 | furnished to do so, subject to the following conditions: |
AjK | 0:db98027c0bbb | 10 | |
AjK | 0:db98027c0bbb | 11 | The above copyright notice and this permission notice shall be included in |
AjK | 0:db98027c0bbb | 12 | all copies or substantial portions of the Software. |
AjK | 0:db98027c0bbb | 13 | |
AjK | 0:db98027c0bbb | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
AjK | 0:db98027c0bbb | 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
AjK | 0:db98027c0bbb | 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
AjK | 0:db98027c0bbb | 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
AjK | 0:db98027c0bbb | 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
AjK | 0:db98027c0bbb | 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
AjK | 0:db98027c0bbb | 20 | THE SOFTWARE. |
AjK | 0:db98027c0bbb | 21 | */ |
AjK | 0:db98027c0bbb | 22 | |
AjK | 0:db98027c0bbb | 23 | #ifndef GPS_GEODETIC_H |
AjK | 0:db98027c0bbb | 24 | #define GPS_GEODETIC_H |
AjK | 0:db98027c0bbb | 25 | |
AjK | 0:db98027c0bbb | 26 | #include "mbed.h" |
AjK | 0:db98027c0bbb | 27 | |
AjK | 0:db98027c0bbb | 28 | /** GPS_Geodetic definition. |
AjK | 0:db98027c0bbb | 29 | */ |
AjK | 0:db98027c0bbb | 30 | class GPS_Geodetic { |
AjK | 0:db98027c0bbb | 31 | public: |
AjK | 0:db98027c0bbb | 32 | |
AjK | 0:db98027c0bbb | 33 | //! double The latitude |
AjK | 0:db98027c0bbb | 34 | double lat; |
AjK | 0:db98027c0bbb | 35 | |
AjK | 0:db98027c0bbb | 36 | //! double The longitude |
AjK | 0:db98027c0bbb | 37 | double lon; |
AjK | 0:db98027c0bbb | 38 | |
AjK | 0:db98027c0bbb | 39 | //! double The altitude |
AjK | 0:db98027c0bbb | 40 | double alt; |
AjK | 0:db98027c0bbb | 41 | |
AjK | 0:db98027c0bbb | 42 | int num_of_gps_sats; |
AjK | 0:db98027c0bbb | 43 | int gps_satellite_quality; |
AjK | 0:db98027c0bbb | 44 | GPS_Geodetic() { lat = 0.0; lon = 0.0; alt = 0.0; } |
AjK | 0:db98027c0bbb | 45 | |
AjK | 0:db98027c0bbb | 46 | int numOfSats(void) { return num_of_gps_sats; } |
AjK | 0:db98027c0bbb | 47 | int getGPSquality(void) { return gps_satellite_quality; } |
AjK | 0:db98027c0bbb | 48 | void nmea_gga(char *s); |
AjK | 0:db98027c0bbb | 49 | double convert_lat_coord(char *s, char north_south); |
AjK | 0:db98027c0bbb | 50 | double convert_lon_coord(char *s, char east_west); |
AjK | 0:db98027c0bbb | 51 | double convert_height(char *s); |
AjK | 0:db98027c0bbb | 52 | }; |
AjK | 0:db98027c0bbb | 53 | |
AjK | 0:db98027c0bbb | 54 | #endif |
AjK | 0:db98027c0bbb | 55 |