From 6ebbf97f6d6375bd841fe0c8cb9553301da3626e Mon Sep 17 00:00:00 2001 From: pennam Date: Tue, 25 Jun 2024 16:13:16 +0200 Subject: [PATCH] Initialize ota client only if boards supports OTA --- src/ArduinoIoTCloudTCP.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 722cf284..93df8ad6 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -140,7 +140,9 @@ int ArduinoIoTCloudTCP::begin(ConnectionHandler & connection, bool const enable_ int ArduinoIoTCloudTCP::begin(Client * mqttClient, Client * otaClient, bool const enable_watchdog, String brokerAddress, uint16_t brokerPort) { _brokerTLSClient = mqttClient; +#if OTA_ENABLED _otaTLSClient = otaClient; +#endif /* Setup retry timers */ _connection_attempt.begin(AIOT_CONFIG_RECONNECTION_RETRY_DELAY_ms, AIOT_CONFIG_MAX_RECONNECTION_RETRY_DELAY_ms);