X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Fnmea.h;h=f735f6bfbaf18fb20e36ee52bd3a985beae52955;hb=676c6174c50aaf1d501a5b582276364dc52001d1;hp=44528195562d1ef526e1317a99c86d9ff941c867;hpb=4f37937571c34c2380155cbb77e892a1894403bf;p=bertos.git diff --git a/bertos/net/nmea.h b/bertos/net/nmea.h index 44528195..f735f6bf 100644 --- a/bertos/net/nmea.h +++ b/bertos/net/nmea.h @@ -29,7 +29,7 @@ * Copyright 2009 Develer S.r.l. (http://www.develer.com/) * * --> - * \brief NMEA Parser + * \brief NMEA Parser. * * \author Daniele Basile * @@ -115,27 +115,20 @@ typedef struct NmeaVtg /** * Extracted data from an gsv message */ -typedef struct NmeaGsv +struct SvInfo { - uint16_t tot_message; /* Total number of messages of this type in this cycle */ - uint16_t message_num; /* Message number */ - uint16_t tot_svv; /* Total number of SVs in view */ uint16_t sv_prn; /* SV PRN number */ degree_t elevation; /* Elevation in degrees, 90 maximum */ degree_t azimut; /* Azimuth, degrees from true north, 000 to 359 */ uint16_t snr; /* SNR, 00-99 dB (null when not tracking) */ - uint16_t sv_prn2; /* Information about second SV PRN number */ - degree_t elevation2; /* Information about second SV elevation in degrees, 90 maximum */ - degree_t azimut2; /* Information about second SV azimuth, degrees from true north, 000 to 359 */ - uint16_t snr2; /* Information about second SV SNR, 00-99 dB (null when not tracking) */ - uint16_t sv_prn3; /* Information about third SV PRN number */ - degree_t elevation3; /* Information about third SV elevation in degrees, 90 maximum */ - degree_t azimut3; /* Information about third SV azimuth, degrees from true north, 000 to 359 */ - uint16_t snr3; /* Information about third SV SNR, 00-99 dB (null when not tracking) */ - uint16_t sv_prn4; /* Information about fourth SV PRN number */ - degree_t elevation4; /* Information about fourth SV elevation in degrees, 90 maximum */ - degree_t azimut4; /* Information about fourth SV azimuth, degrees from true north, 000 to 359 */ - uint16_t snr4; /* Information about fourth SV SNR, 00-99 dB (null when not tracking) */ +}; + +typedef struct NmeaGsv +{ + uint16_t tot_message; /* Total number of messages of this type in this cycle */ + uint16_t message_num; /* Message number */ + uint16_t tot_svv; /* Total number of SVs in view */ + struct SvInfo info[4]; /* Stanrd gsv nmea report up to 4 sv info */ } NmeaGsv; void nmea_poll(nmeap_context_t *context, KFile *channel); @@ -145,6 +138,12 @@ int nmea_gpvtg(nmeap_context_t *context, nmeap_sentence_t *sentence); int nmea_gprmc(nmeap_context_t *context, nmeap_sentence_t *sentence); int nmea_gpgga(nmeap_context_t *context, nmeap_sentence_t *sentence); +// Example of callout +void gpgga_callout(nmeap_context_t *context, void *data, void *user_data); +void gprmc_callout(nmeap_context_t *context, void *data, void *user_data); +void gpgsv_callout(nmeap_context_t *context, void *data, void *user_data); +void gpvtg_callout(nmeap_context_t *context, void *data, void *user_data); + int nmea_testSetup(void); int nmea_testTearDown(void); int nmea_testRun(void);