Skip to content

Commit d781033

Browse files
committed
Add configuration flag to sendOTAPropertiesToCloud() fuction in order to append OTA_REQ property
1 parent f24375c commit d781033

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/ArduinoIoTCloudTCP.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -763,14 +763,16 @@ void ArduinoIoTCloudTCP::sendPropertiesToCloud()
763763
}
764764

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

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

src/ArduinoIoTCloudTCP.h

+1-1
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)