report save success

save does not hang, it just did not report save success. Closes #33

Reviewed-on: M-Labs/thermostat#44
Co-Authored-By: topquark12 <aw@m-labs.hk>
Co-Committed-By: topquark12 <aw@m-labs.hk>
This commit is contained in:
topquark12 2021-01-07 18:01:43 +08:00 committed by sb10q
parent 45b7c4e669
commit cc0126636c

View File

@ -399,7 +399,9 @@ fn main() -> ! {
if channel.is_none() || channel == Some(c) { if channel.is_none() || channel == Some(c) {
let config = ChannelConfig::new(&mut channels, c); let config = ChannelConfig::new(&mut channels, c);
match store.write_value(CHANNEL_CONFIG_KEY[c], &config, &mut store_value_buf) { match store.write_value(CHANNEL_CONFIG_KEY[c], &config, &mut store_value_buf) {
Ok(()) => {} Ok(()) => {
send_line(&mut socket, b"{}");
}
Err(e) => { Err(e) => {
error!("unable to save channel {} config to flash: {:?}", c, e); error!("unable to save channel {} config to flash: {:?}", c, e);
let _ = writeln!(socket, "{{\"error\":\"{:?}\"}}", e); let _ = writeln!(socket, "{{\"error\":\"{:?}\"}}", e);