SELKIELogger  1.0.0
NMEAMessages.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Swansea University
3  *
4  * This file is part of the SELKIELogger suite of tools.
5  *
6  * SELKIELogger is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation, either version 3 of the License, or (at your option)
9  * any later version.
10  *
11  * SELKIELogger is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this SELKIELogger product.
18  * If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef SELKIELoggerNMEA_Messages
22 #define SELKIELoggerNMEA_Messages
23 
29 #include <stdbool.h>
30 #include <stddef.h>
31 #include <stdint.h>
32 #include <time.h>
33 
34 #include "NMEATypes.h"
35 
45 void nmea_calc_checksum(const nmea_msg_t *msg, uint8_t *cs);
46 
48 void nmea_set_checksum(nmea_msg_t *msg);
49 
51 bool nmea_check_checksum(const nmea_msg_t *msg);
52 
54 size_t nmea_message_length(const nmea_msg_t *msg);
55 
57 size_t nmea_flat_array(const nmea_msg_t *msg, char **out);
58 
60 char *nmea_string_hex(const nmea_msg_t *msg);
61 
63 void nmea_print_hex(const nmea_msg_t *msg);
64 
67 
69 struct tm *nmea_parse_zda(const nmea_msg_t *msg);
71 #endif
size_t nmea_message_length(const nmea_msg_t *msg)
Calculate number of bytes required to represent message.
Definition: NMEAMessages.c:99
struct tm * nmea_parse_zda(const nmea_msg_t *msg)
Get date/time from NMEA ZDA message.
Definition: NMEAMessages.c:240
void nmea_print_hex(const nmea_msg_t *msg)
Print NMEA message.
Definition: NMEAMessages.c:188
char * nmea_string_hex(const nmea_msg_t *msg)
Return NMEA message as string.
Definition: NMEAMessages.c:174
void nmea_calc_checksum(const nmea_msg_t *msg, uint8_t *cs)
Calculate checksum for NMEA message.
Definition: NMEAMessages.c:37
size_t nmea_flat_array(const nmea_msg_t *msg, char **out)
Convert NMEA message to array of bytes for transmission.
Definition: NMEAMessages.c:127
void nmea_set_checksum(nmea_msg_t *msg)
Set checksum bytes for NMEA message.
Definition: NMEAMessages.c:74
strarray * nmea_parse_fields(const nmea_msg_t *nmsg)
Parse raw data into fields.
Definition: NMEAMessages.c:203
bool nmea_check_checksum(const nmea_msg_t *msg)
Verify checksum bytes of NMEA message.
Definition: NMEAMessages.c:85
Generic NMEA message structure.
Definition: NMEATypes.h:78
Array of strings.
Definition: strarray.h:43