Skip to content

Commit d456c1d

Browse files
committed
Bugfix - OTA logic was not excluded everywhere
1 parent 81fa9eb commit d456c1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
150150

151151
void ArduinoIoTCloudTCP::update()
152152
{
153+
#if OTA_ENABLED
153154
/* If a _ota_logic object has been instantiated then we are spinning its
154155
* 'update' method here in order to process incoming data and generally
155156
* to transition to the OTA logic update states.
@@ -158,6 +159,7 @@ void ArduinoIoTCloudTCP::update()
158159
OTAError const err = _ota_logic->update();
159160
_ota_error = static_cast<int>(err);
160161
}
162+
#endif /* OTA_ENABLED */
161163

162164
// Check if a primitive property wrapper is locally changed
163165
_thing.updateTimestampOnLocallyChangedProperties();
@@ -284,9 +286,11 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
284286
sendPropertiesToCloud();
285287
_syncStatus = ArduinoIoTSynchronizationStatus::SYNC_STATUS_VALUES_PROCESSED;
286288
}
289+
#if OTA_ENABLED
287290
if (_ota_logic && (_ota_topic_in == topic)) {
288291
_ota_logic->onOTADataReceived(bytes, length);
289292
}
293+
#endif /* OTA_ENABLED */
290294
}
291295

292296
void ArduinoIoTCloudTCP::sendPropertiesToCloud()

0 commit comments

Comments
 (0)