From owner-freebsd-bluetooth@FreeBSD.ORG Fri Dec 19 05:51:50 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 D0D1D106564A for ; Fri, 19 Dec 2008 05:51:50 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.235]) by mx1.freebsd.org (Postfix) with ESMTP id A517A8FC14 for ; Fri, 19 Dec 2008 05:51:50 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2200801rvf.43 for ; Thu, 18 Dec 2008 21:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UESDglJ2+oY6UP58hCVXK4pqAL1sdeK3JyGsGUinNs4=; b=HeAVlnzS83vm59NDltKCE2RpsqK7018Q8tX6VQhU9kHTgpIaXyWk/2fazu5mxZUKUK wDncvJVIOy3OdR+ekrVHxHLxvBSxoVrVmWfhMmbqM0n/uSIQ/LZfsjNNTFdFOBMNnj+Q ocK0/52pwoxkr9CGMhxByEakIJK7G7GphVL2E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bEiQp8kJ812F25rcCCiB/b66prfCQO3cZhUUh273ZwcnMEmSI8H0UVAEEWjtvSxx1H Wfozg4vnjgG6vmRFChi+iowx28oRDCHwviAjPeouX/tohxfA22gPnGG07u9EnCfBBGke 1vFTdAVzD82pLwxx6g8x9aV2RG8scFYtJnpIY= Received: by 10.140.193.16 with SMTP id q16mr1408263rvf.6.1229665910397; Thu, 18 Dec 2008 21:51:50 -0800 (PST) Received: by 10.140.177.21 with HTTP; Thu, 18 Dec 2008 21:51:50 -0800 (PST) Message-ID: Date: Thu, 18 Dec 2008 21:51:50 -0800 From: "Maksim Yevmenkin" To: "Oliver Fromme" In-Reply-To: <200812182301.mBIN1PGs062021@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812182301.mBIN1PGs062021@lurza.secnetix.de> 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 05:51:50 -0000 Oliver, > My Bluetooth Python module basically works now. > However, I've got one small problem with pairing ... > > I have entered an 8-character PIN code in hcsecd.conf. > 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. However, entering the code on > the brick takes some time ... I have to scroll > through the alphabet and digits which is rather slow. > I can enter at most 4 characters of the PIN code > before the socket() call returns with ECONN > ("Connection refused"). > > For now I'm using a short 4-character PIN code, but > I would really like to use a longer one. Where is > the timeout defined for that? 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. > Python's socket module has no timeout by default. > I've also searched the net.bluetooth sysctls and > increased all of the timeout values (half a dozen), > but none of them seemed to have an effect on this > particular problem. So I think this value must be > hardcoded somewhere. Where do I have to look? i'm afraid that you can not change LMP response timeout. there isn't any defined command that would do that. 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. thanks, max