SELKIELogger  1.0.0
LoggerDW.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_DW_H
22 #define SL_LOGGER_DW_H
23 
24 #include <errno.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <unistd.h>
28 
29 #include "SELKIELoggerBase.h"
31 
42 typedef struct {
43  char *sourceName;
44  uint8_t sourceNum;
45  char *addr;
46  int handle;
47  int timeout;
48  bool recordRaw;
50 } dw_params;
51 
57 #define DWCHAN_NAME SLCHAN_NAME
58 #define DWCHAN_MAP SLCHAN_MAP
59 #define DWCHAN_TSTAMP SLCHAN_TSTAMP
60 #define DWCHAN_RAW SLCHAN_RAW
61 #define DWCHAN_SIG 4
62 #define DWCHAN_DN 5
63 #define DWCHAN_DW 6
64 #define DWCHAN_DV 7
65 
66 #define DWCHAN_LAT 8
67 #define DWCHAN_LON 9
68 #define DWCHAN_ORIENT 10
69 #define DWCHAN_INCLIN 11
70 #define DWCHAN_GPSFIX 12
71 #define DWCHAN_HRMS 13
72 #define DWCHAN_TREF 14
73 #define DWCHAN_TWTR 15
74 #define DWCHAN_WEEKS 16
75 
76 #define DWCHAN_SPF 17
77 #define DWCHAN_SPD 18
78 #define DWCHAN_SPS 19
79 #define DWCHAN_SPM 20
80 #define DWCHAN_SPN 21
81 #define DWCHAN_SPR 22
82 #define DWCHAN_SPK 23
83 
85 
87 void *dw_setup(void *ptargs);
88 
90 void *dw_logging(void *ptargs);
91 
93 void *dw_shutdown(void *ptargs);
94 
96 bool dw_net_connect(void *ptargs);
97 
99 void *dw_channels(void *ptargs);
100 
102 void dw_push_message(log_thread_args_t *args, uint8_t sNum, uint8_t cNum, float data);
103 
106 
108 dw_params dw_getParams(void);
109 
112 
114 #endif
bool dw_net_connect(void *ptargs)
DW Network connection helper.
Definition: LoggerDW.c:311
void * dw_channels(void *ptargs)
Channel map.
Definition: LoggerDW.c:396
bool dw_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section and parse parameters.
Definition: LoggerDW.c:470
void dw_push_message(log_thread_args_t *args, uint8_t sNum, uint8_t cNum, float data)
Create and push messages to queue.
Definition: LoggerDW.c:265
void * dw_setup(void *ptargs)
Datawell thread setup.
Definition: LoggerDW.c:43
dw_params dw_getParams(void)
Fill out default MP source parameters.
Definition: LoggerDW.c:380
void * dw_logging(void *ptargs)
Datawell source main logging loop.
Definition: LoggerDW.c:65
void * dw_shutdown(void *ptargs)
Datawell source shutdown.
Definition: LoggerDW.c:286
device_callbacks dw_getCallbacks(void)
Fill out device callback functions for logging.
Definition: LoggerDW.c:369
Configuration file section.
Definition: LoggerConfig.h:54
Device specific function information.
Definition: Logger.h.in:72
Configuration is as per simple network sources.
Definition: LoggerDW.h:42
char * sourceName
User defined name for this source.
Definition: LoggerDW.h:43
bool parseSpectrum
Enable parsing of spectral data.
Definition: LoggerDW.h:49
int timeout
Reconnect if no data received after this interval [s].
Definition: LoggerDW.h:47
uint8_t sourceNum
Source ID for messages.
Definition: LoggerDW.h:44
int handle
Handle for currently opened device.
Definition: LoggerDW.h:46
char * addr
Target name.
Definition: LoggerDW.h:45
bool recordRaw
Enable retention of raw data.
Definition: LoggerDW.h:48
Logging thread information.
Definition: Logger.h.in:86