SELKIELogger  1.0.0
LoggerLPMS.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_LPMS_H
22 #define SL_LOGGER_LPMS_H
23 
24 #include <errno.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <unistd.h>
28 
29 #include "SELKIELoggerBase.h"
30 
31 #include "SELKIELoggerLPMS.h"
32 
34 
44 typedef struct {
45  char *sourceName;
46  uint8_t sourceNum;
47  char *portName;
48  int unitID;
49  int baudRate;
50  int handle;
51  int pollFreq;
52 } lpms_params;
53 
55 void *lpms_setup(void *ptargs);
56 
58 bool lpms_queue_message(msgqueue *Q, const uint8_t src, const uint8_t chan, const float val);
59 
61 void *lpms_logging(void *ptargs);
62 
64 void *lpms_shutdown(void *ptargs);
65 
67 void *lpms_channels(void *ptargs);
68 
71 
74 
77 
79 #endif
bool lpms_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section and parse parameters.
Definition: LoggerLPMS.c:532
void * lpms_logging(void *ptargs)
Serial source main logging loop.
Definition: LoggerLPMS.c:159
bool lpms_queue_message(msgqueue *Q, const uint8_t src, const uint8_t chan, const float val)
Helper function: Create and queue data messages, with error handling.
Definition: LoggerLPMS.c:136
void * lpms_channels(void *ptargs)
Serial source channel map.
Definition: LoggerLPMS.c:466
void * lpms_setup(void *ptargs)
Generic serial connection setup.
Definition: LoggerLPMS.c:58
device_callbacks lpms_getCallbacks(void)
Fill out device callback functions for logging.
Definition: LoggerLPMS.c:441
lpms_params lpms_getParams(void)
Fill out default MP source parameters.
Definition: LoggerLPMS.c:452
void * lpms_shutdown(void *ptargs)
Serial source shutdown.
Definition: LoggerLPMS.c:423
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: LoggerLPMS.h:44
int unitID
LPMS Sensor Address.
Definition: LoggerLPMS.h:48
int pollFreq
Desired number of measurements per second.
Definition: LoggerLPMS.h:51
int baudRate
Baud rate for operations (Default 921600)
Definition: LoggerLPMS.h:49
int handle
Handle for currently opened device.
Definition: LoggerLPMS.h:50
char * sourceName
User defined name for this source.
Definition: LoggerLPMS.h:45
char * portName
Target port name.
Definition: LoggerLPMS.h:47
uint8_t sourceNum
Source ID for messages.
Definition: LoggerLPMS.h:46
Represent a simple FIFO message queue.
Definition: queue.h:51