From cc0126636c6c65a8c543f9af1776b956f8ec7218 Mon Sep 17 00:00:00 2001 From: topquark12 Date: Thu, 7 Jan 2021 18:01:43 +0800 Subject: [PATCH] report save success save does not hang, it just did not report save success. Closes #33 Reviewed-on: https://git.m-labs.hk/M-Labs/thermostat/pulls/44 Co-Authored-By: topquark12 Co-Committed-By: topquark12 --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 6823992..571d04f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -399,7 +399,9 @@ fn main() -> ! { if channel.is_none() || channel == Some(c) { let config = ChannelConfig::new(&mut channels, c); match store.write_value(CHANNEL_CONFIG_KEY[c], &config, &mut store_value_buf) { - Ok(()) => {} + Ok(()) => { + send_line(&mut socket, b"{}"); + } Err(e) => { error!("unable to save channel {} config to flash: {:?}", c, e); let _ = writeln!(socket, "{{\"error\":\"{:?}\"}}", e);