[<<][usb][>>][..]
Fri Aug 9 10:04:07 EDT 2013

Sending raw control transfers

Questions:

- Is it possible to send control requests to a device while (of of)
  its interface(s) is claimed by another process?

- Does it make sense to send control requests to an interface?

  Otherwise: how to send data over the default pipe to a second
  interface?

First, let's have a look at bmRequestType (9.3.1 in usb11.pdf)

D7: Data transfer direction
   0 = Host-to-device
   1 = Device-to-host
D6...5: Type
   0 = Standard
   1 = Class
   2 = Vendor
   3 = Reserved
D4...0: Recipient
   0 = Device
   1 = Interface
   2 = Endpoint
   3 = Other
   4...31 = Reserved

What I want to do is to poll for device data using a non-standard
request, directed at a particular interface.

D7   = 1     # Device-to-host
D6-5 = 10    # Vendor
D4-0 = 00001 # Interface

0xC1 for interface or 0xC0 for device
wIndex = interface


It does seem to work for VENDOR requests.

In the at91lib code, requests are handled by the driver - in the CCID
this is CCID_RequestHandler - which passes control back to the
framework for standard requests using USBDDriver_RequestHandler()

void USBVendorRequest(const USBGenericRequest *pRequest)
...
#if 1
    else if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_VENDOR) {
        USBVendorRequest(pRequest);
    }
#endif
...


In the CCID driver, the following code overrides the main callback:

//------------------------------------------------------------------------------
//         Optional RequestReceived() callback re-implementation
//------------------------------------------------------------------------------
#if !defined(NOAUTOCALLBACK)

//------------------------------------------------------------------------------
/// Re-implemented callback, invoked when a new USB Request is received.
//------------------------------------------------------------------------------
void USBDCallbacks_RequestReceived(const USBGenericRequest *request)
{
    CDCDSerialDriver_RequestHandler(request);
}

#endif


[1] http://libusb.sourceforge.net/api-1.0/group__syncio.html
[2] http://msdn.microsoft.com/en-us/library/windows/hardware/ff539261%28v=vs.85%29.aspx



[Reply][About]
[<<][usb][>>][..]