Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ impl<'a> Device<'a> {
Ok(unsafe { config_descriptor::from_libusb(config) })
}

/// Returns the number of the port that the device is connected to.
pub fn port_number(&self) -> u8 {
unsafe { libusb_get_port_number(self.device) }
}

/// Returns the number of the bus that the device is connected to.
pub fn bus_number(&self) -> u8 {
unsafe {
Expand Down