On 3/17/07 12:09 PM, "email@hidden"
<email@hidden> wrote:
> Date: Fri, 16 Mar 2007 16:30:07 -0600
> From: Andrew Stagg <email@hidden>
> Subject: Interfacing with Cypress FX2
> To: USB Mailing List Apple <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Hello,
>
> I am developing an application for sending XSVF data to an FPGA over
> USB using a Cypress FX2 chip.
> I've got a bulk in and a bulk out endpoint setup and I can
> successfully transfer data between the device and the host, but I am
> relatively new to IOKit and I was wondering if there is any concern
> with using global pointers to the interface and endpoints for each
> call to ReadPipeAsync() and WritePipeAsync(). This is a lot easier
> than going through the process of enumerating the interfaces and
> endpoints each time I want to read or write data... but I don't know
> if it might cause problems?
>
> Thanks,
> -Andrew Stagg
I'm not sure what you mean here. Opinions differ about the use of globals,
some people think they're inherently evil, but I don't think that's your
question.
You say:
> This is a lot easier
> than going through the process of enumerating the interfaces and
> endpoints each time I want to read or write data... but I don't know
> if it might cause problems?
What do you mean by "each time" and what sort of problems do you think it
might cause?
Finding the interface only needs to be done once in the lifetime of your
application when it first needs it. That interface is valid until the device
is unplugged. If you don't open the device interface or interface interface,
it remains available for opening by other applications. I have no idea what
XSVF data is but your device sounds like it is very specific to your
application, so it is probably OK to find and open the interface when you
launch your application, and close it when you quit. If you have other
applications which sometimes need to communicate with the device, you would
open the interface to perform some communication, communicate, then close
the interface.
hth, Stuart
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden
This email sent to email@hidden