SELKIELogger  1.0.0
NMEASerial.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_Serial
22 #define SELKIELoggerNMEA_Serial
23 
29 #include "SELKIELoggerBase.h"
30 
31 #include "NMEATypes.h"
32 
38 #define NMEA_SERIAL_BUFF 1024
39 
41 int nmea_openConnection(const char *port, const int baudRate);
42 
44 void nmea_closeConnection(int handle);
45 
47 bool nmea_readMessage(int handle, nmea_msg_t *out);
48 
50 bool nmea_readMessage_buf(int handle, nmea_msg_t *out, uint8_t buf[NMEA_SERIAL_BUFF], int *index, int *hw);
51 
53 bool nmea_writeMessage(int handle, const nmea_msg_t *out);
55 #endif
bool nmea_readMessage_buf(int handle, nmea_msg_t *out, uint8_t buf[NMEA_SERIAL_BUFF], int *index, int *hw)
Read data from handle, and parse message if able.
Definition: NMEASerial.c:98
bool nmea_writeMessage(int handle, const nmea_msg_t *out)
Send message to attached device.
Definition: NMEASerial.c:318
bool nmea_readMessage(int handle, nmea_msg_t *out)
Static wrapper around mp_readMessage_buf.
Definition: NMEASerial.c:66
int nmea_openConnection(const char *port, const int baudRate)
Set up a connection to the specified port.
Definition: NMEASerial.c:43
void nmea_closeConnection(int handle)
Close existing connection.
Definition: NMEASerial.c:52
#define NMEA_SERIAL_BUFF
Default serial buffer allocation size.
Definition: NMEASerial.h:38
Generic NMEA message structure.
Definition: NMEATypes.h:78