Allows for a GPS module to be connected to a serial port and exposes an easy to use API to get the GPS data.
Fork of MODGPS by
GPS_VTG.h@2:8aa059e7d8b1, 2011-04-15 (annotated)
- Committer:
- AjK
- Date:
- Fri Apr 15 12:23:52 2011 +0000
- Revision:
- 2:8aa059e7d8b1
- Child:
- 3:28a1b60b0f37
1.12 See ChangeLog.c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AjK | 2:8aa059e7d8b1 | 1 | /* |
AjK | 2:8aa059e7d8b1 | 2 | Copyright (c) 2010 Andy Kirkham |
AjK | 2:8aa059e7d8b1 | 3 | |
AjK | 2:8aa059e7d8b1 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy |
AjK | 2:8aa059e7d8b1 | 5 | of this software and associated documentation files (the "Software"), to deal |
AjK | 2:8aa059e7d8b1 | 6 | in the Software without restriction, including without limitation the rights |
AjK | 2:8aa059e7d8b1 | 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
AjK | 2:8aa059e7d8b1 | 8 | copies of the Software, and to permit persons to whom the Software is |
AjK | 2:8aa059e7d8b1 | 9 | furnished to do so, subject to the following conditions: |
AjK | 2:8aa059e7d8b1 | 10 | |
AjK | 2:8aa059e7d8b1 | 11 | The above copyright notice and this permission notice shall be included in |
AjK | 2:8aa059e7d8b1 | 12 | all copies or substantial portions of the Software. |
AjK | 2:8aa059e7d8b1 | 13 | |
AjK | 2:8aa059e7d8b1 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
AjK | 2:8aa059e7d8b1 | 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
AjK | 2:8aa059e7d8b1 | 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
AjK | 2:8aa059e7d8b1 | 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
AjK | 2:8aa059e7d8b1 | 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
AjK | 2:8aa059e7d8b1 | 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
AjK | 2:8aa059e7d8b1 | 20 | THE SOFTWARE. |
AjK | 2:8aa059e7d8b1 | 21 | */ |
AjK | 2:8aa059e7d8b1 | 22 | |
AjK | 2:8aa059e7d8b1 | 23 | #ifndef GPS_VTG_H |
AjK | 2:8aa059e7d8b1 | 24 | #define GPS_VTG_H |
AjK | 2:8aa059e7d8b1 | 25 | |
AjK | 2:8aa059e7d8b1 | 26 | #include "mbed.h" |
AjK | 2:8aa059e7d8b1 | 27 | |
AjK | 2:8aa059e7d8b1 | 28 | /** GPS_Time definition. |
AjK | 2:8aa059e7d8b1 | 29 | */ |
AjK | 2:8aa059e7d8b1 | 30 | class GPS_VTG { |
AjK | 2:8aa059e7d8b1 | 31 | public: |
AjK | 2:8aa059e7d8b1 | 32 | |
AjK | 2:8aa059e7d8b1 | 33 | //! The velocity (in knots) |
AjK | 2:8aa059e7d8b1 | 34 | double _velocity_knots; |
AjK | 2:8aa059e7d8b1 | 35 | //! The velocity (in kph) |
AjK | 2:8aa059e7d8b1 | 36 | double _velocity_kph; |
AjK | 2:8aa059e7d8b1 | 37 | //! The track (in decimal degrees true) |
AjK | 2:8aa059e7d8b1 | 38 | double _track_true; |
AjK | 2:8aa059e7d8b1 | 39 | //! The track (in decimal degrees magnetic) |
AjK | 2:8aa059e7d8b1 | 40 | double _track_mag; |
AjK | 2:8aa059e7d8b1 | 41 | |
AjK | 2:8aa059e7d8b1 | 42 | GPS_VTG(); |
AjK | 2:8aa059e7d8b1 | 43 | GPS_VTG * vtg(GPS_VTG *n); |
AjK | 2:8aa059e7d8b1 | 44 | void nmea_vtg(char *s); |
AjK | 2:8aa059e7d8b1 | 45 | |
AjK | 2:8aa059e7d8b1 | 46 | double velocity_knots(void) { return _velocity_knots; } |
AjK | 2:8aa059e7d8b1 | 47 | double velocity_kph(void) { return _velocity_kph; } |
AjK | 2:8aa059e7d8b1 | 48 | double track_true(void) { return _track_true; } |
AjK | 2:8aa059e7d8b1 | 49 | double track_mag(void) { return _track_mag; } |
AjK | 2:8aa059e7d8b1 | 50 | |
AjK | 2:8aa059e7d8b1 | 51 | }; |
AjK | 2:8aa059e7d8b1 | 52 | |
AjK | 2:8aa059e7d8b1 | 53 | #endif |
AjK | 2:8aa059e7d8b1 | 54 |