Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2012 08:45:40 -0500
From:      "Engineering" <ee@athyriogames.com>
To:        "'Hans Petter Selasky'" <hselasky@c2i.net>, <freebsd-usb@freebsd.org>
Subject:   RE: Recommendations for programming HID in FreeBSD 9
Message-ID:  <026d01cd3ffc$d69ca130$83d5e390$@com>
In-Reply-To: <201206010910.27817.hselasky@c2i.net>
References:  <201205280640.q4S6e6L0035127@freefall.freebsd.org> <01e901cd3f4a$c30d4910$4927db30$@com> <201206010910.27817.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[original post moved to end for brevity - or should I just delete it when
replying?]


From: Hans Petter Selasky [mailto:hselasky@c2i.net] 
>See:
>man usbhid
>
>Else use LibUSB to access the device.
>
>--HPS

Thank you for replying

I should point out that the usbhid.cpp compile below is my file - I didn't
know there was a 'real' usbhid.

Usbhid looks great, but it is probably a little higher level than I need. I
should mention that the devices I am talking with are a known quantity - I
wrote the firmware on some of them, and have extensive datasheets on the
rest. I just need to get a usage page, or VID and PID so I can tell which
one is which, i.e. who's at uhid0 and who's at uhid3.

I had been researching libusb for a while, but their webpage says it is not
recommended for HID devices and to use HIDAPI, which does not seem to be on
BSD. I saw your version, and it looks great! I wish I had that a few years
ago when you helped me with getting an isochronous device working on BSD
7.0. However, due to time constraints, I'd rather not write a HID front end
using that if I don't need to.

I see uhid is still around - is there any reason not to just use that?

I already have cross-platform HID code that used to work with uhid - I
suspect my problem might just be that the headers I need have moved or
changed. I will grep...

According to the uhid man page, these should all still exist somewhere:
> usbhid.cpp:35: error: 'usb_ctl_report_desc' does not name a type
> usbhid.cpp:157: error: 'usb_ctl_report' was not declared in this scope
> usbhid.cpp:174: error: 'USB_SET_REPORT' was not declared in this scope
> usbhid.cpp:331: error: 'USB_GET_REPORT_DESC' was not declared in this 

Or is uhid being obsoleted?

Thanks
Sam



On Thursday 31 May 2012 18:30:56 Engineering wrote:
> Hi all, I hope this is the right place to ask this
> 
> I am in process of migrating an embedded system from BSD 7.0 to 9.0, 
> as we need upgraded video card drivers which will not compile on the old
system.
> To confuse matters a bit, I believe it was 7.0 with some of HPS 
> updated USB stack worked in.
> 
> The system has 4 HID devices attached, and I need to read data and set 
> feature reports to talk to them.
> 
> I had been using read() and ioctl() - with the evolution of BSD, is 
> there a different recommended way to do this?
> 
> I also need open() and to be able to get the usage page, to tell one 
> device from another.
> 
> If I recall, at the time the uhid driver had problems with devices 
> that had feature reports of varying sizes - I see I hacked it a bit to 
> allow the application to specify the size of the report. Is this still the
case?
> 
> I of course will be looking into this myself, but initial compile 
> gives me the following errors - does this ring a bell to anyone?
> 
> Thanks,
> Sam
> 
> Compiling usbhid.cpp...
> usbhid.cpp:35: error: 'usb_ctl_report_desc' does not name a type






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?026d01cd3ffc$d69ca130$83d5e390$>