USB access
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: USB access

  1. #1
    Join Date
    Oct 2001
    Posts
    4

    USB access

    I am looking for a way to retrieve/enumerate a USB device. I have a handle on the device, and now I want to retrieve all of the configurations, interfaces, and endpoints. The ones result I get from the below code are only some of the config/interface/endpoints.

    //
    // USBHUB uses URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE to process this
    // IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION request.
    //
    // USBD will automatically initialize these fields:
    // bmRequest = 0x80
    // bRequest = 0x06
    //
    // We must inititialize these fields:
    // wValue = Descriptor Type (high) and Descriptor Index (low byte)
    // wIndex = Zero (or Language ID for String Descriptors)
    // wLength = Length of descriptor buffer
    //
    pDescRequest->SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | DescriptorIndex;
    pDescRequest->SetupPacket.wLength = (USHORT)(nBytes - sizeof(USB_DESCRIPTOR_REQUEST));

    // Now issue the get descriptor request.
    //
    bSuccess = DeviceIoControl(hHubDevice, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION,
    pDescRequest, nBytes,
    pDescRequest, nBytes,
    &nBytesReturned, NULL);




    where pDescRequest is a USB_DESCRIPTOR_REQUEST structure. Any ideas of how to get all of them?

    thanks.


  2. #2
    Join Date
    Dec 2001
    Posts
    113

    Re: USB access

    you probably know about this page, but just in case... maybe you can dig thru this and find an answer.

    http://www.lvr.com/usb.htm




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center