Skip to content

hid_device_info->interface_number zero on macOS 13.3 #531

@mcuee

Description

@mcuee

Discussed in #527

Originally posted by dingsijie-nreal April 11, 2023
I've noticed comment here: https://github.com/libusb/hidapi/blob/master/mac/hid.c#L543
The interesting thing is: macOS Monterey(12.6.3) works perfectly with my usb gadget, I got expected interface numbers.
the output of test.c is shown below:

hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime ve
Compile-time version matches runtime version of hidapi.

Device Found
  type: 3318 0424
  path: DevSrvsID:4298350859
  serial_number: A00016:33:33
  Manufacturer: xxxx
  Product:    xxxx
  Release:      1
  Interface:    3
  Usage (page): 0x0 (0x41)
  Bus type: 1

  Report Descriptor: (27 bytes)
0x05, 0x41, 0x09, 0x00, 0xa1, 0x01, 0x15, 0x00, 0x25, 0xff, 
0x19, 0x01, 0x29, 0x08, 0x95, 0x40, 0x75, 0x08, 0x81, 0x02, 
0x19, 0x01, 0x29, 0x08, 0x91, 0x02, 0xc0, 
Device Found
  type: 3318 0424
  path: DevSrvsID:4298350872
  serial_number: A00016:33:33
  Manufacturer: xxxx
  Product:      xxxxx
  Release:      1
  Interface:    5
  Usage (page): 0x0 (0x41)
  Bus type: 1

  Report Descriptor: (27 bytes)
0x05, 0x41, 0x09, 0x00, 0xa1, 0x01, 0x15, 0x00, 0x25, 0xff, 
0x19, 0x01, 0x29, 0x08, 0x95, 0x40, 0x75, 0x08, 0x81, 0x02, 
0x19, 0x01, 0x29, 0x08, 0x91, 0x02, 0xc0, 
Device Found
  type: 3318 0424
  path: DevSrvsID:4298350862
  serial_number: A00016:33:33
  Manufacturer: xxxx
  Product:      xxxxx
  Release:      1
  Interface:    4
  Usage (page): 0x0 (0x41)
  Bus type: 1

  Report Descriptor: (27 bytes)
0x05, 0x41, 0x09, 0x00, 0xa1, 0x01, 0x15, 0x00, 0x25, 0xff, 
0x19, 0x01, 0x29, 0x08, 0x95, 0x40, 0x75, 0x08, 0x81, 0x02, 
0x19, 0x01, 0x29, 0x08, 0x91, 0x02, 0xc0, 

But, after upgrading to macOS 13.3 the result changes to flowing:

hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 3318 0424
  path: DevSrvsID:4294984005
  serial_number: A00016:33:33
  Manufacturer: xxxxx
  Product:      xxxxx
  Release:      1
  Interface:    0
  Usage (page): 0x0 (0x41)
  Bus type: 1

  Report Descriptor: (27 bytes)
0x05, 0x41, 0x09, 0x00, 0xa1, 0x01, 0x15, 0x00, 0x25, 0xff, 
0x19, 0x01, 0x29, 0x08, 0x95, 0x40, 0x75, 0x08, 0x81, 0x02, 
0x19, 0x01, 0x29, 0x08, 0x91, 0x02, 0xc0, 
Device Found
  type: 3318 0424
  path: DevSrvsID:4294984010
  serial_number: A00016:33:33
  Manufacturer: xxxxx
  Product:      xxxxx
  Release:      1
  Interface:    0
  Usage (page): 0x0 (0x41)
  Bus type: 1

  Report Descriptor: (27 bytes)
0x05, 0x41, 0x09, 0x00, 0xa1, 0x01, 0x15, 0x00, 0x25, 0xff, 
0x19, 0x01, 0x29, 0x08, 0x95, 0x40, 0x75, 0x08, 0x81, 0x02, 
0x19, 0x01, 0x29, 0x08, 0x91, 0x02, 0xc0, 
Device Found
  type: 3318 0424
  path: DevSrvsID:4294984008
  serial_number: A00016:33:33
  Manufacturer: xxxxx
  Product:      xxxxx
  Release:      1
  Interface:    0
  Usage (page): 0x0 (0x41)
  Bus type: 1

  Report Descriptor: (27 bytes)
0x05, 0x41, 0x09, 0x00, 0xa1, 0x01, 0x15, 0x00, 0x25, 0xff, 
0x19, 0x01, 0x29, 0x08, 0x95, 0x40, 0x75, 0x08, 0x81, 0x02, 
0x19, 0x01, 0x29, 0x08, 0x91, 0x02, 0xc0, 

My mission it to discriminate 3 different components on my USB gadget, and the interface number was the key that I rely on.
But with 0 interfaces numbers, I don't know how to do my job.
Any one get any ideas? Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    macOSRelated to macOS backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions