Skip to content

Commit 0d8c582

Browse files
committed
Adding 2 hidden properties OTA_URL (which contains the URL from where an OTA image should be downloaded) as well as OTA_REQ (which performs an OTA download from said URL when it's set to true
1 parent 4729b85 commit 0d8c582

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
8989
#if OTA_ENABLED
9090
, _ota_error{static_cast<int>(OTAError::None)}
9191
, _ota_img_sha256{"Inv."}
92+
, _ota_url{""}
93+
, _otq_request{false}
9294
#endif /* OTA_ENABLED */
9395
{
9496

@@ -211,6 +213,8 @@ void ArduinoIoTCloudTCP::setOTAStorage(OTAStorage & ota_storage)
211213
{
212214
addPropertyReal(_ota_error, "OTA_ERROR", Permission::Read);
213215
addPropertyReal(_ota_img_sha256, "OTA_SHA256", Permission::Read);
216+
addPropertyReal(_ota_url, "OTA_URL", Permission::ReadWrite).onSync(DEVICE_WINS);
217+
addPropertyReal(_otq_request, "OTA_REQ", Permission::ReadWrite).onSync(DEVICE_WINS);
214218
_ota_logic.setOTAStorage(ota_storage);
215219
}
216220
#endif /* OTA_ENABLED */

src/ArduinoIoTCloudTCP.h

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
130130
OTALogic _ota_logic;
131131
int _ota_error;
132132
String _ota_img_sha256;
133+
String _ota_url;
134+
bool _otq_request;
133135
#endif /* OTA_ENABLED */
134136

135137
inline String getTopic_stdin () { return String("/a/d/" + getDeviceId() + "/s/i"); }

0 commit comments

Comments
 (0)