How to open two USB pipes (0x81 - 0x02) in USB - HID devic

Oct 30, 2006 5 Replies

Hi,



I have a vendor HID device with two additional endpoints, 0x81 (input) and the optional endpoint 0x02. With only one endpoint (0x81) everything is ok. I can get a handle with CreateFile and I can send messages with HidD_SetOutputReport and with WriteFile.



Now I have introduced a second endpoint (0x02 - output). I can still discover the device and I can get a device handle. I even can send messages over the control pipe with HidD_SetOutputReport. However if I try to write via WriteFile then I get an error 1784. I guess that I have to use another handle which is pointing to the pipe with endpoint 0x02. But how???



Thanks in advance!



Grad


It's been a while, but from what I understand, the only optional endpoint that a HID device may have is an interrupt output endpoint, which is used for sending output reports to the device instead of the control pipe.

In the HID API, you don't explicitly send data via an endpoint - you send output reports and it's up to the HID class driver to decide whether to use the control endpoint or optional interrupt endpoint. If it has decided not to use the interrupt endpoint, then AFAIK there's nothing you can do about it.

If you want to delve lower you're going to have to bypass HID altogether

- but then you need to make sure your driver grabs the device before HID finds it...

Regards,

Mark McDougall, Engineer Virtual Logic Pty Ltd, 21-25 King St, Rockdale, 2216 Ph: +612-9599-3255 Fax: +612-9599-3266

Could you indicate what OS you are using? Your question would seem to have everything to do with what OS and very little with HID. But as a hint, how do you think the LEDs on your keyboard are turned on and off?

Regards, Steve

Hi Steve,

MS Windows (XP) is the OS in question. Well, I think that the LEDs could be controlled either by a report message through the control Pipe or by a message through an interrupt pipe. Control sounds logical. The reason for the interrupt out endpoint is to transfer a chunk of data of eg 64 bytes. If I understand it correctly then is the control pipe (pipe 0) limited to 8 bytes.

Regards Grad.

Update:

It seems that the user buffer is not valid. I have at byte 0 the right REPORT_ID and I have the right length.

The problem is found. 'Advanced USB monitor' from Aggsoft is s*it. After uninstalling this tool everything starts working.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required