4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2009 Develer S.r.l. (http://www.develer.com/)
34 * \author Daniele Basile <asterix@develer.com>
36 * $WIZ$ module_name = "nmea"
37 * $WIZ$ module_configuration = "bertos/cfg/cfg_nmea.h"
38 * $WIZ$ module_depends = "kfile"
44 #include "cfg/cfg_nmea.h"
46 #include <net/nmeap/inc/nmeap.h>
48 #include <kern/kfile.h>
51 * Implemented NMEA parser strings.
53 #define NMEA_GPGGA 1 // GGA MESSAGE ID
54 #define NMEA_GPRMC 2 // RMC MESSAGE ID
55 #define NMEA_GPVTG 3 // VTG MESSAGE ID
56 #define NMEA_GPGSV 4 // GSV MESSAGE ID
58 // Standart type to rappresent fiels.
59 typedef uint32_t udegree_t; // Micro degrees
60 typedef uint32_t mdegree_t; // Milli degrees
61 typedef uint16_t degree_t; // Degrees
62 typedef uint16_t cm_t; // Centimeter
63 typedef uint32_t sec_t; // Seconds
64 typedef uint32_t str_time_t; // Time format HH:MM:SS
65 typedef uint32_t mknots_t; // Milli knots
66 typedef uint32_t mkh_t; // Milli kilometers/hour
67 typedef uint16_t number_t; // Pure number
71 * Extracted data from a GGA message
73 typedef struct NmeaGga
86 * Extracted data from an RMC message
88 typedef struct NmeaRmc
101 * Extracted data from an vtg message
103 typedef struct NmeaVtg
105 mdegree_t track_good;
111 * Extracted data from an gsv message
113 typedef struct NmeaGsv
115 number_t tot_message;
116 number_t message_num;
136 void nmea_poll(nmeap_context_t *context, KFile *channel);
138 int nmea_gpgsv(nmeap_context_t *context, nmeap_sentence_t *sentence);
139 int nmea_gpvtg(nmeap_context_t *context, nmeap_sentence_t *sentence);
140 int nmea_gprmc(nmeap_context_t *context, nmeap_sentence_t *sentence);
141 int nmea_gpgga(nmeap_context_t *context, nmeap_sentence_t *sentence);
143 #endif /* NET_NMEA_H */