fix: Use metered properly

This commit is contained in:
Fabio Lenherr / DashieTM 2023-12-13 00:41:14 +01:00
parent 4b09745fce
commit e1b027a68d
18 changed files with 245 additions and 264 deletions

View file

@ -6,6 +6,10 @@ use re_set_lib::network::connection::Connection as ResetConnection;
use std::collections::HashMap;
use std::time::Duration;
use crate::components::utils::BASE;
use crate::components::utils::DBUS_PATH;
use crate::components::utils::WIRELESS;
#[derive(Default, Copy, Clone)]
pub enum IpProtocol {
#[default]
@ -19,12 +23,12 @@ type ResultType =
pub fn get_connection_settings(path: Path<'static>) -> ResetConnection {
let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(
"org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSet/Daemon",
BASE,
DBUS_PATH,
Duration::from_millis(1000),
);
let res: ResultType =
proxy.method_call("org.Xetibo.ReSet.Wireless", "GetConnectionSettings", (path,));
proxy.method_call(WIRELESS, "GetConnectionSettings", (path,));
if res.is_err() {
ResetConnection::default();
}