SELKIELogger  1.0.0
LoggerMQTT.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_MQTT_H
22 #define SL_LOGGER_MQTT_H
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 
27 #include "SELKIELoggerBase.h"
28 #include "SELKIELoggerMQTT.h"
29 
31 
33 typedef struct {
34  char *sourceName;
35  uint8_t sourceNum;
36  char *addr;
37  int port;
40  char *sysid;
43 } mqtt_params;
44 
46 void *mqtt_setup(void *ptargs);
47 
49 void *mqtt_logging(void *ptargs);
50 
52 void *mqtt_shutdown(void *ptargs);
53 
55 void *mqtt_channels(void *ptargs);
56 
59 
62 
65 #endif
void * mqtt_channels(void *ptargs)
Channel map.
Definition: LoggerMQTT.c:156
void * mqtt_logging(void *ptargs)
Network source main logging loop.
Definition: LoggerMQTT.c:72
void * mqtt_setup(void *ptargs)
Device thread setup.
Definition: LoggerMQTT.c:33
bool mqtt_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section and parse parameters.
Definition: LoggerMQTT.c:231
mqtt_params mqtt_getParams(void)
Fill out default MP source parameters.
Definition: LoggerMQTT.c:211
void * mqtt_shutdown(void *ptargs)
Network source shutdown.
Definition: LoggerMQTT.c:128
device_callbacks mqtt_getCallbacks(void)
Fill out device callback functions for logging.
Definition: LoggerMQTT.c:200
struct mosquitto mqtt_conn
Convenient alias for library structure.
Definition: MQTTTypes.h:39
Configuration file section.
Definition: LoggerConfig.h:54
Device specific function information.
Definition: Logger.h.in:72
Logging thread information.
Definition: Logger.h.in:86
MQTT source specific parameters.
Definition: LoggerMQTT.h:33
char * sourceName
User defined name for this source.
Definition: LoggerMQTT.h:34
char * sysid
Portal/System ID for use with victron_keepalive.
Definition: LoggerMQTT.h:40
int port
Target port number.
Definition: LoggerMQTT.h:37
int keepalive_interval
Interval between keepalives.
Definition: LoggerMQTT.h:39
uint8_t sourceNum
Source ID for messages.
Definition: LoggerMQTT.h:35
mqtt_conn * conn
Connection.
Definition: LoggerMQTT.h:41
bool victron_keepalives
Victron compatible keep alives.
Definition: LoggerMQTT.h:38
char * addr
Target host.
Definition: LoggerMQTT.h:36
mqtt_queue_map qm
Topic mapping.
Definition: LoggerMQTT.h:42