pub struct Device<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Device<'a>
impl<'a> Device<'a>
Sourcepub fn clear_time_profiles(&self) -> Result<()>
pub fn clear_time_profiles(&self) -> Result<()>
Remove all TimeProfile
s from the Device
.
Sourcepub fn get_config(&self) -> Result<DeviceConfig>
pub fn get_config(&self) -> Result<DeviceConfig>
Get a DeviceConfig
for a the Device
.
Sourcepub fn get_door_control(&self, door: u8) -> Result<DoorControl>
pub fn get_door_control(&self, door: u8) -> Result<DoorControl>
Get a DoorControl
for a specific door.
Note that doors are addressed 1-4, not 0-3.
Sourcepub fn get_event_index(&self) -> Result<u32>
pub fn get_event_index(&self) -> Result<u32>
Get the event index the Device
Sourcepub fn get_listener(&self) -> Result<SocketAddr>
pub fn get_listener(&self) -> Result<SocketAddr>
Sourcepub fn get_time(&self) -> Result<NaiveDateTime>
pub fn get_time(&self) -> Result<NaiveDateTime>
Get the current time of the Device
.
Sourcepub fn get_time_profile(&self, profile_id: u8) -> Result<TimeProfile>
pub fn get_time_profile(&self, profile_id: u8) -> Result<TimeProfile>
Get the TimeProfile
by ID.
Sourcepub fn open_door(&self, door: u8) -> Result<()>
pub fn open_door(&self, door: u8) -> Result<()>
Open a door. Note that doors are addressed 1-4, not 0-3.
Sourcepub fn refresh_task_list(&self) -> Result<()>
pub fn refresh_task_list(&self) -> Result<()>
Refresh the task list of the Device
.
Sourcepub fn set_door_control_state(
&self,
door: u8,
state: DoorControl,
) -> Result<DoorControl>
pub fn set_door_control_state( &self, door: u8, state: DoorControl, ) -> Result<DoorControl>
Set the DoorControl
for a specific door.
Note that the delay is in seconds and can maximally be 255.
Sourcepub fn set_event_index(&self, index: u32) -> Result<()>
pub fn set_event_index(&self, index: u32) -> Result<()>
Set the event index the Device
will use.
Sourcepub fn set_network_config(
&self,
address: Ipv4Addr,
subnet: Ipv4Addr,
gateway: Ipv4Addr,
) -> Result<()>
pub fn set_network_config( &self, address: Ipv4Addr, subnet: Ipv4Addr, gateway: Ipv4Addr, ) -> Result<()>
Set IP address, subnet mask and gateway for the Device
.
Sourcepub fn enable_record_special_events(&self, enable: bool) -> Result<()>
pub fn enable_record_special_events(&self, enable: bool) -> Result<()>
Enable the recording of special events.
Sourcepub fn set_time(&self, datetime: NaiveDateTime) -> Result<NaiveDateTime>
pub fn set_time(&self, datetime: NaiveDateTime) -> Result<NaiveDateTime>
Set the local time of the Device
.
Sourcepub fn add_or_update_time_profile(&self, profile: TimeProfile) -> Result<()>
pub fn add_or_update_time_profile(&self, profile: TimeProfile) -> Result<()>
Add or update new TimeProfile
to the Device
.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Device<'a>
impl<'a> RefUnwindSafe for Device<'a>
impl<'a> Send for Device<'a>
impl<'a> Sync for Device<'a>
impl<'a> Unpin for Device<'a>
impl<'a> UnwindSafe for Device<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more