Struct msi_klm::HidApi
[−]
[src]
pub struct HidApi { /* fields omitted */ }
Object for handling hidapi context and implementing RAII for it. Only one instance can exist at a time.
Methods
impl HidApi
[src]
fn new() -> Result<HidApi, &'static str>
Initializes the HID
fn refresh_devices(&mut self)
Refresh devices list and information about them (to access them use
devices()
method)
fn devices(&self) -> Vec<HidDeviceInfo>
Returns list of objects containing information about connected devices
fn open(&self, vid: u16, pid: u16) -> Result<HidDevice, &'static str>
Open a HID device using a Vendor ID (VID) and Product ID (PID)
fn open_serial(
&self,
vid: u16,
pid: u16,
sn: &str
) -> Result<HidDevice, &'static str>
&self,
vid: u16,
pid: u16,
sn: &str
) -> Result<HidDevice, &'static str>
Open a HID device using a Vendor ID (VID), Product ID (PID) and a serial number.
fn open_path(&self, device_path: &str) -> Result<HidDevice, &'static str>
The path name be determined by calling hid_enumerate(), or a platform-specific path name can be used (eg: /dev/hidraw0 on Linux).