From ce95a53ee85862b7fa9fd4271b9a8712d5ad9678 Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Wed, 7 Feb 2024 14:23:31 -0700 Subject: [PATCH] wifidebug: Add GetWifiDebugMode to get the current wifi debug mode. This may be useful in cases where SetWifiDebugMode has failed to check what the current state/setting is. Though if SetWifiDebugMode has failed we may be in weird state so logs of steamos-manager should be checked to see what failed. Signed-off-by: Jeremy Whiting --- com.steampowered.SteamOSManager1.xml | 10 ++++++++++ src/manager.rs | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/com.steampowered.SteamOSManager1.xml b/com.steampowered.SteamOSManager1.xml index 1c1748b..f1194d6 100644 --- a/com.steampowered.SteamOSManager1.xml +++ b/com.steampowered.SteamOSManager1.xml @@ -195,6 +195,16 @@ + + + + + diff --git a/src/manager.rs b/src/manager.rs index 345fdbf..513c406 100644 --- a/src/manager.rs +++ b/src/manager.rs @@ -28,7 +28,7 @@ use tokio::{fs::File, io::AsyncWriteExt, process::Command}; use zbus::zvariant::OwnedFd; use zbus_macros::dbus_interface; -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Debug, Copy, Clone)] #[repr(u32)] enum WifiDebugMode { Off, @@ -498,6 +498,11 @@ impl SMManager { } } + async fn get_wifi_debug_mode(&mut self) -> u32 { + // Get the wifi debug mode + self.wifi_debug_mode as u32 + } + async fn set_wifi_debug_mode(&mut self, mode: u32, buffer_size: u32) -> bool { // Set the wifi debug mode to mode, using an int for flexibility going forward but only // doing things on 0 or 1 for now