Author Topic: Sent data to all device with the same VID and PID  (Read 9926 times)

Frank Neumann

  • Member
  • ***
  • Posts: 17
Sent data to all device with the same VID and PID
« 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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Sent data to all device with the same VID and PID
« Reply #1 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.

Frank Neumann

  • Member
  • ***
  • Posts: 17
Re: Sent data to all device with the same VID and PID
« Reply #2 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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Sent data to all device with the same VID and PID
« Reply #3 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.