PORTS Forum

Ports and Interfaces => USB => Topic started by: Frank Neumann on November 26, 2019, 05:23:29 pm

Title: Sent data to all device with the same VID and PID
Post by: Frank Neumann on November 26, 2019, 05:23:29 pm
Hi,

who can help me to send data to all devices with the same VID and PID connected and not only on the last inserted index device?

I use the application from Jan Axelson for VB.net

thank you in advance
Frank
Title: Re: Sent data to all device with the same VID and PID
Post by: Jan Axelson on November 26, 2019, 08:27:07 pm
If the devices are HID class, edit the FindTheHid routine to open a handle to each matching device (don't quit after finding one) and perform the writes on each.
Title: Re: Sent data to all device with the same VID and PID
Post by: Frank Neumann on November 27, 2019, 02:18:44 pm
Hallo Mrs. Axelson,

I have try it but it is very difficult for me. Can you show me how du you mean it with a small example?

Thanks in advanced
Frank Neumann
Title: Re: Sent data to all device with the same VID and PID
Post by: Jan Axelson on November 27, 2019, 09:05:17 pm
One approach would be to create arrays of the needed values, for example mydevicedetected and myDevicePathName and HidHandle.

In FindTheHid, on detecting a matching device, set mydevicedetected(index) = true and save myDevicePathName(index). Get HidHandle(index).

Continue looping until memberIndex = devicePathName.Length

Each time you find another match, increment the index and set mydevicedetected(index) = true and save myDevicePathName(index) and HidHandle(index)..

At the end you will have an array of handles to use for writing data.