SELKIELogger
1.0.0
|
#include <stdbool.h>
#include <stdint.h>
#include "SELKIELoggerBase.h"
#include "SELKIELoggerMQTT.h"
Go to the source code of this file.
Classes | |
struct | mqtt_params |
MQTT source specific parameters. More... | |
Functions | |
void * | mqtt_setup (void *ptargs) |
Device thread setup. More... | |
void * | mqtt_logging (void *ptargs) |
Network source main logging loop. More... | |
void * | mqtt_shutdown (void *ptargs) |
Network source shutdown. More... | |
void * | mqtt_channels (void *ptargs) |
Channel map. More... | |
device_callbacks | mqtt_getCallbacks (void) |
Fill out device callback functions for logging. More... | |
mqtt_params | mqtt_getParams (void) |
Fill out default MP source parameters. More... | |
bool | mqtt_parseConfig (log_thread_args_t *lta, config_section *s) |
Take a configuration section and parse parameters. More... | |
void* mqtt_channels | ( | void * | ptargs | ) |
Channel map.
Create channel map from configured IDs and push to queue.
Terminates thread on error.
[in] | ptargs | Pointer to log_thread_args_t |
Definition at line 156 of file LoggerMQTT.c.
device_callbacks mqtt_getCallbacks | ( | void | ) |
Fill out device callback functions for logging.
Definition at line 200 of file LoggerMQTT.c.
mqtt_params mqtt_getParams | ( | void | ) |
Fill out default MP source parameters.
Definition at line 211 of file LoggerMQTT.c.
void* mqtt_logging | ( | void * | ptargs | ) |
Network source main logging loop.
MQTT Logging thread
Handles sending keepalive commands (if enabled) and popping items from within the MQTT specific queue and moving them into the main message queue.
Unlike the _logging function for other sources, this doesn't read anything directly. Message processing is handled in a thread managed by the mosquitto library and we pass in a callback function to format and enqueue the messages.
Terminates thread on error
[in] | ptargs | Pointer to log_thread_args_t |
Definition at line 72 of file LoggerMQTT.c.
bool mqtt_parseConfig | ( | log_thread_args_t * | lta, |
config_section * | s | ||
) |
Take a configuration section and parse parameters.
[in] | lta | Pointer to log_thread_args_t |
[in] | s | Pointer to config_section to be parsed |
Definition at line 231 of file LoggerMQTT.c.
void* mqtt_setup | ( | void * | ptargs | ) |
Device thread setup.
Sets up MQTT server connection
[in] | ptargs | Pointer to log_thread_args_t |
Definition at line 33 of file LoggerMQTT.c.
void* mqtt_shutdown | ( | void * | ptargs | ) |
Network source shutdown.
Cleanly shutdown MQTT connection and release resources.
[in] | ptargs | Pointer to log_thread_args_t |
Definition at line 128 of file LoggerMQTT.c.