mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-12-15 10:01:39 +01:00
fix: Use metered properly
This commit is contained in:
parent
4b09745fce
commit
e1b027a68d
18 changed files with 245 additions and 264 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue