Date: Wed, 22 Apr 2015 11:28:29 -0700 From: Waitman Gobble <gobble.wa@gmail.com> To: Maksim Yevmenkin <maksim.yevmenkin@gmail.com> Cc: "freebsd-bluetooth@freebsd.org" <freebsd-bluetooth@freebsd.org> Subject: Re: question about bthidd client.c Message-ID: <CAFuo_fx=WReWvvBWqoyVCRLEVUGf5xrxJeJd2-cL7jsROeZFFA@mail.gmail.com> In-Reply-To: <CAFPOs6oV%2BVv=d5j1=iVNxB6_GanxzRMs3yqM-oC=nM89u4P1yQ@mail.gmail.com> References: <CAFuo_fzVganO6M07neAWBVqda1vzV9VNWurU6EsP_3Mc78-dMA@mail.gmail.com> <CAFPOs6oySELB%2BFsf8nt92OAtizkEn425qeFmy-oc9NHdkFwUNA@mail.gmail.com> <CAFuo_fwjoLKLxjfBw_W62Q7Sizu9-DrJDVr0CM7N_N%2B45OYp-w@mail.gmail.com> <CAFPOs6p6etgh1u0Fn%2BwYXyxTF0pccfD9-o5cwHZFDwv=OObCjw@mail.gmail.com> <CAFPOs6oV%2BVv=d5j1=iVNxB6_GanxzRMs3yqM-oC=nM89u4P1yQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 22, 2015 at 11:26 AM, Maksim Yevmenkin <maksim.yevmenkin@gmail.com> wrote: > On Wed, Apr 22, 2015 at 11:17 AM, Maksim Yevmenkin > <maksim.yevmenkin@gmail.com> 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 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 >> >> device tells host who is supposed to initiate reconnect (in sdp >> attribute). normally, devices will initiate reconnect. host should not >> be required to constantly "poll". there is no easy way to know if >> device is "connectable". inquiry may tell you if device is in range >> but only if device is in "discoverable" mode. most devices will only >> go into discoverable mode during pairing. >> >>> 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. >> >> there should not be any problem. cloned device is created on open() >> and should be destroyed on close(). > > the simplest solution to this problem is to add a configuration > parameter that specifies vkbd unit number for each entry. this way, > the same device (i.e. keyboard) will always use the same vkbd. no more > endless cloning. > > thanks, > max Max, OK that sounds like the way to go. Thanks, -- Waitman Gobble Los Altos California USA 510-830-7975
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFuo_fx=WReWvvBWqoyVCRLEVUGf5xrxJeJd2-cL7jsROeZFFA>