From owner-freebsd-usb@FreeBSD.ORG Fri Jun 1 13:46:46 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3539E1065670 for ; Fri, 1 Jun 2012 13:46:46 +0000 (UTC) (envelope-from ee@athyriogames.com) Received: from madonna.sslcatacombnetworking.com (madonna.sslcatacombnetworking.com [174.133.19.130]) by mx1.freebsd.org (Postfix) with ESMTP id 002F18FC15 for ; Fri, 1 Jun 2012 13:46:45 +0000 (UTC) Received: from c-98-206-215-156.hsd1.in.comcast.net ([98.206.215.156] helo=laptopv) by madonna.sslcatacombnetworking.com with esmtpa (Exim 4.69) (envelope-from ) id 1SaS5T-0000JX-SY; Fri, 01 Jun 2012 08:40:20 -0500 From: "Engineering" To: "'Hans Petter Selasky'" , References: <201205280640.q4S6e6L0035127@freefall.freebsd.org> <01e901cd3f4a$c30d4910$4927db30$@com> <201206010910.27817.hselasky@c2i.net> In-Reply-To: <201206010910.27817.hselasky@c2i.net> Date: Fri, 1 Jun 2012 08:45:40 -0500 Message-ID: <026d01cd3ffc$d69ca130$83d5e390$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac0/xNaXzcYh+2udStmYREJiY76ZJQAMvUFQ Content-Language: en-us X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - madonna.sslcatacombnetworking.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - athyriogames.com 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 13:46:46 -0000 [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