Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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

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 ;)

Regards

PS: You don't necessarily need to use a C++ API to achieve this.
 
Share this answer
 
v6
Comments
Maciej Los 30-May-12 16:14pm    
Good answer, my 5!
El_Codero 30-May-12 16:17pm    
Thanks losmac! Regards ;)
nanomass 30-May-12 16:55pm    
Thanks for your post Ranft. this info is very helpful!
El_Codero 31-May-12 7:15am    
Glad it helped you. Good Luck ;)
Sandeep Mewara 31-May-12 0:43am    
5!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900