Skip to content

Commit e160ca8

Browse files
authored
Add hiddden property OTA_CAP for signaling OTA update capability (#192)
1 parent a284622 commit e160ca8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
7070
, _dataTopicOut("")
7171
, _dataTopicIn("")
7272
#if OTA_ENABLED
73+
, _ota_cap{false}
7374
, _ota_error{static_cast<int>(OTAError::None)}
7475
, _ota_img_sha256{"Inv."}
7576
, _ota_url{""}
@@ -136,6 +137,10 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
136137
_dataTopicIn = getTopic_datain();
137138

138139
#if OTA_ENABLED
140+
#if OTA_STORAGE_SNU
141+
_ota_cap = true;
142+
#endif
143+
addPropertyReal(_ota_cap, "OTA_CAP", Permission::Read);
139144
addPropertyReal(_ota_error, "OTA_ERROR", Permission::Read);
140145
addPropertyReal(_ota_img_sha256, "OTA_SHA256", Permission::Read);
141146
addPropertyReal(_ota_url, "OTA_URL", Permission::ReadWrite).onSync(DEVICE_WINS);

src/ArduinoIoTCloudTCP.h

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
114114
String _dataTopicIn;
115115

116116
#if OTA_ENABLED
117+
bool _ota_cap;
117118
int _ota_error;
118119
String _ota_img_sha256;
119120
String _ota_url;

0 commit comments

Comments
 (0)