From owner-freebsd-bluetooth@FreeBSD.ORG Wed May 16 11:13:03 2007 Return-Path: X-Original-To: bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CFAD16A404 for ; Wed, 16 May 2007 11:13:03 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from mh2.centtech.com (moat3.centtech.com [64.129.166.50]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0A613C455 for ; Wed, 16 May 2007 11:13:03 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from neutrino.centtech.com (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.8/8.13.8) with ESMTP id l4GBD1oA078239; Wed, 16 May 2007 06:13:01 -0500 (CDT) (envelope-from anderson@freebsd.org) Message-ID: <464AE73D.8010307@freebsd.org> Date: Wed, 16 May 2007 06:13:01 -0500 From: Eric Anderson User-Agent: Thunderbird 2.0.0.0 (X11/20070420) MIME-Version: 1.0 To: Vladimir Grebenschikov References: <1179237283.1397.25.camel@localhost> <464A8EFC.7060308@freebsd.org> <1179304640.45992.8.camel@localhost> In-Reply-To: <1179304640.45992.8.camel@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.88.4/3256/Wed May 16 03:40:07 2007 on mh2.centtech.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=8.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.6 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on mh2.centtech.com Cc: bluetooth Subject: Re: Bluetooth Proximity Monitor on FreeBSD ? 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: Wed, 16 May 2007 11:13:03 -0000 On 05/16/07 03:37, Vladimir Grebenschikov wrote: > В вт, 15/05/2007 в 23:56 -0500, Eric Anderson пишет: >> On 05/15/07 08:54, Vladimir Grebenschikov wrote: >>> Hi >>> >>> Does anybody plays with scrips like that: >>> http://gentoo-wiki.com/TIP_Bluetooth_Proximity_Monitor >>> >>> I guess it should be easy to patch it for FreeBSD, but probably somebody >>> already did it ? >>> >> >> Like this: >> >> http://www.googlebit.com/doku.php?id=bt_proximity >> >> Didn't take too long to do it up for FreeBSD, and works great!! > > Requires a bit modification to work for me and finally works very > unstable: > > # /usr/sbin/hccontrol -n ubt0hci create_connection e60 > BD_ADDR: e60 > Connection handle: 11 > Encryption mode: Disabled [0] > # /usr/sbin/hccontrol -n ubt0hci read_connection_list > Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State > e60 11 ACL 0 MAST NONE 0 0 OPEN > # /usr/sbin/hccontrol -n ubt0hci read_connection_list > Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State > e60 11 ACL 0 MAST NONE 0 0 OPEN > # /usr/sbin/hccontrol -n ubt0hci read_connection_list > Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State > e60 11 ACL 0 MAST NONE 0 0 OPEN > # /usr/sbin/hccontrol -n ubt0hci read_connection_list > Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State > e60 11 ACL 0 MAST NONE 0 0 OPEN > # /usr/sbin/hccontrol -n ubt0hci read_connection_list > Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State > # dmesg | tail -n 1 > ng_l2cap_lp_discon_ind: ubt0l2cap - unexpected LP_DisconnectInd event. Connection does not exist, con_handle=11 > # > > Connection expires somehow in ~5 secs after creation. > Probably there is some way to do keep-alive connection ? > > My device is Nokia E60. > > PPP over telephone Bluetooth works more or less stable. > > Of course, I can just use l2ping or 'hccontrol Inquiry' to check device > presence, but how to read signal quality in that case ? Hmm.. Seems as my Palm Treo 700p leaves the connection open as long as both are within range. If the polling is set less than 5 seconds, you should be able to add some kind of command (like the l2ping or whatever) right before it does the connection testing. That way each time it polls it renews the connection timeout. Did you try something like that? Eric