Click here to Skip to main content
11,648,785 members (84,974 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 USB .NET4
Hi,

I am currently trying to build an application that would program a device through DFU. I have an application programming interface with all the functions and methods I need, my problem is that the API is in C++, I am trying to translate it to C# but I am having a hard time understanding what I need to do. Currently I am able to identify all the usb devices connected to the pc,this link turned out to be very helpful, now I need to get the Symbolic link to the device according to the API guide I found. I am not sure what they mean by symbolic link.

Another question I have is the handle of the device is the device ID or the PnpID?

I know they are very basic concepts, but I am having a hard time to understand them, if you could point me to a tutorial, or article explaining what I need to know I would gladly appreciate it.

Thanks.
Posted 30-May-12 9:03am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,

a symbolic link is a link to a folder/directory within your file system (NTFS,FAT32,ext2,3, ...).
So in this case the symbolic link to your device could be to i.e. I:\ (the device letter of your USB Mass Storage Device).

To Device ID's and PNP-ID's:
All Plug n' Play (so...PNP) devices must contain a deviceID in order to allow the OS to uniquely recognize the device to load the correct driver for this device, the PNP-ID is a combination of the Vendor-ID and device-ID.

Here is a great libraries,infos and examples you can easily work with:

A USB HID Component for C#[^]

http://sourceforge.net/projects/libusbdotnet/[^]

http://www.developerfusion.com/article/84338/making-usb-c-friendly/[^]

Enumerate and Auto-Detect USB Drives[^]

A USB Library to Detect USB Devices[^]


Unfortunately I don't know what you mean with "that would program a device through DFU."
There are several ways to communicate with RAS/DFU, depends how much code you want to write by yourself.

Using RASAPI32.dll by P/Invoke:
http://www.pinvoke.net/default.aspx/rasapi32.rasdial[^]

Easy-To-Use Library:
http://dotras.codeplex.com/[^]

Much Information, more specified questions are always welcome after your research process Wink | ;)

Regards

PS: You don't necessarily need to use a C++ API to achieve this.
  Permalink  
v6
Comments
losmac at 30-May-12 16:14pm
   
Good answer, my 5!
Björn Ranft at 30-May-12 16:17pm
   
Thanks losmac! Regards ;)
nanomass at 30-May-12 16:55pm
   
Thanks for your post Ranft. this info is very helpful!
Björn Ranft at 31-May-12 7:15am
   
Glad it helped you. Good Luck ;)
Sandeep Mewara at 31-May-12 0:43am
   
5!
Björn Ranft at 31-May-12 6:28am
   
Thank you Sandeep. Regards
VJ Reddy at 31-May-12 19:55pm
   
Good answer. 5!
Björn Ranft at 1-Jun-12 18:06pm
   
Thank you ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 F-ES Sitecore 419
1 CPallini 410
2 Kornfeld Eliyahu Peter 330
3 OriginalGriff 324
4 Sergey Alexandrovich Kryukov 254
0 OriginalGriff 1,512
1 Sergey Alexandrovich Kryukov 1,022
2 jyo.net 994
3 DamithSL 986
4 CPallini 945


Advertise | Privacy | Mobile
Web04 | 2.8.150804.4 | Last Updated 30 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100