File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP():
79
79
_ota_topic_in{" " },
80
80
_ota_topic_out{" " },
81
81
_ota_logic{nullptr },
82
- _ota_storage_type{static_cast <int >(OTAStorage::Type::NotAvailable)}
82
+ _ota_storage_type{static_cast <int >(OTAStorage::Type::NotAvailable)},
83
+ _ota_error{static_cast <int >(OTAError::None)}
83
84
{
84
85
85
86
}
@@ -154,7 +155,8 @@ void ArduinoIoTCloudTCP::update()
154
155
* to transition to the OTA logic update states.
155
156
*/
156
157
if (_ota_logic) {
157
- _ota_logic->update ();
158
+ OTAError const err = _ota_logic->update ();
159
+ _ota_error = static_cast <int >(err);
158
160
}
159
161
160
162
// Check if a primitive property wrapper is locally changed
@@ -211,6 +213,7 @@ void ArduinoIoTCloudTCP::setOTAStorage(OTAStorage & ota_storage)
211
213
{
212
214
_ota_storage_type = static_cast <int >(ota_storage.type ());
213
215
addPropertyReal (_ota_storage_type, " OTA_STORAGE_TYPE" , Permission::Read);
216
+ addPropertyReal (_ota_error, " OTA_ERROR" , Permission::Read);
214
217
if (_ota_logic) delete _ota_logic;
215
218
_ota_logic = new OTALogic (ota_storage);
216
219
}
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
124
124
125
125
OTALogic * _ota_logic;
126
126
int _ota_storage_type;
127
+ int _ota_error;
127
128
128
129
inline String getTopic_stdin () { return String (" /a/d/" + getDeviceId () + " /s/i" ); }
129
130
inline String getTopic_stdout () { return String (" /a/d/" + getDeviceId () + " /s/o" ); }
You can’t perform that action at this time.
0 commit comments