From ef5cb2c8766c1d5bb91f8352e3dabdea82793234 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Wed, 13 Sep 2023 01:50:57 +0200 Subject: [PATCH] Added verifying status message --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c2f2127..d84b857 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,6 +88,7 @@ enum Status<'a> { PreparingUpdate, Erasing, Writing { progress: u32 }, + Verifying, UpdateComplete, } @@ -492,7 +493,15 @@ async fn attempt_update( } debug!("Total size: {}", size); - updater.verify_and_mark_updated(PUBLIC_SIGNING_KEY, &signature, size).unwrap(); + let status = Status::Verifying.vec(); + client + .send_message(TOPIC_STATUS, &status, QualityOfService::QoS1, false) + .await + .unwrap(); + + updater + .verify_and_mark_updated(PUBLIC_SIGNING_KEY, &signature, size) + .unwrap(); // Update mqtt message should be send using retain // TODO: Clear the message