Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2012 11:30:56 -0500
From:      "Engineering" <ee@athyriogames.com>
To:        <freebsd-usb@FreeBSD.org>
Subject:   Recommendations for programming HID in FreeBSD 9
Message-ID:  <01e901cd3f4a$c30d4910$4927db30$@com>
In-Reply-To: <201205280640.q4S6e6L0035127@freefall.freebsd.org>
References:  <201205280640.q4S6e6L0035127@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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
usbhid.cpp: In function 'int hid_set_feature(int, unsigned char*, int)':
usbhid.cpp:157: error: 'usb_ctl_report' was not declared in this scope
usbhid.cpp:157: error: expected `;' before 'ucr'
usbhid.cpp:161: error: 'ucr' was not declared in this scope
usbhid.cpp:169: error: invalid application of 'sizeof' to incomplete type
'usb_ctl_report' 
usbhid.cpp:174: error: 'USB_SET_REPORT' was not declared in this scope
usbhid.cpp: In function 'void usbhid_populate_list()':
usbhid.cpp:331: error: 'USB_GET_REPORT_DESC' was not declared in this scope
usbhid.cpp:331: error: 'struct hid_t' has no member named 'ucrd'
usbhid.cpp:334: error: 'struct hid_t' has no member named 'ucrd'
usbhid.cpp:336: error: 'struct hid_t' has no member named 'ucrd'
usbhid.cpp:337: error: 'struct hid_t' has no member named 'ucrd'
*** Error code 1





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01e901cd3f4a$c30d4910$4927db30$>