Skip to content

Commit beedce2

Browse files
committed
OTA: uniform handling of Ota flags
1 parent bf24d44 commit beedce2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ota/interface/OTAInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ OTACloudProcessInterface::State OTACloudProcessInterface::idle(Message* msg) {
167167
OTACloudProcessInterface::State OTACloudProcessInterface::otaAvailable() {
168168
// depending on the policy decided on this device the ota process can start immediately
169169
// or wait for confirmation from the user
170-
if((policies & (ApprovalRequired | Approved)) == ApprovalRequired ) {
170+
if(getOtaPolicy(ApprovalRequired) && !getOtaPolicy(Approved)) {
171171
return OtaAvailable;
172172
} else {
173-
policies &= ~Approved;
173+
disableOtaPolicy(Approved);
174174
return StartOTA;
175175
} // TODO add an abortOTA command? in this case delete the context
176176
}

0 commit comments

Comments
 (0)