From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 18 10:55:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 168E816A416 for ; Mon, 18 Sep 2006 10:55:07 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B90A43D76 for ; Mon, 18 Sep 2006 10:54:58 +0000 (GMT) (envelope-from r.c.ladan@gmail.com) Received: by wx-out-0506.google.com with SMTP id i27so3911164wxd for ; Mon, 18 Sep 2006 03:54:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CPowbSn1E2umsjfJMLbNIztjovN3V8AGgNvh7DimkN9bjlCa6C8/AfkYU4rqr3icwP2KCpi84ifdT68c06mR2debmGc5jFfQDQMzZq1lhDxh4g6PrtpIGeABqlC7FmxxCBSpBNApdewkJu3W1DxPY9sv+n+6HXDvW0EcbB/5bk8= Received: by 10.70.29.7 with SMTP id c7mr19948143wxc; Mon, 18 Sep 2006 03:54:58 -0700 (PDT) Received: by 10.70.124.6 with HTTP; Mon, 18 Sep 2006 03:54:57 -0700 (PDT) Message-ID: Date: Mon, 18 Sep 2006 12:54:57 +0200 From: "Rene Ladan" To: "Ed Schouten" In-Reply-To: <20060918095813.GM22564@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <450DA217.9080602@gmail.com> <20060918095813.GM22564@hoeg.nl> Cc: FreeBSD Hackers , freebsd-usb@freebsd.org Subject: Re: anyone working on setting output items with usbhidctl(1) ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2006 10:55:08 -0000 2006/9/18, Ed Schouten : > Hello Rene, > > * Rene Ladan wrote: > > is anyone working on setting output items with usbhidctl(1) ? > > > > I'm trying to add LED/rumbler support for the Xbox 360 Gamepad to > > uhid(4), but there doesn't seem to be a userland tool to test output > > items and the output report descriptor doesn't seem to be publicly > > available (i.e. I must reverse-engineer it). > > > > This device has 4 LEDs which can be controlled with the command 01 03 > > xx, where xx ranges from 0 to 255. > > It also has two rumble motors which can be controlled with 00 08 00 bb > > ll 00 00 00, where bb and ll both range from 0 to 255. > > Try the following C code: > > | #include > | #include > | > | int > | main(int argc, char *argv[]) > | { > | char buffer[3] = { 1, 3, 0 }; > | int fd; > | > | fd = open("/dev/ugen0.2", O_WRONLY); > | if (fd < 0) { > | fprintf(stderr, "Cannot open device\n"); > | return (-1); > | } > | > | write(fd, buffer, sizeof buffer); > | close(fd); > | > | return (0); > | } > > I'm currently toying around with the headset, so I've disabled the > uhid(4) driver, so the LED on the gamepad keeps blinking. Running the > application above turns off the LED. I guess it should also work when > you write it to /dev/uhidX. > I tried that too, it does not work on /dev/uhidX (my code opened the device read/write instead of write-only). I'll try to extend the HID descriptor to support the LED and rumblers. > -- > Ed Schouten > WWW: http://g-rave.nl/ > > > Regards, Rene -- GPG fingerprint = E738 5471 D185 7013 0EE0 4FC8 3C1D 6F83 12E1 84F6 (subkeys.pgp.net) "It won't fit on the line." -- me, 2001