Ports
May 23, 2013, 05:32:28 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
USB
>
Access to multiple devices with same VID and PID
Pages: [
1
]
« previous
next »
Print
Author
Topic: Access to multiple devices with same VID and PID (Read 997 times)
vineetrvce
Member
Posts: 2
Access to multiple devices with same VID and PID
«
on:
May 23, 2012, 07:16:48 am »
Hello,
I am able to access my embedded PIC device with the .NET app. But when I connect 2 devices, then there are issues accessing the 2 USB devices.
The problem is that whenever the 2nd device is inserted, i notice an addition in the device path name.
But how to ensure the the handle i get for the second device should be from the 2 device path name and not the first.
The call to get the handle is below:
hidHandle[hid_index] = FileIO.CreateFile(myDevicePathName, FileIO.GENERIC_READ | FileIO.GENERIC_WRITE, FileIO.FILE_SHARE_READ | FileIO.FILE_SHARE_WRITE, IntPtr.Zero, FileIO.OPEN_EXISTING, 0, 0);
Please suggest!
Thanks,
Vineet.
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1629
Re: Access to multiple devices with same VID and PID
«
Reply #1 on:
May 23, 2012, 09:36:07 am »
Open the handle with exclusive access and you won't be able to get a handle the next time around.
Jan
Logged
vineetrvce
Member
Posts: 2
Re: Access to multiple devices with same VID and PID
«
Reply #2 on:
May 24, 2012, 11:51:17 pm »
Thanks Jan, it worked!
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...