0
votes

We are trying to communicate with a USB HIDDevice. This device is working fine in windows, where we can send a report and get a report back using WriteFile() and ReadFile().

On the Mac, we are trying to interface with the device using setReoprt() and getReport(). But getReport() is not returning any data, but an error.

What is the wrong in the application?

1
Could you edit your question and post the code you’re using and the error message(s)?user557219
There is no Error message and no valid data for GetReport(). ThanksMusthafa P P

1 Answers

0
votes

In order to make use of asynchronous behavior, the event source obtained using getAsyncEventSource must be added to a run loop.

The above note is part of the comment of setReport. U might need to learn the runloop mechanism of Runloop in Mac OS first.

Since it's impossible to explain the mechanism here. The following functions and orders might help u coding when u get familiar with RunLoop.(Try to search "CFRunLoop" in google)

CFRunLoopGetCurrent();
CFRunLoopRun();
CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
CFRunLoopStop(CFRunLoopRef rl);(i usually call this function in the callback method)