SELKIELogger  1.0.0
MQTTTypes.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 SELKIELoggerMQTT_Types
22 #define SELKIELoggerMQTT_Types
23 
29 #include "SELKIELoggerBase.h"
30 #include <mosquitto.h>
31 #include <stdbool.h>
32 
39 typedef struct mosquitto mqtt_conn;
40 
42 typedef struct {
43  uint8_t type;
44  char *topic;
45  char *name;
46  bool text;
48 
56 typedef struct {
58  uint8_t sourceNum;
59  int numtopics;
61  bool dumpall;
63 
66 
70 #endif
bool mqtt_init_queue_map(mqtt_queue_map *qm)
Initialise mqtt_queue_map to sensible defaults.
Definition: MQTTTypes.c:33
struct mosquitto mqtt_conn
Convenient alias for library structure.
Definition: MQTTTypes.h:39
void mqtt_destroy_queue_map(mqtt_queue_map *qm)
Release resources used by mqtt_queue_map instance.
Definition: MQTTTypes.c:48
bool dumpall
Dump any message, not just matches in .tc.
Definition: MQTTTypes.h:61
int numtopics
Number of topics registered.
Definition: MQTTTypes.h:59
msgqueue q
Internal message queue.
Definition: MQTTTypes.h:57
uint8_t sourceNum
Source number.
Definition: MQTTTypes.h:58
MQTT Topic mapping.
Definition: MQTTTypes.h:42
uint8_t type
Channel number to use.
Definition: MQTTTypes.h:43
char * name
Channel name.
Definition: MQTTTypes.h:45
char * topic
MQTT topic to subscribe/match against.
Definition: MQTTTypes.h:44
bool text
Treat received data as text.
Definition: MQTTTypes.h:46
Represent a simple FIFO message queue.
Definition: queue.h:51