From d014ae0bffc9283c0b4de9196984c28eedd8e585 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sun, 7 Mar 2021 09:51:17 +0800 Subject: [PATCH] fix ls_sleeps communication to device clients --- src/plugins/AdminPlugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/AdminPlugin.cpp b/src/plugins/AdminPlugin.cpp index bba1b39a9..7e0a67074 100644 --- a/src/plugins/AdminPlugin.cpp +++ b/src/plugins/AdminPlugin.cpp @@ -24,6 +24,12 @@ void AdminPlugin::handleGetRadio(const MeshPacket &req) // We create the reply here AdminMessage r = AdminMessage_init_default; r.get_radio_response = devicestate.radio; + + // NOTE: The phone app needs to know the ls_secs value so it can properly expect sleep behavior. + // So even if we internally use 0 to represent 'use default' we still need to send the value we are + // using to the app (so that even old phone apps work with new device loads). + r.get_radio_response.preferences.ls_secs = getPref_ls_secs(); + r.which_variant = AdminMessage_get_radio_response_tag; reply = allocDataProtobuf(r); }