From 1a491db6fe2328814841312bdee1c9f22bba5194 Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Tue, 12 Nov 2024 09:25:03 -0700 Subject: [PATCH] Don't set wifi debug mode if it isn't changing. Since set_wifi_debug_mode always restarts iwd which has unintentional consequences on oled deck (destroys and recreates the network interface) but not on lcd deck first check if previous mode is different than wanted mode before doing anything. See https://gitlab.steamos.cloud/holo/holo/-/merge_requests/747/diffs#2790dcf348b51beca93939ee9fd81f87566d57c9_0_29 for more information. --- src/manager/root.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/manager/root.rs b/src/manager/root.rs index 7857258..184ab40 100644 --- a/src/manager/root.rs +++ b/src/manager/root.rs @@ -12,7 +12,7 @@ use std::ffi::OsStr; use tokio::fs::File; use tokio::sync::mpsc::Sender; use tokio::sync::oneshot; -use tracing::error; +use tracing::{error, info}; use zbus::zvariant::{self, Fd}; use zbus::{fdo, interface, Connection, SignalContext}; @@ -318,6 +318,12 @@ impl SteamOSManager { Ok(mode) => mode, Err(e) => return Err(fdo::Error::InvalidArgs(e.to_string())), }; + + if self.wifi_debug_mode == wanted_mode { + info!("Not changing wifi debug mode since it's already set to {wanted_mode}"); + return Ok(()); + } + let buffer_size = match options .get("buffer_size") .map(zbus::zvariant::Value::downcast_ref)