Struct uhid_virt::UHIDDevice
source · pub struct UHIDDevice<T: Read + Write> { /* private fields */ }
Implementations§
source§impl<T: Read + Write> UHIDDevice<T>
impl<T: Read + Write> UHIDDevice<T>
Character misc-device handle for a specific HID device
sourcepub fn write(&mut self, data: &[u8]) -> Result<usize>
pub fn write(&mut self, data: &[u8]) -> Result<usize>
The data parameter should contain a data-payload. This is the raw data that you read from your device. The kernel will parse the HID reports.
sourcepub fn write_set_report_reply(&mut self, id: u32, err: u16) -> Result<usize>
pub fn write_set_report_reply(&mut self, id: u32, err: u16) -> Result<usize>
Write a SetReportReply, only use in reponse to a read SetReport event
sourcepub fn write_get_report_reply(
&mut self,
id: u32,
err: u16,
data: Vec<u8>
) -> Result<usize>
pub fn write_get_report_reply( &mut self, id: u32, err: u16, data: Vec<u8> ) -> Result<usize>
Write a GetReportReply, only use in reponse to a read GetReport event
sourcepub fn read(&mut self) -> Result<OutputEvent, StreamError>
pub fn read(&mut self) -> Result<OutputEvent, StreamError>
Reads a queued output event. No reaction is required to an output event, but you should handle them according to your needs.
source§impl UHIDDevice<File>
impl UHIDDevice<File>
sourcepub fn create(params: CreateParams) -> Result<UHIDDevice<File>>
pub fn create(params: CreateParams) -> Result<UHIDDevice<File>>
Opens the character misc-device at /dev/uhid
pub fn create_with_path( params: CreateParams, path: &Path ) -> Result<UHIDDevice<File>>
Auto Trait Implementations§
impl<T> RefUnwindSafe for UHIDDevice<T>where
T: RefUnwindSafe,
impl<T> Send for UHIDDevice<T>where
T: Send,
impl<T> Sync for UHIDDevice<T>where
T: Sync,
impl<T> Unpin for UHIDDevice<T>where
T: Unpin,
impl<T> UnwindSafe for UHIDDevice<T>where
T: UnwindSafe,
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