starting integration with XBee
Dependencies: SDFileSystem mbed
nmea.h@4:70411c8dadcc, 2016-03-22 (annotated)
- Committer:
- jphbergeson
- Date:
- Tue Mar 22 17:08:13 2016 +0000
- Revision:
- 4:70411c8dadcc
- Parent:
- 0:26713d1db198
Publishing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jphbergeson | 0:26713d1db198 | 1 | #include "mbed.h" |
jphbergeson | 0:26713d1db198 | 2 | |
jphbergeson | 0:26713d1db198 | 3 | // latitude is N/S, has 2 digits |
jphbergeson | 0:26713d1db198 | 4 | // longitude is E/W, has 3 digits |
jphbergeson | 0:26713d1db198 | 5 | struct NMEA_data { |
jphbergeson | 0:26713d1db198 | 6 | // time |
jphbergeson | 0:26713d1db198 | 7 | int hours; |
jphbergeson | 0:26713d1db198 | 8 | int minutes; |
jphbergeson | 0:26713d1db198 | 9 | int seconds; |
jphbergeson | 0:26713d1db198 | 10 | |
jphbergeson | 0:26713d1db198 | 11 | // date |
jphbergeson | 0:26713d1db198 | 12 | int day; |
jphbergeson | 0:26713d1db198 | 13 | int month; |
jphbergeson | 0:26713d1db198 | 14 | int year; |
jphbergeson | 0:26713d1db198 | 15 | |
jphbergeson | 0:26713d1db198 | 16 | // location |
jphbergeson | 0:26713d1db198 | 17 | int longitude; |
jphbergeson | 0:26713d1db198 | 18 | double longitude_minutes; |
jphbergeson | 0:26713d1db198 | 19 | char longitude_direction; |
jphbergeson | 0:26713d1db198 | 20 | int latitude; |
jphbergeson | 0:26713d1db198 | 21 | double latitude_minutes; |
jphbergeson | 0:26713d1db198 | 22 | char latitude_direction; |
jphbergeson | 0:26713d1db198 | 23 | |
jphbergeson | 0:26713d1db198 | 24 | // A = active (has lock), V = void (no lock) |
jphbergeson | 0:26713d1db198 | 25 | char lock_flag; |
jphbergeson | 0:26713d1db198 | 26 | |
jphbergeson | 0:26713d1db198 | 27 | // bearing |
jphbergeson | 0:26713d1db198 | 28 | double speed; |
jphbergeson | 0:26713d1db198 | 29 | double tracking_angle; |
jphbergeson | 0:26713d1db198 | 30 | }; |
jphbergeson | 0:26713d1db198 | 31 | |
jphbergeson | 0:26713d1db198 | 32 | void get_nmea(Serial *s, char *buffer, int buflen); |
jphbergeson | 0:26713d1db198 | 33 | void get_line(Serial *s, char *buffer, int buflen); |
jphbergeson | 0:26713d1db198 | 34 | |
jphbergeson | 0:26713d1db198 | 35 | struct NMEA_data empty_nmea(); |
jphbergeson | 0:26713d1db198 | 36 | |
jphbergeson | 0:26713d1db198 | 37 | struct NMEA_data parse_line(char *str); |