Index: sources/update/MsgLink.h =================================================================== diff -u -r6338d2d734d71903fd4afc8371c58dc3facd432a -r0ace5d8112bd6efbf7c4ebb5fd10d62456221429 --- sources/update/MsgLink.h (.../MsgLink.h) (revision 6338d2d734d71903fd4afc8371c58dc3facd432a) +++ sources/update/MsgLink.h (.../MsgLink.h) (revision 0ace5d8112bd6efbf7c4ebb5fd10d62456221429) @@ -127,7 +127,7 @@ * in FW being capable of making the UI update looking * like it got locked up. */ - enum TimeoutEnum { + enum class TimeoutEnum { None = 0, ///< Not using timeout. Waiting = 1, ///< Waiting till next ack/nack or timeout. Success = 2, ///< While waiting got Ack. @@ -257,11 +257,13 @@ continue; } - // We got a NACK while timing out, abort this so the user can + // If we got a NACK while timing out, abort this so the user can // note that a long thing failed and can feel they are in control of // retrying something that was significant. + // + // Otherwise return true. _expecting = false; - return (_timeoutMode != 3) ? true : false; + return (TimeoutEnum::Failure != _timeoutMode) ? true : false; } // No retries in _timeoutMode. @@ -294,7 +296,6 @@ } _expecting = false; - // swUpdate_log("MsgLink::sendOk failed."); return false; } @@ -352,7 +353,7 @@ // This way a bug in the FW code that sends us replies // can't put it this an infinite stall (which would have to be aborted by a user). _timeout = std::chrono::steady_clock::now() + - std::chrono::duration(resp->ackNack * gAckSleepScale); + std::chrono::duration((resp->ackNack-1) * gAckSleepScale); _timeoutMode = TimeoutEnum::Waiting; } }