From owner-freebsd-bluetooth@freebsd.org Mon Sep 14 19:37:44 2015 Return-Path: Delivered-To: freebsd-bluetooth@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C943DA03F7F for ; Mon, 14 Sep 2015 19:37:44 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.115.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 369C41935 for ; Mon, 14 Sep 2015 19:37:43 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: (qmail 88202 invoked from network); 14 Sep 2015 19:37:41 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with ESMTPS (DHE-RSA-AES128-SHA encrypted); 14 Sep 2015 19:37:41 -0000 Subject: Re: Apple Magic Mouse To: Maksim Yevmenkin References: <1437909200.57929.3.camel@yandex.com> <55F4362A.4050203@erdgeist.org> <55F60ED8.8080203@erdgeist.org> Cc: "freebsd-bluetooth@freebsd.org" From: Dirk Engling X-Enigmail-Draft-Status: N1110 Message-ID: <55F72204.5060007@erdgeist.org> Date: Mon, 14 Sep 2015 21:37:40 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2015 19:37:44 -0000 On 14.09.15 19:07, Maksim Yevmenkin wrote: > this looks good. i only have one comment: why does it have to be in > bthidd ? we already query hid descriptor from the device (in > bthidcontrol) as part of initial device setup. why can't we query > device id at the same too? and simply stick it into the bthidd.conf > and be done with it? the nice thing about it is that if device > specific code does not work (for whatever reason), one can simply turn > it off by removing device id lines from the bthidd.conf. > > does it make sense to you? Oh, I saw it the other way around: I never understood the stony road to achieving something as simple as connecting a bluetooth mouse, in the first place and I did not want to further complicate things. It took _me_ a while to understand all the steps and quirks necessary to get a bluetooth device running and adding fields to a file that needs to be dumped and re-parsed later was something I could not imagine to be good practice. Maybe I just missed the crucial glue script that helps an average user to properly configure all the required daemons and start all the necessary tools, but neither is the handbook particularly useful [1] (seriously, an introduction into the basics of bluetooth when all you should need is inquiry, select a device and provide a PIN!?) nor does "man bluetooth" guide the novice user. In the end I needed to resort to [2] and manually copy&paste instructions. I just noticed, this is a little off-topic, but I think that you get the point that something is odd, if I am able to dwell into the depths of a hid driver but fail to get all the basic info. And before you ask: Yes, I volunteer to write an interactive/scriptable bluetooth framework configure script, if it is not yet there. ;) Back to the topic at hand: I do not know what kind of init magic other devices might require, but maybe bthidcontrol can offer to dump certain control commands that bthidd would execute when it attaches to the device. Iain suggested to also fake the hid descriptor, this way we would not even need to store vendor/product. However, I am not sure about the unofficial report ids apple uses for magic mouse and magic trackpad, and would not blindly handle them the way they are handled by the magic mouse driver. Still now I need to touch parser and generator and its documentation. Well, then. What do you think? erdgeist [1] https://www.freebsd.org/doc/handbook/network-bluetooth.html [2] http://astralblue.livejournal.com/357664.html