WinUsb_WritePipe Failure

Dear Team,

I have a USB Bluetooth Dongle and I managed to load winusb.sys driver for this device so that I can use the WinUSB client APIs.

Initialization and configuration of the device is completed and I am getting valid interface descriptors, pipe ids, end point types.

As a next step I want to send data to the device. Since it is Bluetooth device, I framed INQUIRY DATA command of 10 bytes and writing to device using WinUsb_WritePipe provided by WinUSB.

This call always returns 87 which is incorrect parameter. The calling parameters are:

WinUsb_WritePipe (winusb_handle,
bulkinpipeid,
inquirydatabuffer,
inquirydatabufferlength,
actuallengthwritten,
NULL):

Here while debugging I am getting valid winusb handle and pipeids.

Any one who successfully transfered data to and from the devices using WinUSB kindly provide a pointer and verify the parameters in the function call.

Regards.

Regrets. I need to write to bulkoutpipeid.

The command is getting transfered to the device.

xxxxx@gmail.com wrote:

I have a USB Bluetooth Dongle and I managed to load winusb.sys driver for this device so that I can use the WinUSB client APIs.

Initialization and configuration of the device is completed and I am getting valid interface descriptors, pipe ids, end point types.

As a next step I want to send data to the device. Since it is Bluetooth device, I framed INQUIRY DATA command of 10 bytes and writing to device using WinUsb_WritePipe provided by WinUSB.

This call always returns 87 which is incorrect parameter. The calling parameters are:

WinUsb_WritePipe (winusb_handle,
bulkinpipeid,
inquirydatabuffer,
inquirydatabufferlength,
actuallengthwritten,
NULL):

Well, just looking at the variable names shows me a potential problem.
You are writing to a pipe called “bulkinpipeid”. IN pipes can only be
read, not written. The IN/OUT distinction is made from the point of
view of the host.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Just so you don’t spend a ton of time trying to implement a full bth stack in user mode, there is no isoch support in winusb which means that you cannot support SCO from your application (if your radio uses the std usb hci at least). Also, I am curious how you would support profiles like DUN which require a modem (and hence a KM stack).

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Friday, January 04, 2008 10:02 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WinUsb_WritePipe Failure

xxxxx@gmail.com wrote:

I have a USB Bluetooth Dongle and I managed to load winusb.sys driver for this device so that I can use the WinUSB client APIs.

Initialization and configuration of the device is completed and I am getting valid interface descriptors, pipe ids, end point types.

As a next step I want to send data to the device. Since it is Bluetooth device, I framed INQUIRY DATA command of 10 bytes and writing to device using WinUsb_WritePipe provided by WinUSB.

This call always returns 87 which is incorrect parameter. The calling parameters are:

WinUsb_WritePipe (winusb_handle,
bulkinpipeid,
inquirydatabuffer,
inquirydatabufferlength,
actuallengthwritten,
NULL):

Well, just looking at the variable names shows me a potential problem.
You are writing to a pipe called “bulkinpipeid”. IN pipes can only be
read, not written. The IN/OUT distinction is made from the point of
view of the host.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer