aboutsummaryrefslogtreecommitdiff
path: root/apps/gps/nmealib/sentence.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gps/nmealib/sentence.c')
-rw-r--r--apps/gps/nmealib/sentence.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/apps/gps/nmealib/sentence.c b/apps/gps/nmealib/sentence.c
new file mode 100644
index 000000000..a66393a4d
--- /dev/null
+++ b/apps/gps/nmealib/sentence.c
@@ -0,0 +1,54 @@
+/*
+ *
+ * NMEA library
+ * URL: http://nmea.sourceforge.net
+ * Author: Tim (xtimor@gmail.com)
+ * Licence: http://www.gnu.org/licenses/lgpl.html
+ * $Id: sentence.c 17 2008-03-11 11:56:11Z xtimor $
+ *
+ */
+
+#include "nmea/sentence.h"
+
+#include <string.h>
+
+void nmea_zero_GPGGA(nmeaGPGGA *pack)
+{
+ memset(pack, 0, sizeof(nmeaGPGGA));
+ nmea_time_now(&pack->utc);
+ pack->ns = 'N';
+ pack->ew = 'E';
+ pack->elv_units = 'M';
+ pack->diff_units = 'M';
+}
+
+void nmea_zero_GPGSA(nmeaGPGSA *pack)
+{
+ memset(pack, 0, sizeof(nmeaGPGSA));
+ pack->fix_mode = 'A';
+ pack->fix_type = NMEA_FIX_BAD;
+}
+
+void nmea_zero_GPGSV(nmeaGPGSV *pack)
+{
+ memset(pack, 0, sizeof(nmeaGPGSV));
+}
+
+void nmea_zero_GPRMC(nmeaGPRMC *pack)
+{
+ memset(pack, 0, sizeof(nmeaGPRMC));
+ nmea_time_now(&pack->utc);
+ pack->status = 'V';
+ pack->ns = 'N';
+ pack->ew = 'E';
+ pack->declin_ew = 'E';
+}
+
+void nmea_zero_GPVTG(nmeaGPVTG *pack)
+{
+ memset(pack, 0, sizeof(nmeaGPVTG));
+ pack->dir_t = 'T';
+ pack->dec_m = 'M';
+ pack->spn_n = 'N';
+ pack->spk_k = 'K';
+}