From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 22 17:57:26 2015 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6BBFD4B for ; Wed, 22 Apr 2015 17:57:26 +0000 (UTC) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD1801FB5 for ; Wed, 22 Apr 2015 17:57:26 +0000 (UTC) Received: by oblw8 with SMTP id w8so177100086obl.0 for ; Wed, 22 Apr 2015 10:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9BHwIVXGRdrHp9vVzgqyeaPrwrmWi7lkWq5JuNJ35MU=; b=ef96fXSf1xt3h1ep6Yd9TPUJsekwf0brlcxNL9dXfLvMHTxeyKUQ1eSl9JEg38CXxQ iJETda4bGJEliWDsRsdwRQNI2LteZLFU1h3UGrdd0wgBZ0wF5/ba8rlBQBw2GrYRRNfw 6nWGTD6MKYSmgR93pCNgtgLlr7pEJPck0endkou+aE4y3mjj6Smcj893DEH1laOpCMf5 KP5wiaXndHm/i4TkxYA6PXeKAwgxoZmOlbD+3qTlJWW6NHJhVwtd5A5JsPhFDP/FU4da CZlNBc32qbMUuI3HuAAPAlanT8N81jrJ/cjcf8WP/HmewgviOaF1C2EDYneuReeW/z1E QzIg== MIME-Version: 1.0 X-Received: by 10.202.183.214 with SMTP id h205mr23247857oif.87.1429725445472; Wed, 22 Apr 2015 10:57:25 -0700 (PDT) Received: by 10.202.177.85 with HTTP; Wed, 22 Apr 2015 10:57:25 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Apr 2015 10:57:25 -0700 Message-ID: Subject: Re: question about bthidd client.c From: Waitman Gobble To: Maksim Yevmenkin Cc: "freebsd-bluetooth@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2015 17:57:27 -0000 On Wed, Apr 22, 2015 at 10:45 AM, Maksim Yevmenkin wrote: > On Tue, Apr 21, 2015 at 10:34 PM, Waitman Gobble wrote: >> >> I notice that if bthidd is running, and bluetooth is not active, or >> the configured host is out of range, the client_rescan() function >> generates new vkbd devices every 20 seconds or so. I believe this will >> eventually lock up the machine. >> > > may be... usually devices will reconnect, i.e. reconnect_initiate > would be 1. however, this is a known problem. for whatever reason > "cloned" devices are not completely going away when closed. similar > problem exists with other "cloned" devices. its not bthidd or > bluetooth code specific. > > thanks > max Thanks for the reply. Is there a better way to decide if a device is 'connectable'? It looks like a chicken-and-egg kind of problem, since the connect routine uses the established vkbd device. I am thinking that attempting to connect to the device on psm 1 is a way to verify that the host is connectable in the first place, before creating a new vkbd. Or, maybe the new vkbd can be destroyed on failure... but maybe this would cause other problems. I noticed this problem when I had the dongle unplugged, so there was no bluetooth available. But I had left bthidd set to start in rc.conf. Thank you, -- Waitman Gobble Los Altos California USA 510-830-7975