From owner-freebsd-bluetooth@FreeBSD.ORG Fri Dec 19 17:49:08 2008 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 EBA17106567B for ; Fri, 19 Dec 2008 17:49:08 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtp02.one2one.net (smtp02.one2one.net [149.254.192.174]) by mx1.freebsd.org (Postfix) with ESMTP id 8D46B8FC13 for ; Fri, 19 Dec 2008 17:49:08 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from [127.0.0.1] (helo=localhost) by localhost.localdomain with esmtp (Exim 4.50) id 1LDjTD-0005w9-Ri; Fri, 19 Dec 2008 17:49:03 +0000 Received: from localhost.t-mobile.co.uk ([127.0.0.1]) by localhost (smtpbeckt01 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22623-09; Fri, 19 Dec 2008 17:49:03 +0000 (GMT) Received: from [10.206.8.46] (helo=rya-online.net) by localhost.localdomain with smtp (Exim 4.50) id 1LDjTA-0005vz-Jd; Fri, 19 Dec 2008 17:49:03 +0000 Received: (nullmailer pid 851 invoked by uid 1000); Fri, 19 Dec 2008 17:47:27 -0000 Date: Fri, 19 Dec 2008 17:47:27 +0000 (GMT) To: Oliver Fromme In-Reply-To: References: <200812182301.mBIN1PGs062021@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1229708847.488082.724.nullmailer@galant.ukfsn.org> From: Iain Hibbert X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at example.com X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: plunky@rya-online.net X-SA-Exim-Scanned: No (on localhost.localdomain); SAEximRunCond expanded to false Cc: freebsd-bluetooth@freebsd.org Subject: Re: Bluetooth socket timeout, device pairing 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, 19 Dec 2008 17:49:09 -0000 On Thu, 18 Dec 2008, Maksim Yevmenkin wrote: > Oliver Fromme writes: > > When I try to open a connection for the first time, > > the device (i.e. my Mindstorms NXT brick) asks me to > > enter the PIN code. > > its so called "LMP (link manager protocol) response timeout". its > defined in link manager, i.e. part of the device's firmware. v1.1 spec > seems to be implying that LMP response timeout should be set to 30 > sec. It could be that its not the LMP timeout that is causing the connection to be terminated though -- I never read that part of the spec but there are a bunch of other timeouts that could cause the problem depending on how the pairing is initiated? HCI Page Timeout time given for remote device to respond to HCI connection attempt L2CAP response timeout L2CAP control packet times out after this time. RFCOMM mcc/ack timeout and I find that on NetBSD I don't really think I've got it right, because the timeouts can trigger too fast. Eg, the default L2CAP response timeout is 20 seconds but the L2CAP connect request will often trigger a link code request then pin code request and entering the pin will take it over the limit.. (pairing is not needed often so I pushed this to the back of my mind :) I notice that some phone software has a 'pairing' function, where they can just pair with the remote hardware and not try to make higher level connections. Perhaps this kind of thing would work (ie just use hccontrol to create a baseband connection) to avoid any higher level protocol timeouts? > i'm not sure why do you care much about pin length. pin is only used > once to generate link key and as soon as link key is generated both > devices should use it instead of pin. more complex PIN does apparently mean more secure link key. I wonder though, if "Change Connection Link Key" (not in hccontrol IIRC?) can be used to make the link key more secure without needing to pair with a complex PIN.. presumably it generates a new link key based on some kind of random value exchanged over the already secure connection? iain ps I am also wondering, what kind of evil lego machine it is that Oliver is making that he requires ultimate security on the command channel :)