I started messing around with various things to see if there was anything I could do. Then I remembered reading about USB HID somewhere that when you send a command to set an Output Report, an Input Report is generated. You are supposed to acknowledge the Input report with a receipt. That makes me wonder whether my set command didn't finish the process because the generated input report wasn't received back. The custom device we have doesn't work like that since the USB HID reports are used more like a USB HID Feature Report rather than the proper device reports to pass back-and-forth communications.
Since our custom device will never generate an input report when the output report is sent to it, I decided to pretend that everything is an input report so that it doesn't generate any response. I made one small change to the code and now it works.
success = IOHIDDeviceSetReport(dev!, kIOHIDReportTypeInput, CFIndex(buffer[0]), bufferPointer, bufferLength). //a way to force no report generation
At the end of the day, our custom USB HID device is not implementing the usage properly, but this is probably true for many micro-controller-based USB HID devices that people were implementing based on Jan Axelson's USB HID examples on PC decades ago.
Topic:
App & System Services
SubTopic:
Drivers
Tags: