pub struct UemCommandsReader<'a> { /* private fields */ }Expand description
Structure for commands controlling a reader itself
Implementations§
Source§impl<'a> UemCommandsReader<'a>
impl<'a> UemCommandsReader<'a>
Sourcepub fn led(
&mut self,
count: u8,
color: UemColor,
post_color: UemColor,
) -> UemResult
pub fn led( &mut self, count: u8, color: UemColor, post_color: UemColor, ) -> UemResult
Blink count times with led of specific color
and remain with other color switched on
§Arguments
§Returns
Ok(()) on success, otherwise returns an error.
§Example
UemReaderInternal,
usb::find_usb_readers};
// Blink 3 times with green and remain yellow
if uem_reader.commands().reader()
.led(3, UemColor::Green, UemColor::Yellow)
.is_err() {
return;
}Sourcepub fn power_radio(&mut self, on: bool) -> UemResult
pub fn power_radio(&mut self, on: bool) -> UemResult
Turn radio chip on
§Arguments
on-trueif needed to power on the radio, otherwisefalse
§Returns
Ok(()) on success, otherwise returns an UemError.
§Example
let mut uem_cmds = uem_reader.commands();
let mut uem_cmds_reader = uem_cmds.reader();
if uem_cmds_reader.power_radio(true).is_err() {
return;
}Sourcepub fn radio_off_on(&mut self, duration: u16) -> UemResult
pub fn radio_off_on(&mut self, duration: u16) -> UemResult
Switch radio field off for a specified duration
By switching off radio field, cards in the field are beind unpowered and thus reset.
§Arguments
duration- Number of milliseconds to switch off radio field. If set to 0, the field will be switched off permanently. The field can be switched on again with the same command and non-zero duration.
§Returns
Ok(()) on success, otherwise returns an error.
§Example
// Switch off radio for 10 ms
if uem_reader.commands().reader()
.radio_off_on(10)
.is_err() {
return;
}Sourcepub fn get_version(&mut self) -> UemResultVec
pub fn get_version(&mut self) -> UemResultVec
Sourcepub fn get_serial(&mut self) -> UemResultVec
pub fn get_serial(&mut self) -> UemResultVec
Auto Trait Implementations§
impl<'a> Freeze for UemCommandsReader<'a>
impl<'a> RefUnwindSafe for UemCommandsReader<'a>
impl<'a> Send for UemCommandsReader<'a>
impl<'a> Sync for UemCommandsReader<'a>
impl<'a> Unpin for UemCommandsReader<'a>
impl<'a> UnwindSafe for UemCommandsReader<'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