UemReader

Type Alias UemReader 

Source
pub type UemReader = Arc<Mutex<dyn UemReaderInternalTrait + Send>>;
Expand description

General reader type using Arc standard type

Aliased Type§

pub struct UemReader { /* private fields */ }

Trait Implementations§

Source§

impl UemCommandsTrait for UemReader

Source§

fn commands(&mut self) -> UemCommands<'_>

Source§

impl UemReaderInternalTrait for UemReader

Source§

fn open(&mut self) -> UemResult

Open interface with the reader

§Example
if uem_reader.open().is_err() {
    return;
}
Source§

fn close(&mut self) -> Result<(), UemError>

Close opened reader interface

§Example
if uem_reader.close().is_err() {
    return;
};
Source§

fn send(&mut self, command: &[u8]) -> UemResultVec

Send a command to a reader and receive response

§Arguments
  • command - a vector of command bytes
§Returns

Ok(()) on success, otherwise returns an error.

§Example
// Beep 1 time using command byte vector
if uem_reader.send(&vec![0x05_u8, 0x01_u8]).is_err() {
    return;
}