Struct uhppote_rs::Device
source · [−]pub struct Device<'a> { /* private fields */ }Implementations
sourceimpl<'a> Device<'a>
impl<'a> Device<'a>
pub fn new(u: &'a mut UHPPOTE, id: u32) -> Device<'a>
sourcepub fn get_config(&mut self) -> Result<DeviceConfig>
pub fn get_config(&mut self) -> Result<DeviceConfig>
Get a DeviceConfig for a device id.
sourcepub fn set_address(
&mut self,
address: String,
subnet: String,
gateway: String
) -> Result<()>
pub fn set_address(
&mut self,
address: String,
subnet: String,
gateway: String
) -> Result<()>
Set the IP address, subnet mask, and gateway of a device.
sourcepub fn get_status(&mut self) -> Result<Status>
pub fn get_status(&mut self) -> Result<Status>
Get the Status of a device.
sourcepub fn get_date_time(&mut self) -> Result<NaiveDateTime>
pub fn get_date_time(&mut self) -> Result<NaiveDateTime>
Get the NaiveDateTime of the device.
sourcepub fn set_date_time(&mut self, time: NaiveDateTime) -> Result<()>
pub fn set_date_time(&mut self, time: NaiveDateTime) -> Result<()>
Set the date and time of the device.
sourcepub fn get_listener(&mut self) -> Result<SocketAddr>
pub fn get_listener(&mut self) -> Result<SocketAddr>
Return the IP address and port to which the selected controller sends events.
pub fn set_listener(&mut self, listener: SocketAddr) -> Result<()>
sourcepub fn get_door_control(&mut self, door: u8) -> Result<DoorControl>
pub fn get_door_control(&mut self, door: u8) -> Result<DoorControl>
Get the DoorControl (DoorControlMode and delay) of a door. Note that the first door id is 1, not 0.
sourcepub fn set_door_control(
&mut self,
door: u8,
mode: DoorControlMode,
delay: u8
) -> Result<()>
pub fn set_door_control(
&mut self,
door: u8,
mode: DoorControlMode,
delay: u8
) -> Result<()>
Set the DoorControl (DoorControlMode and delay) of a door.Note that the first door id is 1, not 0.
sourcepub fn open_door(&mut self, door: u8) -> Result<()>
pub fn open_door(&mut self, door: u8) -> Result<()>
Open a door. Note that the first door id is 1, not 0.
sourcepub fn get_card_by_index(&mut self, index: u32) -> Result<Card>
pub fn get_card_by_index(&mut self, index: u32) -> Result<Card>
Get a specific Card by its index.
sourcepub fn get_event_index(&mut self) -> Result<u32>
pub fn get_event_index(&mut self) -> Result<u32>
Get the event index.
sourcepub fn set_event_index(&mut self, index: u32) -> Result<()>
pub fn set_event_index(&mut self, index: u32) -> Result<()>
Set the event index.
sourcepub fn record_special_events(&mut self, enabled: bool) -> Result<()>
pub fn record_special_events(&mut self, enabled: bool) -> Result<()>
Enable/disable recording of special events
sourcepub fn get_time_profile(&mut self, id: u8) -> Result<TimeProfile>
pub fn get_time_profile(&mut self, id: u8) -> Result<TimeProfile>
Get a TimeProfile by its index.
sourcepub fn set_time_profile(&mut self, profile: TimeProfile) -> Result<()>
pub fn set_time_profile(&mut self, profile: TimeProfile) -> Result<()>
Set a TimeProfile by its index. Note that profile ID has to be larger than 1.
sourcepub fn clear_time_profiles(&mut self) -> Result<()>
pub fn clear_time_profiles(&mut self) -> Result<()>
Clear all TimeProfiles.
sourcepub fn refresh_task_list(&mut self) -> Result<()>
pub fn refresh_task_list(&mut self) -> Result<()>
Refresh the task list.
sourcepub fn clear_task_list(&mut self) -> Result<()>
pub fn clear_task_list(&mut self) -> Result<()>
Clear the task list
Trait Implementations
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more