Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2009 14:29:14 -0800
From:      Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
To:        "M. Warner Losh" <imp@bsdimp.com>, Iain Hibbert <plunky@rya-online.net>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: Keyboard - how?
Message-ID:  <bb4a86c70912291429j26da18aflc04d255b74da0954@mail.gmail.com>
In-Reply-To: <1261940371.044739.879.nullmailer@galant.ukfsn.org>
References:  <20091227.004954.119882392218644339.imp@bsdimp.com> <20091227.005757.195066307562707339.imp@bsdimp.com> <1261935364.501662.751.nullmailer@galant.ukfsn.org> <20091227.111711.287595822663154592.imp@bsdimp.com> <1261940371.044739.879.nullmailer@galant.ukfsn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 27, 2009 at 10:59 AM, Iain Hibbert <plunky@rya-online.net> wrote:
> On Sun, 27 Dec 2009, M. Warner Losh wrote:
>
>> In message: <1261935364.501662.751.nullmailer@galant.ukfsn.org>
>>             Iain Hibbert <plunky@rya-online.net> writes:
>> : - IMO the PIN should be ephemeral and use-once so when you are paired you
>> :   should remove it from the config file or at least comment it out
>>
>> The whole pairing thing is kind of ugly atm in FreeBSD.  I used big
>> hammers, I think, to make it work.  In other OSes, I just see what is
>> discoverable, click a couple of times, maybe enter a PIN and I then
>> promptly forget about it until I have to 'unpair'.
>
> I have had complaints about it in NetBSD too and while I think I improved
> on Max's start it still needs further work and should be graphical. I'm
> not sure about the whole dbus thing that BlueZ is moving to now though it
> does work well as you say with the GNOME application. I thought about
> working something lightweight up with (eg) tcl/tk but haven't got around
> to it yet..

yep, the whole thing is "ugly" because pairing basically requires some
form of (graphical) user interface. its an interactive process. i have
a patch somewhere that teaches hcsecd(8) how to execute external
program and pass requester and pin info back and forth. with this, one
can use something like xdialog and get prompted when pairing is
happening.

apple keyboard is not giving you any indication that  it wants
pairing. basically, user supposed to follow instructions on screen --
and it makes perfect sense. we don't have the luxury of uniform
graphical user interface, so, you had to use "big hammers". i guess,
it would be possible to write text based guided 'pair bluetooth
device' tool, that would work together with hcsecd(8) and basically
instruct it to do the pairing and then, on successful completion,
update config/keys file.

>> : > Now, I guess the next step would be to find the bt mouse I have and
>> : > try to get it going as well...
>> :
>> : that is probably fixed pin 0000 if not in the documentation
>>
>> Yes, it is :)  The default is to no pin, so it wasn't authenticating.
>
> Some devices that I noticed will only enforce the auth on making or
> accepting the connection. Even the Linux stack used to do this (on the
> accept path only) but I think they fixed it now.

i know for a fact that both apple mouse (older version) and apple
keyboard (older version) work just fine with freebsd. be warned that
bthidd(8) is not really tracking mouse buttons' state and relies on os
to do so. bthidd(8) simply translates hid events into
ioctl(CONS_MOUSECTL), i.e. things like double-click, etc. will not
work in console, but will work in X.

[...]

>> btw, is there some way I can easily list the paired devices?
>
> 'easily' not really, but /var/db/hcsecd.keys should contain keys for all
> paired devices. Actually, there can be more keys stored in the device
> itself (if you paired with another OS that might happen or you can do it
> manually). I think you can check/change/remove those with hccontrol but
> must edit the hcsecd.keys file manually.

yes, edit /var/db/hcsecd.keys and hup/restart hcsecd(8)

thanks,
max



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70912291429j26da18aflc04d255b74da0954>