[libhid-discuss] libhid + swig -> c#

Rudolf Muehlbauer rudolf.muehlbauer at gmail.com
Sun Apr 10 12:33:17 UTC 2011


Thanks for the wonderful replies, 

I was already aware of the LibUsbDotNet und HIDAPI. My guess was that
libhid would not be worth the effort - since with such a library my
deployment would get more difficult. When I only use the LibUsbDotNet
and write my HID-related code myself, I would not need an additional
Library, libusb is available in most distributions I think.

I will try to write the HID code in C# with LibUsbDotNet like in this
example: http://www.lvr.com/code/generic_hid.c$

Anyhow, thank you for your valuable input.

On Sun, 2011-04-10 at 07:54 +0800, Xiaofan Chen wrote: 
> On Sun, Apr 10, 2011 at 6:56 AM, Charles Lepple <clepple at ghz.cc> wrote:
> > On Apr 8, 2011, at 1:25 PM, Rudolf Muehlbauer wrote:
> >> I am wondering what the current status of libhid is. Is it still
> >> maintained, used? The last svn commit was back in 2008.
> >
> > I have been recommending that people consider HIDAPI instead. It seems to be
> > much better at the cross-platform goal than libhid, since libusb isn't
> > always the best solution. (On the other hand, I haven't tried HIDAPI myself.
> > Maybe someone else on the list has.)
> 
> I tried HIDAPI a bit and it is quite good. On the other hand, it does
> not have enough bindings and the packaging of it is not that great.
> It has great potentials though.
> http://www.signal11.us/oss/hidapi/
> 
> >> I am interested to use it in a project written with Mono/C#. Is it much
> >> of a hassle to generate the C# bindings?
> >
> > It would certainly be a to me, since I don't know C#. If you have used SWIG
> > before, I imagine it would not be that difficult. I suspect the biggest
> > hurdle would be wrapping libusb for use in C#.
> 
> Travis Robinson (current developers of libusb-win32) is also the developer
> of libusbdotnet, a great C# bindings for libusb. It works under Linux
> and Mac OS X with Mono, but only with libusb-1.0. For Windows, it
> works with libusb-1.0, WinUSB and libusb-win32.
> http://libusbdotnet.sourceforge.net/V2/Index.html
> 
> > Actually, if you don't need the hidparser library (i.e. you know the report
> > structures), there is not much to libhid. Look at the source for the
> > functions which you would use - they are mostly error-checking.
> >
> 
> 

-- 
Rudolf Muehlbauer <rudolf.muehlbauer at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20110410/b38d6cbf/attachment.pgp>


More information about the libhid-discuss mailing list