I have read many codes and none match each other.. I did little bit of programming but one thing i' confused about is: how many ways you can read a USB (how many classes or libraries i have to call to do such a thing)? when you use .serial port( does that mean you are reading a serial port or even the USB uses the same class or library)? it is my first time trying to read from USB and totally clueless on how to start. if i can figure out the first step I can then proceed...ANy hints will be greatly appreciated,
+1
A:
There is no means to directly "read USB" in .NET. Interacting with the bus itself is done by device drivers.
As to how you'll interact with a particular device, this depends entirely on the device. If you can provide some information about what you're wishing to connect to, I or others may be of more assistance.
Adam Robinson
2010-06-22 01:00:39
You can use WinUSB: http://en.wikipedia.org/wiki/WinUSB
Yann Ramin
2010-06-22 01:08:45
@theatrus: WinUSB is a standard device driver that provides a serial stream (and can be used similar to a serial port). If the device supports it, then you can use WinUSB. This is not reading and writing directly to the USB port.
Adam Robinson
2010-06-22 01:50:46
@Adam: winusb is *not* CDC or serial port emulation. It allows probing USB devices, and reading/writing their end-point streams - the same functionality that a kernel level driver would accomplish. The only limit to WinUSB is the lack of isochronous support (bulk and interrupt only).
Yann Ramin
2010-06-22 02:22:16
@theatrus: I said it provides a serial stream (specifically a named pipe), *not serial port emulation*. Again, a device must support the WinUSB profile in order to use it. It is *not* general purpose USB IO.
Adam Robinson
2010-06-22 02:26:38
Downvoter care to explain why?
Adam Robinson
2010-06-22 02:34:43
@Adam: Then what is general purpose USB IO, since apparently we have a different definition? winusb can be registered as the driver for any device (with the .inf file, excepting class based devices and isochronous endpoints), and allow access to all of the endpoints. It can send control requests. It can read/write from the bulk and interrupt endpoints.
Yann Ramin
2010-06-22 02:41:33
@theatrus: There is no such thing as "general purpose USB IO", which was the entire point of my answer. My point is that the driver--in this case, WinUSB--does the actual communication over the bus, and the driver in turn exposes an API. WinUSB exposes a very general API that is not tailored to a particular device, but the fact remains that you are not "reading USB" or "writing USB", you are directing a particular driver to read and write data from and to the bus. The fact that you're excluding *any* device means that this is not completely general-purpose.
Adam Robinson
2010-06-22 02:52:00
You can also directly interface to WinUSB, which is what newer LibUSB versions use.
Yann Ramin
2010-06-22 01:13:17
A:
USBBurn - Small utility for writing disk images to usb drive. Project created with Microsoft Visual Studio 2008 C# at http://usbburn.codeplex.com/
GPS Framework for .NET has USB support, see http://gps2.codeplex.com/ or http://gps3.codeplex.com/
USBDevice
class of http://msdn.krugle.com/kse/entprojects/1005285_scmi-ps_3#6MSDN Code Search for "usb" at http://msdn.krugle.com/kse/entfiles?query=usb#1
AMissico
2010-06-22 04:15:22