Skip to content

Commit

Permalink
Show location ID and registry entry ID in hex in debug format
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmehall committed Jul 27, 2024
1 parent 6b1f182 commit e361ae7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ impl std::fmt::Debug for DeviceInfo {

#[cfg(target_os = "macos")]
{
s.field("location_id", &self.location_id);
s.field("registry_entry_id", &self.registry_id);
s.field("location_id", &format_args!("0x{:08X}", self.location_id));
s.field(
"registry_entry_id",
&format_args!("0x{:08X}", self.registry_id),
);
}

s.field("interfaces", &self.interfaces);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/macos_iokit/enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub(crate) fn service_by_registry_id(registry_id: u64) -> Result<IoService, Erro

fn probe_device(device: IoService) -> Option<DeviceInfo> {
let registry_id = get_id(&device)?;
log::debug!("Probing device {registry_id}");
log::debug!("Probing device {registry_id:08x}");

// Can run `ioreg -p IOUSB -l` to see all properties
Some(DeviceInfo {
Expand Down

0 comments on commit e361ae7

Please sign in to comment.