Skip to content

Commit d576482

Browse files
committed
Add configuration flag to sendOTAPropertiesToCloud() fuction in order to append OTA_REQ property
1 parent 580aee4 commit d576482

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,16 @@ void ArduinoIoTCloudTCP::sendPropertiesToCloud()
762762
}
763763

764764
#if OTA_ENABLED
765-
void ArduinoIoTCloudTCP::sendOTAPropertiesToCloud()
765+
void ArduinoIoTCloudTCP::sendOTAPropertiesToCloud(bool include_ota_req)
766766
{
767767
PropertyContainer ota_property_container;
768768
unsigned int last_ota_property_index = 0;
769769

770-
std::list<String> const ota_property_list {"OTA_CAP", "OTA_ERROR", "OTA_SHA256"};
771-
std::for_each(ota_property_list.cbegin(),
772-
ota_property_list.cend(),
770+
std::list<String> ota_property_list {"OTA_CAP", "OTA_ERROR", "OTA_SHA256"};
771+
if (include_ota_req)
772+
ota_property_list.push_back("OTA_REQ");
773+
std::for_each(ota_property_list.begin(),
774+
ota_property_list.end(),
773775
[this, &ota_property_container ] (String const & name)
774776
{
775777
Property* p = getProperty(this->_device_property_container, name);

src/ArduinoIoTCloudTCP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
189189

190190
#if OTA_ENABLED
191191
void onOTARequest();
192-
void sendOTAPropertiesToCloud();
192+
void sendOTAPropertiesToCloud(bool include_ota_req = false);
193193
#endif
194194

195195
void updateThingTopics();

0 commit comments

Comments
 (0)