I would like to enquire how can I retrieve the handles for the USB
Control Pipes for my USB Bluetooth dongle.
I need the control pipe handles to send specific command data via the
Control Pipes according to Bluetooth specs.
The Bluetooth specification has listed the USB endpoints as follows:-
Interface No. Endpoint Endpoint Type
0 0x00 Control
0 0x81 Interrupt (IN)
0 0x82 Bulk (IN)
0 0x02 Bulk (OUT)
However, when I parse the information using the command
USBD_ParseConfigurationDescriptor (....) followed by
USBD_CreateConfigurationRequest (..) to setup the URB
which was then sent down by performing
IoBuildDeviceIoControlRequest with IOCTL_INTERNAL_USB_SUBMIT_URB
flag.
I was able to retrieve the Interrupt and 2 Bulk pipe handles with the
exception of the Control Endpoint Type. I was also able to
retrieve the CONFIGURATION_DESCRIPTOR and
DEVICE_DESCRIPTOR values with no problem at all.
(by building the Descriptor request once for DEVICE and
twice for CONFIG - for selection of the configuration and interface)
Is there something wrong with the way I parse the info?
Thanks
Edward
"Edward Tan" <edward!inv...@yahoo.com> wrote in message
news:h5995v0o7dc1nl79q...@4ax.com...
If so, how do I send commands to the control endpoints?
I need to send a sequence of commands (4-8 bytes long)
to the USB device via the control pipe and retrieve the response
via the interrupt endpoint.
In other words, how do I send a stream of data like
{0x01, 0x05, 0x10, .....} to the control pipes?
I've always thought to transmit/receive data on a control pipe,
I need to use the URB_FUNCTION_CONTROL_TRANSFER
control code and supplement it with a given PipeHandle before
submitting the URB down.
I have a second question:-
It is mentioned that I need to fill the SetupPacket with an 8 bytes
array. So if I want to send {0x01, 0x05, 0x10, .....}, do I fill in
SetupPacket with this data or do I fill it in with the TransferBuffer
parameter instead?
URB urbControl;
NTSTATUS status;
USHORT UrbSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST);
PDEVICE_EXTENSION dx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
urbControl.UrbControlTransfer.Hdr.Length =
sizeof (struct _URB_CONTROL_TRANSFER);
urbControl.UrbControlTransfer.Hdr.Function =
URB_FUNCTION_CONTROL_TRANSFER;
urbControl.UrbControlTransfer.PipeHandle = ????
urbControl.UrbControlTransfer.TransferFlags =
USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK;
urbControl.UrbControlTransfer.TransferBufferLength = DataLength;
urbControl.UrbControlTransfer.TransferBuffer = OutputData;
urbControl.UrbControlTransfer.UrbLink = NULL;
status = SendUrb ( &urbControl, ....);
Thanks
-Edward
No. The control pipe on endpoint 0 is always present, and as such is not
mentioned in the descriptors. To send commands to the default endpoint 0
control pipe, you do not need a handle. Use UsbBuildVendorRequest to build
the URB.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.