Skip to content

Commit

Permalink
feat: Add stored and connected to AccessPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Nov 8, 2023
1 parent 51a7ccb commit 2ad4dc3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/network/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ pub struct AccessPoint {
pub strength: u8,
pub associated_connection: Path<'static>,
pub dbus_path: Path<'static>,
pub connected: bool,
pub stored: bool,
}

unsafe impl Send for AccessPoint {}
Expand All @@ -104,26 +106,30 @@ impl Append for AccessPoint {
i.append(&self.strength);
i.append(&self.associated_connection);
i.append(&self.dbus_path);
i.append(&self.connected);
i.append(&self.stored);
});
}
}

impl<'a> Get<'a> for AccessPoint {
fn get(i: &mut arg::Iter<'a>) -> Option<Self> {
let (ssid, strength, associated_connection, dbus_path) =
<(Vec<u8>, u8, Path<'static>, Path<'static>)>::get(i)?;
let (ssid, strength, associated_connection, dbus_path, connected, stored) =
<(Vec<u8>, u8, Path<'static>, Path<'static>, bool, bool)>::get(i)?;
Some(AccessPoint {
ssid,
strength,
associated_connection,
dbus_path,
connected,
stored,
})
}
}

impl Arg for AccessPoint {
const ARG_TYPE: arg::ArgType = ArgType::Struct;
fn signature() -> Signature<'static> {
unsafe { Signature::from_slice_unchecked("(ayyoo)\0") }
unsafe { Signature::from_slice_unchecked("(ayyoobb)\0") }
}
}

0 comments on commit 2ad4dc3

Please sign in to comment.