This commit is contained in:
Gilles Grandou 2021-08-05 21:44:09 +02:00
parent 23fd1c3da0
commit bd7288a359
2 changed files with 50 additions and 58 deletions

14
mqtt.c
View File

@ -1,6 +1,8 @@
#include "mqtt.h"
#include "logger.h"
#include <mosquitto.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
@ -9,16 +11,8 @@
static void mosq_log_callback(struct mosquitto *mosq, void *userdata, int level, const char *str)
{
switch (level) {
case MOSQ_LOG_WARNING:
log_warning("%s", str);
break;
case MOSQ_LOG_ERR:
log_error("%s", str);
break;
default:
break;
case MOSQ_LOG_WARNING: log_warning("%s", str); break;
case MOSQ_LOG_ERR: log_error("%s", str); break;
}
}

2
mqtt.h
View File

@ -1,8 +1,6 @@
#ifndef __MQTT_H__
#define __MQTT_H__
#include <mosquitto.h>
#define TOPIC_MAXLEN 255
#define TIC_QOS 0