From owner-freebsd-bluetooth@FreeBSD.ORG Thu Mar 19 19:48:13 2015 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1A29100 for ; Thu, 19 Mar 2015 19:48:12 +0000 (UTC) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (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 61EE2D8F for ; Thu, 19 Mar 2015 19:48:12 +0000 (UTC) Received: by webcq43 with SMTP id cq43so65994038web.2 for ; Thu, 19 Mar 2015 12:48:10 -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:content-transfer-encoding; bh=fpLOpmdkShJUbeYLfFcvEAPh65TZe3U2ZR0fXeDmUc8=; b=QwI6wB6UlcfsZ797pj2sefGPvBrW8qsXd3HYJGjeiL9nIg9W8E0Pv43g5iKk4bjzOB ZnVzR3jS0UGScmuW3IFKxbzLoH8yzNXe8VRcixSL/2yC6YM2u0dk7gbdYNTahZVO0gTh aW7+/wnPD+JQPNhKNW77ya0Fn7J7AshE/wtpxwMEQYP3LyjDcqdyt/bKGslbEoh46Eme qfejEbkbt+gP9c9Pfmf08a0ruqVj68n1iUx7hG/8FUNnAgJ7ZpiPWnatNyVqqcsn0eyx Ae8o8cItDfxBFMpyv6HGyy7V35eRrLcbSO+jnlaaZjd+tR3AvOfRBQLYStEXaIZ1lidr eZ8g== MIME-Version: 1.0 X-Received: by 10.180.218.71 with SMTP id pe7mr19329830wic.70.1426794490853; Thu, 19 Mar 2015 12:48:10 -0700 (PDT) Received: by 10.27.214.136 with HTTP; Thu, 19 Mar 2015 12:48:10 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Thu, 19 Mar 2015 12:48:10 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-bluetooth@freebsd.org" , Iain Hibbert X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 19:48:13 -0000 On Thu, Mar 19, 2015 at 8:53 AM, Maksim Yevmenkin wrote: > Hello, > >> maybe getting closer. bthidd connects and opens control and interrupt >> channels, and i can see data on the interrupt line. > > [...] > >> send characters to FIFO >> # echo "ABEF010231" >> /tmp/ain >> >> ... >> sent data 3 >> sent data 4 >> sent data 7 >> sent data 8 >> sent data 38 >> sent data 29 >> sent data 38 >> sent data 30 >> sent data 31 >> sent data 29 >> >> this shows up on the client .. simple syslog(LOG_ERR,"%s",data.b); >> >> Mar 18 21:23:32 rpidev bthidd[4948]: Opening outbound session for >> 00:1b:dc:06:94:d3 (new_device=3D0, reconnect_initiate=3D0) >> Mar 18 21:23:32 rpidev kernel: kbd2 at vkbd16 >> Mar 18 21:23:35 rpidev bthidd[4948]: >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^C >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^D >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^G >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^H >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- & >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^] >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- & >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^^ >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^_ >> Mar 18 21:23:51 rpidev bthidd[4948]: =C2=A1^BM- ^] >> >> I'm guessing I'll have to hook up a display to that machine to see if >> the virtual keyboard device is working right. > > ok. so seems like your data are making it all the way to bthidd(8). > its good. a couple things > > (1) please make sure your hid report is correctly encoded. i don't > recall all the specifics at this time, but, i'm fairly certain you > need to actually send two hid reports for each character, i.e. one for > key being pressed and one for key being released; > > (2) with respect to virtual keyboard working, please make sure that > machine that runs bthidd(8) also has kbdmux(4) loaded. kbdmux(4) > should be enabled by default in GENERIC, but please double check. if > its not, please make sure to either kldload kbdmux (you can do it from > loader.conf), or, compile it into the kernel. > >> modified bthidd https://github.com/waitman/bthidd > > can you please point me to your modifications? Hi, It's not for production use, but if someone comes across this post in the future maybe save a few minutes when tinkering and troubleshooting. I changed the Makefile so it will 'more easily' build as a standalone outside /usr/src I added the syslog line around ln 324 in server.c - just wanted to see that data was coming in. do { len =3D read(fd, &data, to_read); syslog(LOG_ERR,"%s",data.b); } while (len < 0 && errno =3D=3D EINTR); > > [...] > >> I'm going to have to go through everything from the beginning and make >> sure everything is correct. > > i suspect that your hid reports are not quite correct. > >> Here's what I did to generate bthidd.conf - maybe I can make a man >> page for bthidd.conf? There's a note on the bthidd man page about >> needing a bthidd.conf man page. (but maybe there's a better way than >> the way I did it?) > > i think the way you did it is correct. bthidd.conf contains entries > produced by "bthidcontrol query" command. normally it is not needed to > do modify entries in any way. Ok great i'll create a man page for bthidd.conf > >> also, I'll try the manual restart of bluetooth stack and let you know >> if that works. > > you really should not need to do anything manually. everything should > be started automatically (from devd.conf) when ng_ubt(4) device > attaches. > Sorry, I was referring to your previous message about trying to restart bluetooth 'manually' to see if it works. > thanks, > max --=20 Waitman Gobble Los Altos California USA 510-830-7975