Recent Posts

Pages: 1 ... 8 9 [10]
91
USB / Which book to buy
« Last post by Larksman on January 23, 2022, 07:08:22 am »
Hi Jan,  I have built a hardware project on a Rasberry Pi using C to control the devices.  I want to be able to access the low data rate output in a c++ program on a Windows pc via usb.  Which of your books is going to give me the most help with this?  Michael
92
USB / Re: USB HID Driver connecting to which interface number
« Last post by Renate on January 20, 2022, 12:30:21 pm »
But you could use a WinUsb driver (like everybody seems to do for everything these days).
93
USB / Re: Windows gives GetLastError() of 0x490, Android does fine
« Last post by Jan Axelson on January 20, 2022, 10:08:04 am »
Thanks for reporting what you found!
94
USB / Re: USB HID Driver connecting to which interface number
« Last post by Jan Axelson on January 20, 2022, 10:06:36 am »
I wouldn't assume that host drivers would do something that isn't specified as required.

If it's not HID class, it will need a different host driver.
95
USB / Re: USB HID Driver connecting to which interface number
« Last post by MB_Inv on January 20, 2022, 02:27:42 am »
Would I then be still able to use the hidapi driver on the host side for the "private" interface or would I need to write an own driver?

Kind regards,

Markus
96
USB / Re: USB HID Driver connecting to which interface number
« Last post by Renate on January 19, 2022, 06:09:09 am »
You could make "your" interface use a private class (0xff) and not HID.
97
USB / Re: USB HID Driver connecting to which interface number
« Last post by MB_Inv on January 19, 2022, 04:43:27 am »
Hi Renate,

thanks for your thoughts!

We are indeed using the same approach as you in our own SW (get the path of the desired interface nr and then connect using the path).
However, we don't know what our customers are using.

Until now, our device had only 1x CustomHID interface. Customers might have connected to it using a function which doesn't take the interface nr as argument, because there is only one.
However, now we changed to a composite device and added another interface and want to provide a SW to the customer dealing with this second interface. So, we're trying to find a way to prevent the customer from using the same interface on accident (which would screw up the communication on this interface).

So I asked myself if we could safely assume that normally different USB HID host drivers select the same interface when the interface nr is not specified...

Kind regards,

Markus
98
USB / Re: USB HID Driver connecting to which interface number
« Last post by Renate on January 18, 2022, 05:55:36 am »
I would guess (without any evidence) that they would use the lowest interface number.

It seems to me that if the first function doesn't allow you to specify interface number then you should either:
  • Use the second function that takes a path and write your own helper that generates a path from VID/PID/Interface#
  • Only use one HID interface and multiple HID reports. This makes sense unless the two interfaces are separately used by two applications.
When I do my own stuff finding/connecting to a USB HID I filter on VID/PID/Interface#.

Unrelated trivia: The AMD Aura USB HID (silly LED lighting) has non consecutive interface numbers which is illegal and breaks some USB libs.
99
USB / USB HID Driver connecting to which interface number
« Last post by MB_Inv on January 17, 2022, 07:10:44 am »
Hi,

we're using our product as a USB composite device with 2x CustomHID interfaces.

On the host side, we're using the following USB HID Driver:
https://github.com/libusb/hidapi

For connecting to one of the interfaces, this driver offers to functions:
- one which takes VID, PID and (optional) serial number
- one which takes only the path

When using the first, automatically the interface with the highest interface nr found is used.

Now, my question is as follows:
According to your experience, do host USB HID drivers usually use the highest interface nr found (in our case, interface 1 instead of interface 0) or does that differ?
Or, differently put, when our customers use some USB HID driver and uses some function taking only VID and PID to connect, can we safely assume that all will connect to interface 1?

Kind regards,

Markus
100
USB / Check to which interface of a composite device there's an open connection
« Last post by MB_Inv on January 17, 2022, 05:46:31 am »
Hi,

we're using our product as a USB composite device with 2x Custom HID interfaces.

Is there generally any way to determine from host OS (Win, Linux) or device FW (running on STM32 using CubeMX libraries) to find out for which interface there is already an open connection from the host?
Our use case is that on the host there are two programs running (one from our customers, the other one from us). We would like to prevent both programs using the same interface as this would screw up the communication.

So far I haven't found too much about it, so I guess it is not really possible, but maybe someone of you knows something here?

Kind regards,

Markus
Pages: 1 ... 8 9 [10]