From 59bed97d9e0bf1dbacd97471e7467a533acc6969 Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Mon, 15 Jan 2024 12:52:15 +0400 Subject: [PATCH] Add validation code back. --- src/network.toit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/network.toit b/src/network.toit index 0d91100a..9f83b9ec 100644 --- a/src/network.toit +++ b/src/network.toit @@ -35,6 +35,16 @@ run-network device/Device: address := "http://$network.address:$socket.local-address.port" logger.info "running Jaguar device '$device.name' (id: '$device.id') on '$address'" + // We've successfully connected to the network, so we consider + // the current firmware functional. Go ahead and validate the + // firmware if requested to do so. + if firmware-is-validation-pending: + if firmware.validate: + logger.info "firmware update validated after connecting to network" + firmware-is-validation-pending = false + else: + logger.error "firmware update failed to validate" + // We run two tasks concurrently: One broadcasts the device identity // via UDP and one serves incoming HTTP requests. We run the tasks // in a group so if one of them terminates, we take the other one down