Skip to content

Commit 3091f62

Browse files
committed
Only set hidden property OTA_CAP to true if the nina firmware version is >= 1.4.1
1 parent 36bde89 commit 3091f62

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
137137
_dataTopicIn = getTopic_datain();
138138

139139
#if OTA_ENABLED
140-
#if OTA_STORAGE_SNU
141-
_ota_cap = true;
142-
#endif
143140
addPropertyReal(_ota_cap, "OTA_CAP", Permission::Read);
144141
addPropertyReal(_ota_error, "OTA_ERROR", Permission::Read);
145142
addPropertyReal(_ota_img_sha256, "OTA_SHA256", Permission::Read);
@@ -149,10 +146,15 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
149146

150147
#if OTA_STORAGE_SNU
151148
String const nina_fw_version = WiFi.firmwareVersion();
152-
if (nina_fw_version < "1.4.1") {
149+
if (nina_fw_version < "1.4.1")
150+
{
151+
_ota_cap = false;
153152
DBG_ERROR(F("ArduinoIoTCloudTCP::%s error nina firmware needs to be >= 1.4.1, current %s"), __FUNCTION__, nina_fw_version.c_str());
154153
return 0;
155154
}
155+
else {
156+
_ota_cap = true;
157+
}
156158
#endif /* OTA_STORAGE_SNU */
157159

158160
return 1;

0 commit comments

Comments
 (0)