From owner-freebsd-bluetooth@FreeBSD.ORG Fri Jan 21 23:41:37 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 423B010656A4 for ; Fri, 21 Jan 2011 23:41:37 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 068D18FC08 for ; Fri, 21 Jan 2011 23:41:36 +0000 (UTC) Received: by iwn39 with SMTP id 39so2246883iwn.13 for ; Fri, 21 Jan 2011 15:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=JF9SGBpodUMZBi+DyZnhvwLAYFSS9/T5U1PBGuEL9UQ=; b=rULQgwtjAx7bI2Pq6Ba7r+ttmwg/Rzx5uNyu6s9BFU3YIDulLTP4xZ1K9VBgCcgaR/ 8ypVDeZxQXoNOpUPHQXG1WLSQfoLBX3jmL6xHbIHTuWVSDmC9YIhstne/XEvCRyP15B1 SkigBi15B26NxaUhOae56m8q9xXCRXtgxF5Ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Gz1f6guCYGY2xKEgybSA5QV5iY/zeQZ6g60EH01VB7Lj3Fx9zrybvDA0cxxbYdi2iL EfD5OaMBAvinLNRl4vf0fIE8JrpVA23yZD6BbrFsLM6h2bYsuuNA4/5icNWc41eSOpVr 2SLvTM9u0Jqy6JmU6wM7eAYyiahkoBo+PRMjU= MIME-Version: 1.0 Received: by 10.231.35.201 with SMTP id q9mr1516635ibd.185.1295653296499; Fri, 21 Jan 2011 15:41:36 -0800 (PST) Received: by 10.231.208.19 with HTTP; Fri, 21 Jan 2011 15:41:36 -0800 (PST) In-Reply-To: References: <4D3889D2.80508@gmail.com> <201101202043.p0KKhDIB076736@lurza.secnetix.de> <4D393F19.9020005@gmail.com> <4D398BEC.9020503@gmail.com> Date: Fri, 21 Jan 2011 15:41:36 -0800 Message-ID: From: Maksim Yevmenkin To: David Demelier , freebsd-bluetooth@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: Bluetooth mouse does not connect after reboot X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 23:41:37 -0000 On Fri, Jan 21, 2011 at 11:44 AM, Iain Hibbert wrote: > On Fri, 21 Jan 2011, David Demelier wrote: > > the HID descriptor you posted decodes as > > Collection page=Generic_Desktop usage=Mouse > Collection page=Generic_Desktop usage=Pointer > Input id=2 size=1 count=1 page=Button usage=Button_1 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_2 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_3 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_4 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_5 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_6 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_7 Variable, logical range 0..1 > Input id=2 size=1 count=1 page=Button usage=Button_8 Variable, logical range 0..1 > Input id=2 size=12 count=1 page=Generic_Desktop usage=X Variable Relative, logical range -2047..2047 > Input id=2 size=12 count=1 page=Generic_Desktop usage=Y Variable Relative, logical range -2047..2047 > Input id=2 size=8 count=1 page=Generic_Desktop usage=Wheel Variable Relative, logical range -127..127 > Input id=2 size=8 count=1 page=Consumer usage=AC_Pan Variable Relative, logical range -127..127 > End collection > End collection > Input id=16 size=8 count=6 page=Microsoft usage=0x0001, logical range 0..255 > Output id=16 size=8 count=6 page=Microsoft usage=0x0001, logical range 0..255 > Collection page=Microsoft usage=0x0001 > > so for report # 2 we expect a six byte report at the end of the packet > (the rest is ACL (5), L2CAP (4) and HID (2) headers..) > >> for wheel up: >> > 02 0C 20 0C 00 08 00 43 00 A1 02 00 00 00 00 01 00 >> >> for wheel down: >> > 02 0C 20 0C 00 08 00 43 00 A1 02 00 00 00 00 FF 00 > > those are GenericDesktop/Wheel +1 (01) and -1 (FF) values, probably you > can make them larger by spinning the wheel faster > >> for wheel logical button to left: >> > 02 0C 20 0C 00 08 00 43 00 A1 02 00 00 00 00 00 FF >> > 02 0C 20 0C 00 08 00 43 00 A1 02 00 00 00 00 00 00 >> >> and for wheel logical button to right: >> > 02 0C 20 0C 00 08 00 43 00 A1 02 00 00 00 00 00 01 >> > 02 0C 20 0C 00 08 00 43 00 A1 02 00 00 00 00 00 00 > > and Consumer/AC_PAN -1 (ff) and +1 (01) and since it comes from a button > you probably can't increase the speed - might accelerate, if you held it > down? They sent a 00 on release though I don't think that is required > (don't think my apple magic mouse ever did that with PAN) thank you Iain :) so, yes, those events decode as Consumer/AC_PAN (aka "w" direction). as i mentioned before, mouse_info structure (or more specifically mouse_data structure) does not contain place to report "w" direction. the good news is that mouse_data is a part of a union inside mouse_info structure. theoretically, it should be possible to add place for "w" direction in mouse_data, or, even create completely new mouse_data2. of course there is still a work to do with ioctl. another option is decode those as button clicks, i.e. less than zero - button X, more than zero - button X+1. not sure if this is a good idea though. thanks, max