GPSParser.h@1:e143afe9a7ea, 2012-03-28 (annotated)
- Committer:
- slisgrinder
- Date:
- Wed Mar 28 21:25:38 2012 +0000
- Revision:
- 1:e143afe9a7ea
- Parent:
- 0:01c9f535e512
- Child:
- 2:6f49c74ab3b9
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
slisgrinder | 1:e143afe9a7ea | 1 | #include "mbed.h" |
slisgrinder | 1:e143afe9a7ea | 2 | #include "MODSERIAL.h" |
slisgrinder | 1:e143afe9a7ea | 3 | |
slisgrinder | 1:e143afe9a7ea | 4 | class GPSParser |
slisgrinder | 1:e143afe9a7ea | 5 | { |
slisgrinder | 1:e143afe9a7ea | 6 | public: |
slisgrinder | 1:e143afe9a7ea | 7 | |
slisgrinder | 1:e143afe9a7ea | 8 | struct GPS |
slisgrinder | 1:e143afe9a7ea | 9 | { |
slisgrinder | 1:e143afe9a7ea | 10 | float latitude, lat_deg, lat_min, deg_latitude, longitude, long_deg, long_min, deg_longitude, altitude, HDOP, geoidal_sep, AODC, heading, mag_heading, speed_knots, speed_kph; |
slisgrinder | 1:e143afe9a7ea | 11 | char ns, ew, mode; |
slisgrinder | 1:e143afe9a7ea | 12 | int hours, minutes, seconds, m_seconds, fix, sats_used, DGPS_ID; |
slisgrinder | 1:e143afe9a7ea | 13 | unsigned short checksum_gga, checksum_vtg; |
slisgrinder | 1:e143afe9a7ea | 14 | }; |
slisgrinder | 1:e143afe9a7ea | 15 | |
slisgrinder | 1:e143afe9a7ea | 16 | struct GPS readings; |
slisgrinder | 1:e143afe9a7ea | 17 | |
slisgrinder | 1:e143afe9a7ea | 18 | |
slisgrinder | 1:e143afe9a7ea | 19 | GPSParser (PinName tx, PinName rx, int baud, int num_sentence, MODSERIAL &pc); |
slisgrinder | 1:e143afe9a7ea | 20 | |
slisgrinder | 1:e143afe9a7ea | 21 | void process_readings (); |
slisgrinder | 1:e143afe9a7ea | 22 | |
slisgrinder | 1:e143afe9a7ea | 23 | virtual void ready_buffer(MODSERIAL_IRQ_INFO *q); |
slisgrinder | 1:e143afe9a7ea | 24 | /*{ |
slisgrinder | 1:e143afe9a7ea | 25 | MODSERIAL *serial = q->serial; |
slisgrinder | 1:e143afe9a7ea | 26 | |
slisgrinder | 1:e143afe9a7ea | 27 | if (serial->rxGetLastChar() == '\n') |
slisgrinder | 1:e143afe9a7ea | 28 | ctr++; |
slisgrinder | 1:e143afe9a7ea | 29 | |
slisgrinder | 1:e143afe9a7ea | 30 | if (ctr == num_sentences) |
slisgrinder | 1:e143afe9a7ea | 31 | { |
slisgrinder | 1:e143afe9a7ea | 32 | read_gps(); |
slisgrinder | 1:e143afe9a7ea | 33 | ctr = 0; |
slisgrinder | 1:e143afe9a7ea | 34 | } |
slisgrinder | 1:e143afe9a7ea | 35 | };*/ |
slisgrinder | 1:e143afe9a7ea | 36 | |
slisgrinder | 1:e143afe9a7ea | 37 | protected: |
slisgrinder | 1:e143afe9a7ea | 38 | |
slisgrinder | 1:e143afe9a7ea | 39 | int GLL, RMC, VTG, GGA, GSA, GSV, GRS, GST, MALM, MEPH, MDGP, MDBG, ZDA, MCHN; |
slisgrinder | 1:e143afe9a7ea | 40 | int num_sentences;// = 0; |
slisgrinder | 1:e143afe9a7ea | 41 | volatile int ctr;// = 0; |
slisgrinder | 1:e143afe9a7ea | 42 | int baudrate = 9600; |
slisgrinder | 1:e143afe9a7ea | 43 | |
slisgrinder | 1:e143afe9a7ea | 44 | MODSERIAL gps; |
slisgrinder | 1:e143afe9a7ea | 45 | MODSERIAL pc; |
slisgrinder | 1:e143afe9a7ea | 46 | |
slisgrinder | 1:e143afe9a7ea | 47 | |
slisgrinder | 1:e143afe9a7ea | 48 | }; |