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 <jpwhiting@kde.org>
This commit is contained in:
Jeremy Whiting 2024-02-07 14:23:31 -07:00
parent ec819e6d00
commit ce95a53ee8
2 changed files with 16 additions and 1 deletions

View file

@ -195,6 +195,16 @@
<arg type="u" name="buffer_size" direction="in"/>
</method>
<!--
GetWifiDebugMode:
@mode: 0 for off, 1 for on. Uses an integer for fleximility.
Get method for SetWifiDebugMode.
-->
<method name="GetWifiDebugMode">
<arg type="u" name="mode" direction="out"/>
</method>
</interface>
</node>

View file

@ -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