SELKIELogger  1.0.0
LoggerN2K.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 SL_LOGGER_N2K_H
22 #define SL_LOGGER_N2K_H
23 
24 #include <errno.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <unistd.h>
29 
30 #include "SELKIELoggerBase.h"
31 #include "SELKIELoggerN2K.h"
32 
34 
46 #define N2KCHAN_NAME SLCHAN_NAME
47 #define N2KCHAN_MAP SLCHAN_MAP
48 #define N2KCHAN_TSTAMP SLCHAN_TSTAMP
49 #define N2KCHAN_RAW SLCHAN_RAW
50 #define N2KCHAN_LAT 4
51 #define N2KCHAN_LON 5
52 
54 typedef struct {
55  char *portName;
56  char *sourceName;
57  uint8_t sourceNum;
58  int baudRate;
59  int handle;
60 } n2k_params;
61 
63 void *n2k_setup(void *ptargs);
64 
66 void *n2k_logging(void *ptargs);
67 
69 void *n2k_shutdown(void *ptargs);
70 
72 void *n2k_channels(void *ptargs);
73 
76 
79 
83 #endif
bool n2k_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section and parse parameters.
Definition: LoggerN2K.c:271
void * n2k_channels(void *ptargs)
N2K Channel map.
Definition: LoggerN2K.c:208
void * n2k_setup(void *ptargs)
N2K Setup.
Definition: LoggerN2K.c:36
void * n2k_shutdown(void *ptargs)
N2K Shutdown.
Definition: LoggerN2K.c:181
n2k_params n2k_getParams(void)
Fill out default N2K parameters.
Definition: LoggerN2K.c:260
void * n2k_logging(void *ptargs)
N2K logging (with pthread function signature)
Definition: LoggerN2K.c:62
device_callbacks n2k_getCallbacks(void)
Fill out device callback functions for logging.
Definition: LoggerN2K.c:249
Configuration file section.
Definition: LoggerConfig.h:54
Device specific function information.
Definition: Logger.h.in:72
Logging thread information.
Definition: Logger.h.in:86
N2K Device specific parameters.
Definition: LoggerN2K.h:54
char * portName
Target port name.
Definition: LoggerN2K.h:55
uint8_t sourceNum
Source ID for messages.
Definition: LoggerN2K.h:57
char * sourceName
User defined name for this source.
Definition: LoggerN2K.h:56
int baudRate
Baud rate for operations.
Definition: LoggerN2K.h:58
int handle
Handle for currently opened device.
Definition: LoggerN2K.h:59