Possibility to disable MQTT

save ~6k
This commit is contained in:
Mathieu Maret 2016-10-28 18:04:30 +02:00
parent 87085fba3d
commit e0f600baf0
2 changed files with 16 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#pragma once
#ifndef CONFIG_DISABLE_MQTT
#include "Adafruit_MQTT.h"
Adafruit_MQTT_Publish *MqttCreatePublisher(const char *fmt, ...);
@ -13,3 +14,16 @@ void MqttCheckSubscription();
void MqttChangeGpioValue(int gpio, int value);
void MqttChangePWMValue(int gpio, int value);
bool MqttIsConfigured();
#else
int MqttConnect(){return 0;}
int MqttIsConnected(){return 0;}
int MqttSetup(char *server, char *user, char *passwd, int port, char * hostname){return 0;}
int MqttPublish(double temp, double pressure){return 0;}
int MqttDhtPublish(float temp, float humidity){return 0;}
int MqttDryPublish(int dry){return 0;}
int MqttIPPublish(const String &ip){return 0;}
void MqttCheckSubscription(){}
void MqttChangeGpioValue(int gpio, int value){}
void MqttChangePWMValue(int gpio, int value){}
bool MqttIsConfigured(){}
#endif

View File

@ -1,3 +1,4 @@
#ifndef CONFIG_DISABLE_MQTT
#include <stdarg.h>
#include "utils.h"
#include "MQTT.h"
@ -214,3 +215,4 @@ void MqttCheckSubscription() {
}
}
}
#endif