From owner-freebsd-usb@FreeBSD.ORG Fri Jun 1 07:16:18 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DBC7106564A for ; Fri, 1 Jun 2012 07:16:18 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id 868FC8FC1C for ; Fri, 1 Jun 2012 07:16:17 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 280861655; Fri, 01 Jun 2012 09:11:09 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Fri, 1 Jun 2012 09:10:27 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <201205280640.q4S6e6L0035127@freefall.freebsd.org> <01e901cd3f4a$c30d4910$4927db30$@com> In-Reply-To: <01e901cd3f4a$c30d4910$4927db30$@com> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206010910.27817.hselasky@c2i.net> Cc: Subject: Re: Recommendations for programming HID in FreeBSD 9 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 07:16:18 -0000 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 > 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 > See: man usbhid Else use LibUSB to access the device. --HPS