From owner-freebsd-bluetooth@FreeBSD.ORG Tue Dec 29 22:29:28 2009 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 0DD011065670 for ; Tue, 29 Dec 2009 22:29:28 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id D69F78FC1F for ; Tue, 29 Dec 2009 22:29:27 +0000 (UTC) Received: by pzk15 with SMTP id 15so7892463pzk.3 for ; Tue, 29 Dec 2009 14:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=7loTfOR7xlG+mFgXpYcU82cNda4C0OOESrY7GeaDszY=; b=L4r1l2YR2ODXDlfVdUVveFKBaXl6NdNezNfekvmOxFHdKgY4A0sLl1gtM6afd6T/CX 24S9UBKnGlphBLYYzcNx0Fp3Z1URf0Cj0fCxiwgMVT/52tL9d4P3RjHfWRRo6zlg+9HU rxRv3F0VDvRyIZ+pDdUh8wLILdsUk0HsE75jE= 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=rpUCClLUPP+GpX8T/7OoBAJX53xzbt7bQq+wYbrOALe1+nenBfahYxLEbyMq01o5T/ jI7on3sX8CiG729nabHJjFXwR9rzimrOxh73rFM5ISzZhDnCdwb4fVw1Gz/mPFA837sL o6/Yqp5hq62GiIWC8E327oX9RETnuruuoBHKE= MIME-Version: 1.0 Received: by 10.115.149.10 with SMTP id b10mr11896154wao.157.1262125754458; Tue, 29 Dec 2009 14:29:14 -0800 (PST) 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> Date: Tue, 29 Dec 2009 14:29:14 -0800 Message-ID: From: Maksim Yevmenkin To: "M. Warner Losh" , Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-bluetooth@freebsd.org Subject: Re: Keyboard - how? 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: Tue, 29 Dec 2009 22:29:28 -0000 On Sun, Dec 27, 2009 at 10:59 AM, Iain Hibbert wrote: > On Sun, 27 Dec 2009, M. Warner Losh wrote: > >> In message: <1261935364.501662.751.nullmailer@galant.ukfsn.org> >> Iain Hibbert 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