Re: First foray into HID, getReport() and setReport()
Re: First foray into HID, getReport() and setReport()
- Subject: Re: First foray into HID, getReport() and setReport()
- From: Sam Waters <email@hidden>
- Date: Wed, 13 Jun 2007 17:47:04 -0700 (PDT)
I'm also wondering if this has been changed yet, or if it will be (use
getReport() to get reports from the interrupt pipe). I have a very similar
situation to Steve below.
If not, add my vote to have this implemented! It would make it much easier for
those of us who have to develop for both Mac and PC since they could be
designed similarly.
thanks,
Sam
-----------------------------------------
Just to follow up on this, I found this old post:
http://lists.apple.com/archives/usb/2003/Feb/msg00114.html
Back in 2003, Fernando says:
A getReport() will be sent as a request on the default (control) pipe. If
your reports are coming through the interrupt IN pipe you will need to use
the HID Manager to get the desired elements. There is currently no way to
get the raw report.
We are looking into fixing getReport() so that you get all reports,
regardless of which pipe they come in. No estimate on whether and when we
will deliver this fix.
This sounds like exactly what I want! Was this fix ever implemented?
Cheers,
Steve.
On 31 Mar 2006, at 13:48, Steve Baxter wrote:
Hi,
Well after much messing around, it seems that it is really not very easy at
all for this device (based on a Cypress PSOC) to write data on EP0 (the control
endpoint). Apparently Cypress have designed the PSOC USB implementation so that
it is almost impossible to use EP0 for anything other than device setup.
So, back to the original question!
We have a very simple USB HID device that has two interrupt endpoints. We
want to sent the device a command on the interrupt out endpoint and receive a
reply on the interrupt in endpoint. Our application is heavily threaded and low
latency is very important for this device. The device never sends unsolicited
data.
So, how do we do this? We want to just send a report using setReport() and
receive the reply using getReport(). This is very simple on Windows (you just
use WriteFile() and ReadFile()), why does the Mac OS X HID implementation make
this simple task so difficult?!
I want to avoid using setInterruptReportHandlerCallback() because:
- I am concerned about the latency. I guess we could set up a thread that
does nothing but run a runloop waiting for callbacks and then pass the data off
to the thread that is actually doing the work, but there will then be some
inter-thread communication costs (the callback thread will probably have to
signal an event of some sort).
- It makes our code substantially more complex - involving a second thread
turns a simple synchronous process into a complicated asynchronous one. There
is much more potential for things to go wrong here!
Does anyone have any ideas?
Cheers,
Steve.
On 14 Mar 2006, at 21:44, Fernando Urbina wrote:
That would certainly be easier for you.
--
Fernando Urbina
USB Technology Team
Apple Computer, Inc.
On Mar 14, 2006, at 10:44 AM, Steve Baxter wrote:
If we switch to using control endpoints will that avoid needing to
mess with setInterruptReportHandlerCallback? Using callbacks would add a lot of
complication for something that really should be very simple. Also, will
setInterruptReportHandlerCallback play nicely with threads? From what I
understand it needs a CFRunLoop - will we receive callbacks even if the main
thread (that the runloop is on) is blocked?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden