Skip to content

Commit 76b12e0

Browse files
committed
Adding hidden string property OTA_SHA256 which will contain the SHA256 hash of MCU's flash in order for the cloud team to verify the correct download.
1 parent 923931a commit 76b12e0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
9494
, _ota_topic_in{""}
9595
#if OTA_ENABLED
9696
, _ota_error{static_cast<int>(OTAError::None)}
97+
, _ota_img_sha256{"Inv."}
9798
#endif /* OTA_ENABLED */
9899
{
99100

@@ -229,6 +230,7 @@ void ArduinoIoTCloudTCP::printDebugInfo()
229230
void ArduinoIoTCloudTCP::setOTAStorage(OTAStorage & ota_storage)
230231
{
231232
addPropertyReal(_ota_error, "OTA_ERROR", Permission::Read);
233+
addPropertyReal(_ota_img_sha256, "OTA_SHA256", Permission::Read);
232234
_ota_logic.setOTAStorage(ota_storage);
233235
}
234236
#endif /* OTA_ENABLED */

src/ArduinoIoTCloudTCP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
127127
#if OTA_ENABLED
128128
OTALogic _ota_logic;
129129
int _ota_error;
130+
String _ota_img_sha256;
130131
#endif /* OTA_ENABLED */
131132

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

0 commit comments

Comments
 (0)