when I upgrade my mac os to version 13.3. I found the usb device interface number is always 0(error ,the right is non-0) when I use kUSBInterfaceNumber from hidapi library(https://github.com/libusb/hidapi). is anyone cause this problem .who can help me. thank you .
static int32_t get_int_property(IOHIDDeviceRef device, CFStringRef key) { CFTypeRef ref; int32_t value;
ref = IOHIDDeviceGetProperty(device, key);
if (ref) {
if (CFGetTypeID(ref) == CFNumberGetTypeID()) {
CFNumberGetValue((CFNumberRef) ref, kCFNumberSInt32Type, &value);
return value;
}
else {
printf("\nCFGetTypeID not equal!\n");
}
}
else {
printf("\nref=%p\n",ref);
}
return 0;
}
cur_dev->interface_number =
get_int_property(dev, CFSTR(kUSBInterfaceNumber));