SystemAgent/include/impl/user_mqtt_impl.h

24 lines
697 B
C
Raw Normal View History

2021-07-18 17:26:17 +00:00
#ifndef USER_MQTT_IMPL_H
#define USER_MQTT_IMPL_H
#include <stdint.h>
#include <mosquitto.h>
#include "mqtt_influx.h"
2021-10-22 18:31:54 +00:00
#define USER_MQTT_IMPL_TOPIC_MAX_LEN 31
2021-07-18 17:26:17 +00:00
typedef struct {
struct mosquitto *mosq;
2021-10-22 18:31:54 +00:00
char topic[USER_MQTT_IMPL_TOPIC_MAX_LEN + 1];
bool ready;
2021-07-18 17:26:17 +00:00
} user_mqtt_impl_t;
2021-07-25 18:11:36 +00:00
int user_mqtt_impl_init(user_mqtt_impl_t *handle);
int user_mqtt_impl_deinit(user_mqtt_impl_t *handle);
2021-07-18 17:26:17 +00:00
mqtt_influx_ret_t user_mqtt_get_nsec_timestamp_cb(user_mqtt_impl_t *handle, char *timestamp_string);
mqtt_influx_ret_t user_mqtt_publish_message_cb(user_mqtt_impl_t *handle, char *data);
2021-10-22 18:31:54 +00:00
bool user_mqtt_ready_cb(user_mqtt_impl_t *handle);
int user_mqtt_network_loop(user_mqtt_impl_t *handle);
2021-07-18 17:26:17 +00:00
#endif