SELKIELogger  1.0.0
LoggerSerial.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_SERIAL_H
22 #define SL_LOGGER_SERIAL_H
23 
24 #include <errno.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <unistd.h>
28 
29 #include "SELKIELoggerBase.h"
30 
32 
43 typedef struct {
44  char *sourceName;
45  uint8_t sourceNum;
46  char *portName;
47  int baudRate;
48  int handle;
49  int minBytes;
50  int maxBytes;
51  int pollFreq;
52 } rx_params;
53 
55 void *rx_setup(void *ptargs);
56 
58 void *rx_logging(void *ptargs);
59 
61 void *rx_shutdown(void *ptargs);
62 
64 void *rx_channels(void *ptargs);
65 
68 
71 
74 
76 #endif
void * rx_setup(void *ptargs)
Generic serial connection setup.
Definition: LoggerSerial.c:34
void * rx_logging(void *ptargs)
Serial source main logging loop.
Definition: LoggerSerial.c:62
device_callbacks rx_getCallbacks(void)
Fill out device callback functions for logging.
Definition: LoggerSerial.c:138
bool rx_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section and parse parameters.
Definition: LoggerSerial.c:210
void * rx_shutdown(void *ptargs)
Serial source shutdown.
Definition: LoggerSerial.c:120
void * rx_channels(void *ptargs)
Serial source channel map.
Definition: LoggerSerial.c:167
rx_params rx_getParams(void)
Fill out default MP source parameters.
Definition: LoggerSerial.c:149
Configuration file section.
Definition: LoggerConfig.h:54
Device specific function information.
Definition: Logger.h.in:72
Logging thread information.
Definition: Logger.h.in:86
Serial device specific parameters.
Definition: LoggerSerial.h:43
char * portName
Target port name.
Definition: LoggerSerial.h:46
char * sourceName
User defined name for this source.
Definition: LoggerSerial.h:44
int pollFreq
Minimum number of times per second to check for data.
Definition: LoggerSerial.h:51
int minBytes
Minimum number of bytes to group into a message.
Definition: LoggerSerial.h:49
int maxBytes
Maximum number of bytes to group into a message.
Definition: LoggerSerial.h:50
uint8_t sourceNum
Source ID for messages.
Definition: LoggerSerial.h:45
int baudRate
Baud rate for operations (currently unused)
Definition: LoggerSerial.h:47
int handle
Handle for currently opened device.
Definition: LoggerSerial.h:48