tags:

views:

306

answers:

1

Hi All,

I have a requirement where I need to detect USB port and read data from Devices. I can see lot of source code for detecting USB ports but is it possible to read data from devices connected through USB port using C#Mono. I need this component to run on Mac and Windows.

Thanks,

Mohan

+3  A: 

This is possible. There is a project called SharpUSBLib that you should check out. This a wrapper library written in C# to the USBLib for Unix & Linux which is written in C. There is also a port of USBLib to Win32.

One of the things that you may need to be aware of is that you may not need the SharpUSBLib depending on what type of USB device you are trying to talk to. For instance, most USB HIDs (Human Interface Device) like Keyboards and Mice are full Plug'n'Play capable and require no drivers or interface libs. I have a small USB Unitech barcode scanner which when plugged into the USB port works like a keyboard and the system (both Linux and Win32) see it as a HID.

Jonas Gorauskas