Skip to content

Commit 68ff14c

Browse files
committed
Also directly return the error state when calling the update method
1 parent b5b4d81 commit 68ff14c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/utility/ota/OTALogic.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ OTALogic::OTALogic(OTAStorage & ota_storage)
4848
* PUBLIC MEMBER FUNCTIONS
4949
******************************************************************************/
5050

51-
void OTALogic::update()
51+
OTAError OTALogic::update()
5252
{
5353
OTAState prev_ota_state;
5454
/* The purpose of this loop is to allow the transition of
@@ -74,6 +74,8 @@ void OTALogic::update()
7474
case OTAState::Error: break;
7575
}
7676
} while(_ota_state != prev_ota_state);
77+
78+
return _ota_error;
7779
}
7880

7981
void OTALogic::onOTADataReceived(uint8_t const * const data, size_t const length)

src/utility/ota/OTALogic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class OTALogic
5858
OTALogic(OTAStorage & ota_storage);
5959

6060

61-
void update();
61+
OTAError update();
6262
void onOTADataReceived(uint8_t const * const data, size_t const length);
6363

6464
#ifdef HOST

0 commit comments

Comments
 (0)