From 8aa006625a0974055cc697ae932a48f15928ca26 Mon Sep 17 00:00:00 2001 From: ksaye Date: Thu, 29 Apr 2021 14:45:45 -0500 Subject: [PATCH] Moving includes back to local Moving the includes back under the '#ifdef USE_MQTT_AZURE_IOT', so the build process will complete for all builds. --- tasmota/xdrv_02_mqtt.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index 51d19f365..aee1a5dd7 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -23,9 +23,9 @@ #define MQTT_WIFI_CLIENT_TIMEOUT 200 // Wifi TCP connection timeout (default is 5000 mSec) #endif +#ifdef USE_MQTT_AZURE_IOT #include #include -#ifdef USE_MQTT_AZURE_IOT #include #undef MQTT_PORT #define MQTT_PORT 8883 @@ -224,6 +224,7 @@ void MqttInit(void) { MqttClient.setSocketTimeout(Settings.mqtt_socket_timeout); } +#ifdef USE_MQTT_AZURE_IOT String azurePreSharedKeytoSASToken(char *iotHubFQDN, const char *deviceId, const char *preSharedKey, int sasTTL = 86400){ int ttl = time(NULL) + sasTTL; String dataToSignString = urlEncodeBase64(String(iotHubFQDN) + "/devices/" + String(deviceId)) + "\n" + String(ttl); @@ -268,6 +269,7 @@ String urlEncodeBase64(String stringToEncode){ stringToEncode.replace("/", "%2F"); return stringToEncode; } +#endif // USE_MQTT_AZURE_IOT bool MqttIsConnected(void) { return MqttClient.connected();