From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 03:41:58 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 9C3B27AF for ; Sun, 22 Mar 2015 03:41:58 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (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 1C4E63D5 for ; Sun, 22 Mar 2015 03:41:58 +0000 (UTC) Received: by wgra20 with SMTP id a20so119730288wgr.3 for ; Sat, 21 Mar 2015 20:41:56 -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=PgPzXXw3z8BXq27RKqKmSF7nswBkNMkcvUJ2KWll990=; b=GTCbV9OIB1NvJ3N20paN8/hnJEHiH4NEj5VyJS4e8tmhZHurmU9QGHRpp9HnlQMtiD woxqnviuUShKj6voGtrndj2NLxLAJV4bsgy3POtfNf1BP7QPuxptO31/NWKZy6/nvWyv o4z9OGEZKD0S+QNQhaatvvDDWuefL3h44imEgSiZ/t08Gy1ZVqY0ZeBKBd3E/hDDnSMy o4uD85da1UrHbFuvUUiQqrP7aUCFwwHopMzBP+Y/Y/tfwFifkMs/4UEzRsAnJwFOuBtY Q/KN++4V1vpznu0LHCjPmjp449o2+2oYdxO91LfOgLuO6NeCYOKDMQLyY0pAXbF8VcnL zmJg== MIME-Version: 1.0 X-Received: by 10.180.77.40 with SMTP id p8mr8497040wiw.1.1426995716586; Sat, 21 Mar 2015 20:41:56 -0700 (PDT) Received: by 10.27.214.136 with HTTP; Sat, 21 Mar 2015 20:41:56 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Sat, 21 Mar 2015 20:41:56 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 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: Sun, 22 Mar 2015 03:41:58 -0000 On Thu, Mar 19, 2015 at 1:24 PM, Maksim Yevmenkin wrote: >> 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 = read(fd, &data, to_read); >> syslog(LOG_ERR,"%s",data.b); >> } while (len < 0 && errno == EINTR); > > ok, thanks. > > so, yes, please check your hid report format. > > this it the input report you should be using (this is taken from your > hid descriptor) > > Input id=1 size=8 count=6 page=Keyboard > usage=Reserved_(no_event_indicated), logical range 0..255 > > so, it means that on-the-wire packet should be 10 bytes > > byte 0: 0xA1 -- bluetooth header > byte 1: 0x01 -- hid report id > byte 2: 0xXX -- bitmask for modifier key pressed, i.e. ctrl, shift, alt, etc. > byte 3: 0x00 -- padding > byte 4: 0xXX -- key code pressed #1 > byte 5: 0xXX -- key code pressed #2 > byte 6: 0xXX -- key code pressed #3 > byte 7: 0xXX -- key code pressed #4 > byte 8: 0xXX -- key code pressed #5 > byte 9: 0xXX -- key code pressed #6 > > hid repot should tell which keys (scan codes 1..6) are pressed > currently, and, which modifier keys are pressed currently (byte 2). if > no keys are pressed currently, then, 0x00 should be used. host should > keep track of which keys were pressed previously, and, effectively > build a press/release logic itself. meaning if hid report N had key > code K, and, hid report N+1 did not have key code K, then it means > that key code K was pressed and subsequently released. > > here is another example that my be easier to understand. suppose we > start with no keys pressed. hid report will look like > > byte 0: 0xA1 > byte 1: 0x01 > byte 2: 0x00 > byte 3: 0x00 > byte 4: 0x00 > byte 5: 0x00 > byte 6: 0x00 > byte 7: 0x00 > byte 8: 0x00 > byte 9: 0x00 > > now, suppose key 'a' was pressed and then released. two hid reports > will go out, i.e. > > byte 0: 0xA1 > byte 1: 0x01 > byte 2: 0x00 > byte 3: 0x00 > byte 4: key code for 'a' key > byte 5: 0x00 > byte 6: 0x00 > byte 7: 0x00 > byte 8: 0x00 > byte 9: 0x00 > > followed by > > byte 0: 0xA1 > byte 1: 0x01 > byte 2: 0x00 > byte 3: 0x00 > byte 4: 0x00 > byte 5: 0x00 > byte 6: 0x00 > byte 7: 0x00 > byte 8: 0x00 > byte 9: 0x00 > > meaning key 'a' was released and no other keys were pressed. > > i hope it makes sense to you. > > thanks, > max I finally have it working, except for some reason it's repeating last character. ('1' in the following example) Sending 'ABEF010231' to FIFO buffer, the client "types" the following: ABEF010231111111111111111111111111111111111111111111111111111111111111 1 forever, until i send another string of data to FIFO buffer, then it again repeats the last key as if it were stuck. i have 'release' key defined as /* empty struct for key release */ struct hidrep_keyb_t * releasekey = (void *)hidrep; releasekey->btcode = 0xA1; releasekey->rep_id = REPORTID_KEYBD; releasekey->modify = 0x00; releasekey->pad = 0x00; releasekey->key[0] = 0x00; releasekey->key[1] = 0x00; releasekey->key[2] = 0x00; releasekey->key[3] = 0x00; releasekey->key[4] = 0x00; releasekey->key[5] = 0x00; here's the loop, for each character in FIFO buffer vkeyb->btcode = 0xA1; vkeyb->rep_id = REPORTID_KEYBD; vkeyb->modify = shiftkey(sfifo[i]); vkeyb->pad = 0x00; vkeyb->key[0] = retkey(sfifo[i]); /* key press */ vkeyb->key[1] = 0x00; vkeyb->key[2] = 0x00; vkeyb->key[3] = 0x00; vkeyb->key[4] = 0x00; vkeyb->key[5] = 0x00; send ( intrsockfd, vkeyb,sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); printf("sent data %d %lu\n",vkeyb->key[0],sizeof(struct hidrep_keyb_t)); send ( intrsockfd, releasekey,sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); printf("sent release\n"); fflush(stdout); it does 'shift' 0x2 modifier on A-Z I think I'm missing something with the release key. Thank you, -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 15:19:29 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 8E31AA12 for ; Sun, 22 Mar 2015 15:19:29 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (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 0D7A6BEC for ; Sun, 22 Mar 2015 15:19:29 +0000 (UTC) Received: by wibgn9 with SMTP id gn9so37086489wib.1 for ; Sun, 22 Mar 2015 08:19:27 -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=MwuRxWIX3LsxSDbGcfPeKLBgWJ7FDfTIxJ5IdVPWWxA=; b=GvDi34PVUY6OTrDm2ufnfK4SqdbskcAjNvEfFvId9p9wUX6Qhs2/XXg5n3P7ZJFQtk oXOHG/EPYe8u96fNqImoj6o/kx91PAqDWM6ty93Z9Sy02NMXs86DcyKpXRqJMQbFSbI3 9Yj96piCEFazXWbC1s++k5DnxwPAOcWz+KpaJOEG+rfOxRI+ZdRGti9rmrQ5VNTn9wPn 9mawHk0qAKZRMq/pjEe/NE0nkLpqOlW88bGIWUUoS0YqkTLAc0Sw0bfiNDXdtuvDVj8Q v1TdplFNdpOExYdbSfxbUKWygd1vZzm6x0L1pAS0UiorvfPu+1nd3w1u15FwocbjqRU8 WAIg== MIME-Version: 1.0 X-Received: by 10.195.12.35 with SMTP id en3mr171270989wjd.129.1427037567605; Sun, 22 Mar 2015 08:19:27 -0700 (PDT) Received: by 10.27.214.136 with HTTP; Sun, 22 Mar 2015 08:19:27 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Sun, 22 Mar 2015 08:19:27 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 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: Sun, 22 Mar 2015 15:19:29 -0000 On Sat, Mar 21, 2015 at 8:41 PM, Waitman Gobble wrote: > On Thu, Mar 19, 2015 at 1:24 PM, Maksim Yevmenkin > wrote: >>> 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 = read(fd, &data, to_read); >>> syslog(LOG_ERR,"%s",data.b); >>> } while (len < 0 && errno == EINTR); >> >> ok, thanks. >> >> so, yes, please check your hid report format. >> >> this it the input report you should be using (this is taken from your >> hid descriptor) >> >> Input id=1 size=8 count=6 page=Keyboard >> usage=Reserved_(no_event_indicated), logical range 0..255 >> >> so, it means that on-the-wire packet should be 10 bytes >> >> byte 0: 0xA1 -- bluetooth header >> byte 1: 0x01 -- hid report id >> byte 2: 0xXX -- bitmask for modifier key pressed, i.e. ctrl, shift, alt, etc. >> byte 3: 0x00 -- padding >> byte 4: 0xXX -- key code pressed #1 >> byte 5: 0xXX -- key code pressed #2 >> byte 6: 0xXX -- key code pressed #3 >> byte 7: 0xXX -- key code pressed #4 >> byte 8: 0xXX -- key code pressed #5 >> byte 9: 0xXX -- key code pressed #6 >> >> hid repot should tell which keys (scan codes 1..6) are pressed >> currently, and, which modifier keys are pressed currently (byte 2). if >> no keys are pressed currently, then, 0x00 should be used. host should >> keep track of which keys were pressed previously, and, effectively >> build a press/release logic itself. meaning if hid report N had key >> code K, and, hid report N+1 did not have key code K, then it means >> that key code K was pressed and subsequently released. >> >> here is another example that my be easier to understand. suppose we >> start with no keys pressed. hid report will look like >> >> byte 0: 0xA1 >> byte 1: 0x01 >> byte 2: 0x00 >> byte 3: 0x00 >> byte 4: 0x00 >> byte 5: 0x00 >> byte 6: 0x00 >> byte 7: 0x00 >> byte 8: 0x00 >> byte 9: 0x00 >> >> now, suppose key 'a' was pressed and then released. two hid reports >> will go out, i.e. >> >> byte 0: 0xA1 >> byte 1: 0x01 >> byte 2: 0x00 >> byte 3: 0x00 >> byte 4: key code for 'a' key >> byte 5: 0x00 >> byte 6: 0x00 >> byte 7: 0x00 >> byte 8: 0x00 >> byte 9: 0x00 >> >> followed by >> >> byte 0: 0xA1 >> byte 1: 0x01 >> byte 2: 0x00 >> byte 3: 0x00 >> byte 4: 0x00 >> byte 5: 0x00 >> byte 6: 0x00 >> byte 7: 0x00 >> byte 8: 0x00 >> byte 9: 0x00 >> >> meaning key 'a' was released and no other keys were pressed. >> >> i hope it makes sense to you. >> >> thanks, >> max > > I finally have it working, except for some reason it's repeating last > character. ('1' in the following example) > > Sending 'ABEF010231' to FIFO buffer, the client "types" the following: > > ABEF010231111111111111111111111111111111111111111111111111111111111111 > > 1 forever, until i send another string of data to FIFO buffer, then it > again repeats the last key as if it were stuck. > > i have 'release' key defined as > > /* empty struct for key release */ > struct hidrep_keyb_t * releasekey = (void *)hidrep; > releasekey->btcode = 0xA1; > releasekey->rep_id = REPORTID_KEYBD; > releasekey->modify = 0x00; > releasekey->pad = 0x00; > releasekey->key[0] = 0x00; > releasekey->key[1] = 0x00; > releasekey->key[2] = 0x00; > releasekey->key[3] = 0x00; > releasekey->key[4] = 0x00; > releasekey->key[5] = 0x00; > > > here's the loop, for each character in FIFO buffer > > vkeyb->btcode = 0xA1; > vkeyb->rep_id = REPORTID_KEYBD; > vkeyb->modify = shiftkey(sfifo[i]); > vkeyb->pad = 0x00; > vkeyb->key[0] = retkey(sfifo[i]); /* key press */ > vkeyb->key[1] = 0x00; > vkeyb->key[2] = 0x00; > vkeyb->key[3] = 0x00; > vkeyb->key[4] = 0x00; > vkeyb->key[5] = 0x00; > send ( intrsockfd, vkeyb,sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); > printf("sent data %d %lu\n",vkeyb->key[0],sizeof(struct hidrep_keyb_t)); > send ( intrsockfd, releasekey,sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); > printf("sent release\n"); > fflush(stdout); > > it does 'shift' 0x2 modifier on A-Z > > > I think I'm missing something with the release key. > > Thank you, > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 Max, I solved the problem, I got rid of the 'release key' structure and change vkeyb->key[0] to 0, then send that as a key release. Its working now. I believe I just need to handle client disconnects, and re-connects, and I think it will be all good. Thanks for your help. -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 18:23:45 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 0863D75F for ; Sun, 22 Mar 2015 18:23:45 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (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 78826D4 for ; Sun, 22 Mar 2015 18:23:44 +0000 (UTC) Received: by wgra20 with SMTP id a20so129327341wgr.3 for ; Sun, 22 Mar 2015 11:23:42 -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=4aTjBBKXjbxWt8JfWpquiCpUyq5R7AXBk5/ia7gX/JY=; b=AEsN7NyPTlOIJSMtxtX8vjkb18TIhQDo2GP805XYky8uxwy2hUNuiapoZFRupxqVWy iOlBuNkHn1YWwmpWHI+HeujYJ/xCIvquASYC8pc4ibrvYhlg8i3JvchEpSNiPfJelgC7 syltp+iospqOXAK3bcZek2PFN07WjD9mbAvGeAVKh2z0LGs5LQtBS7Iw6zE66Btlk4Jn DiT/6RiQeV2JUbqYS7Z+JTYg7BGble3C52ppxsZIS8ncdYyuzzXJwNEPkcmclrvafD4e Y+aRWps0FtQ3YrsaVzxzB4gRQvmRFeBOJ/cMF4tOJE4604jEPonSwcpyUkCSs9K/95/7 S8XA== MIME-Version: 1.0 X-Received: by 10.195.12.35 with SMTP id en3mr172294326wjd.129.1427048622790; Sun, 22 Mar 2015 11:23:42 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 22 Mar 2015 11:23:42 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Sun, 22 Mar 2015 11:23:42 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 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: Sun, 22 Mar 2015 18:23:45 -0000 > > Max, > > I solved the problem, I got rid of the 'release key' structure and > change vkeyb->key[0] to 0, then send that as a key release. Its > working now. > > I believe I just need to handle client disconnects, and re-connects, > and I think it will be all good. > > Thanks for your help. > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 Here's an updated version in case someone needs this sort of thing. daemonized process, uses SIGHUP to disconnect clients and added upper/lower characters and some special characters. Optionally set key stroke delay. https://github.com/waitman/hid_sppd This version only allows a single client connection and single FIFO at one time. Maybe in the future, handle multiple FIFO buffers and clients. But at the moment I don't believe I have a need for that functionality. I needed a way to add BT HID functionality to my inexpensive long-range RFID reader/writer device, because apparently people want to have RFID EPC codes auto-type (into their software applications?). You may specify PID File, FIFO buffer file and keystroke delay (or use the defaults). Keystroke delay is specified in milliseconds. # hid_sppd -P /var/run/boo.pid -F /tmp/fifotmp -d 50 Some examples of sending characters to client: # echo "222223333344444A" >> /tmp/fifotmp or if you need special characters like "\n" and "\t" # printf "22;222\t33 33\t44.444AabcdE\nEEeeeX " >> /tmp/fifotmp (Note that if you use 'printf' then add an extra trailing space.) so, any program should be able to write to the FIFO buffer. To disconnect clients: # pkill -HUP -F /var/run/boo.pid It's possible bad things may happen if you try to send like a Gigabyte of data to the FIFO buffer. It's a thought, but I haven't stress-tested it like that. I'm fairly new to Bluetooth so I don't yet fully understand how everything works together but it seems like a good future project (and possibly GSOC for a student) would be to implement BLE/GATT, and other protocols in this age of 'wearable devices'? -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 20:10:38 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 59BC2BC0 for ; Sun, 22 Mar 2015 20:10:38 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:c:538::198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09F51E42 for ; Sun, 22 Mar 2015 20:10:38 +0000 (UTC) Received: from mfilter33-d.gandi.net (mfilter33-d.gandi.net [217.70.178.164]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id D0102FB877; Sun, 22 Mar 2015 21:10:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter33-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter33-d.gandi.net (mfilter33-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id hOWG2QwIUZQt; Sun, 22 Mar 2015 21:10:34 +0100 (CET) X-Originating-IP: 31.68.68.12 Received: from galant.ogmig.net (unknown [31.68.68.12]) (Authenticated sender: plunky@ogmig.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 46138FB87D; Sun, 22 Mar 2015 21:10:33 +0100 (CET) Received: by galant.ogmig.net (Postfix, from userid 1000) id B86692600C6; Sun, 22 Mar 2015 20:10:28 +0000 (GMT) Date: Sun, 22 Mar 2015 20:10:28 +0000 (GMT) From: Iain Hibbert To: Waitman Gobble Subject: Re: register HID with SDP error In-Reply-To: Message-ID: References: <77352B43-637C-4E0D-B4CC-B42D977551F6@gmail.com> User-Agent: Alpine 2.11 (NEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "freebsd-bluetooth@freebsd.org" 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: Sun, 22 Mar 2015 20:10:38 -0000 On Sat, 21 Mar 2015, Waitman Gobble wrote: > > char newpin[16]; > correction, should be newpin[32], or maybe more.. MS windows asks for > a longer pincode. Are you sure about that? All the specifications I have seen, say that the PIN code can be a maximum of 128 bits. (see 7.1.12 Pin Code Request Reply Command in the Bluetooth v4.0 Core specification) iain From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 20:20:17 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 B0AF5E3 for ; Sun, 22 Mar 2015 20:20:17 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:c:538::198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F869F6D for ; Sun, 22 Mar 2015 20:20:17 +0000 (UTC) Received: from mfilter15-d.gandi.net (mfilter15-d.gandi.net [217.70.178.143]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 00E8FFB886; Sun, 22 Mar 2015 21:20:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter15-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter15-d.gandi.net (mfilter15-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id f9EtDDS5xNGf; Sun, 22 Mar 2015 21:20:14 +0100 (CET) X-Originating-IP: 31.68.68.12 Received: from galant.ogmig.net (unknown [31.68.68.12]) (Authenticated sender: plunky@ogmig.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 187C8FB87D; Sun, 22 Mar 2015 21:20:12 +0100 (CET) Received: by galant.ogmig.net (Postfix, from userid 1000) id 790622600C6; Sun, 22 Mar 2015 20:20:08 +0000 (GMT) Date: Sun, 22 Mar 2015 20:20:08 +0000 (GMT) From: Iain Hibbert To: Waitman Gobble Subject: Re: register HID with SDP error In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (NEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "freebsd-bluetooth@freebsd.org" 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: Sun, 22 Mar 2015 20:20:17 -0000 On Sun, 22 Mar 2015, Waitman Gobble wrote: > Here's an updated version in case someone needs this sort of thing. > daemonized process, uses SIGHUP to disconnect clients and added > upper/lower characters and some special characters. Optionally set key > stroke delay. > > https://github.com/waitman/hid_sppd btw regarding the name "hid_sppd", this makes no sense.. the rfcomm_sppd program is named thus, because it provides a Serial Port Profile daemon running over RFCOMM protocol. Your program is not in any way using SPP. btw there is a Bluetooth soft-keyboard for Linux here http://www.mulliner.org/bluetooth/xkbdbthid.php though I don't know if it still works.. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 20:42:24 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 30FCA6B1 for ; Sun, 22 Mar 2015 20:42:24 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (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 AD58B28D for ; Sun, 22 Mar 2015 20:42:23 +0000 (UTC) Received: by wibdy8 with SMTP id dy8so31431667wib.0 for ; Sun, 22 Mar 2015 13:42:22 -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=DYdT3+3YLTd/LNeYXl19eBtr1/b/LufFKKZ+xF8q6zs=; b=aMwrrszQgI+5ddHehq9rBTJFHSAEY/nbH7oPSZ6AQDw9pyJ/MT3fyLHu4rjeWXkdU1 V8SSQxjvp9isKtMVvla5Z5O3BjHizBrGpPhEDxnnK616WCBoMqr66DkZfQVyC0qi15qU Pij7QndvHL1b6zLf2Tu6HhXZQU7B/sTiMkzsLiBzLs4IVM1ub0CRcop4uyRb3A4Pz7Gq 1g4WqImOhD6wyqjiC6IJ9ZRmaCPMJIelTso73iPBpe16rRU20vyasIbPgLeNSp3xs7uq r5PlyL2O9e4C71tjnnZRUQoocnh1QRqT0a/cnq+4LlADgWXtnLkUAL+SI5Ab+5M/r+RI SE0Q== MIME-Version: 1.0 X-Received: by 10.180.80.7 with SMTP id n7mr13783011wix.60.1427056942230; Sun, 22 Mar 2015 13:42:22 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 22 Mar 2015 13:42:22 -0700 (PDT) In-Reply-To: References: Date: Sun, 22 Mar 2015 13:42:22 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" 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: Sun, 22 Mar 2015 20:42:24 -0000 On Sun, Mar 22, 2015 at 1:20 PM, Iain Hibbert wrote: > On Sun, 22 Mar 2015, Waitman Gobble wrote: > >> Here's an updated version in case someone needs this sort of thing. >> daemonized process, uses SIGHUP to disconnect clients and added >> upper/lower characters and some special characters. Optionally set key >> stroke delay. >> >> https://github.com/waitman/hid_sppd > > btw regarding the name "hid_sppd", this makes no sense.. the rfcomm_sppd > program is named thus, because it provides a Serial Port Profile daemon > running over RFCOMM protocol. Your program is not in any way using SPP. > > btw there is a Bluetooth soft-keyboard for Linux here > > http://www.mulliner.org/bluetooth/xkbdbthid.php > > though I don't know if it still works.. > > regards, > iain Thanks, it originally started as a copy of rfcomm_sppd - but of course it's completely different now. I do suppose it should have a better name. Thanks for the link to xkbdbthid. -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 20:52:57 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 80EBA91B for ; Sun, 22 Mar 2015 20:52:57 +0000 (UTC) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (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 051A039D for ; Sun, 22 Mar 2015 20:52:57 +0000 (UTC) Received: by wibg7 with SMTP id g7so23732688wib.1 for ; Sun, 22 Mar 2015 13:52:55 -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=bO6+DqfzmRGRk4Vy7ZeAhi7WC5FEDFDeVJSHt2jcrEc=; b=QDAnTYCZyHxErjPfa3OOgrSgFZQ4TjWI/tmx2AsVWZ+i+8vkIpfkfvxcmNx7ltPzTi 11gFgH9FDG5f21+vFibYCKCt7OZ/NB5jTPF1j1P2Bk/pnveT/UYb7pvxjGiTgJvXeF/O BaZGRtD0Fboq5T9yeq4eNe0BZaVyaqkMybycizvByl3bbb0yCapvCoJE58O7TasWnXLc l/Jm3fmYCzEI9f9Rv+7w3PFAKYC9/iwIw7k4zPC67W5GopWe96TVU4JpqXp2R8t+iYGH wHtSkJo8DYAVXOZ10SIzxvhu+2mNMnxhdBTsVjRBBgPP4xoKSRWputySSF543/+1KEtm CAcQ== MIME-Version: 1.0 X-Received: by 10.180.77.40 with SMTP id p8mr13698024wiw.1.1427057574977; Sun, 22 Mar 2015 13:52:54 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 22 Mar 2015 13:52:54 -0700 (PDT) In-Reply-To: References: <77352B43-637C-4E0D-B4CC-B42D977551F6@gmail.com> Date: Sun, 22 Mar 2015 13:52:54 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" 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: Sun, 22 Mar 2015 20:52:57 -0000 On Sun, Mar 22, 2015 at 1:10 PM, Iain Hibbert wrote: > On Sat, 21 Mar 2015, Waitman Gobble wrote: > >> > char newpin[16]; > >> correction, should be newpin[32], or maybe more.. MS windows asks for >> a longer pincode. > > Are you sure about that? All the specifications I have seen, say that the > PIN code can be a maximum of 128 bits. (see 7.1.12 Pin Code Request Reply > Command in the Bluetooth v4.0 Core specification) > > iain I was getting garbage in the pincode with char[16] 32 is larger than needed. But also need to add the 'enter key' or the client will sit there waiting. < HCI Command: PIN Code Request Reply(0x01|0x000d) plen 23 L . . . . . . 3 2 1 6 7 6 4 2 . . . . . -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 22 21:14:58 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 6D799880 for ; Sun, 22 Mar 2015 21:14:58 +0000 (UTC) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) (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 E7F4689D for ; Sun, 22 Mar 2015 21:14:57 +0000 (UTC) Received: by wetk59 with SMTP id k59so123103635wet.3 for ; Sun, 22 Mar 2015 14:14:56 -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=Wp3NDF/aSk7D+WI+vlPz4jNy23g4pZJzxTaWuwhJVOk=; b=lfPW9lje8IwJw+GhfHmtqOUkFo+ZJutNoSjWHpGnCMzyPfasu+f3DbGLlO8euBRPC2 VvgosZgunrvexw8l/NMpxJIC30HY6TBilFN/RBuzmj1knVsK9DmpD7b2WyB7Wsyk+5XQ 6+QZnzftZC3bktODIxsef30bJVhEvTPFODXpZdNuIXaL+A6MIU1s3Jm7az7xAJKjxG5S /Ci2ttWoyI/ZdY4zh2N1TDKxl/e516d+20s471cuHUubDqmlF+Fjy15zTyWXxLXiRz2L 1+tnQi1EC3A8bOOHdU9lljq5NPNBKL0QNZOoP/6w66WtOiC7m8TFa7zK3gUXjSzlTOpm GLHw== MIME-Version: 1.0 X-Received: by 10.194.75.168 with SMTP id d8mr182221118wjw.87.1427058896253; Sun, 22 Mar 2015 14:14:56 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 22 Mar 2015 14:14:56 -0700 (PDT) In-Reply-To: References: Date: Sun, 22 Mar 2015 14:14:56 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" 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: Sun, 22 Mar 2015 21:14:58 -0000 On Sun, Mar 22, 2015 at 1:42 PM, Waitman Gobble wrote: > On Sun, Mar 22, 2015 at 1:20 PM, Iain Hibbert wrote: >> On Sun, 22 Mar 2015, Waitman Gobble wrote: >> >>> Here's an updated version in case someone needs this sort of thing. >>> daemonized process, uses SIGHUP to disconnect clients and added >>> upper/lower characters and some special characters. Optionally set key >>> stroke delay. >>> >>> https://github.com/waitman/hid_sppd >> >> btw regarding the name "hid_sppd", this makes no sense.. the rfcomm_sppd >> program is named thus, because it provides a Serial Port Profile daemon >> running over RFCOMM protocol. Your program is not in any way using SPP. >> >> btw there is a Bluetooth soft-keyboard for Linux here >> >> http://www.mulliner.org/bluetooth/xkbdbthid.php >> >> though I don't know if it still works.. >> >> regards, >> iain > > > > Thanks, it originally started as a copy of rfcomm_sppd - but of > course it's completely different now. I do suppose it should have a > better name. > > Thanks for the link to xkbdbthid. > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 iain, Renamed to https://github.com/waitman/arthid thanks for pointing out that issue. -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 02:23:27 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 608F6977 for ; Mon, 23 Mar 2015 02:23:27 +0000 (UTC) Received: from udns.ultimatedns.net (unknown [IPv6:2602:d1:b4d6:e600:4261:86ff:fef6:aa2a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3643F9AD for ; Mon, 23 Mar 2015 02:23:27 +0000 (UTC) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.14.9/8.14.9) with ESMTP id t2N2PkGT048721 for ; Sun, 22 Mar 2015 19:25:52 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) To: "FreeBSD Bluetooth" From: "Chris H" Subject: Does FreeBSD's blootooth support more than mice/keyboards? Date: Sun, 22 Mar 2015 19:25:52 -0700 Content-Type: text/plain; charset=UTF-8; format=fixed MIME-Version: 1.0 Message-id: <73b93d8629cca8eef3911b4f6a67f14f@ultimatedns.net> Content-Transfer-Encoding: 8bit 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: Mon, 23 Mar 2015 02:23:27 -0000 Hello, I've spent most of today, and several other occasions to get communication between any of my FreeBSD based boxes, and any of my cell phones to pair with Bluetooth. But all attempts have failed. The dongle initializes, when plugged in: ugen0.2: at usbus0 Mar 22 16:07:39 demon0 kernel: ubt0: on usbus0 Pertinent loader.conf(5) ng_ubt_load="YES" kldstat returns: Id Refs Address Size Name 1 33 0xffffffff80200000 c097f8 kernel 2 3 0xffffffff80e0a000 b3c48 linux.ko 3 1 0xffffffff80ebe000 4610 if_stf.ko 4 1 0xffffffff80ec3000 ef0e20 nvidia.ko 5 1 0xffffffff81db4000 8838 ng_ubt.ko 6 6 0xffffffff81dbd000 156a0 netgraph.ko 7 2 0xffffffff81dd3000 13290 ng_hci.ko 8 4 0xffffffff81de7000 2fd0 ng_bluetooth.ko 9 1 0xffffffff82011000 3eeb linprocfs.ko 10 1 0xffffffff82015000 b4e5 ng_l2cap.ko 11 1 0xffffffff82021000 169ac ng_btsocket.ko 12 1 0xffffffff82038000 1e77 ng_socket.ko hccontrol queries: hccontrol read_bd_addr BD_ADDR: 00:05:16:58:c5:5a hccontrol read_local_name Local name: myhost.mydomain.tld (ubt0) Performing a scan from my cell phone, returns the "Local name", and (the phone) prompts me to "enter pin". I can watch communication (via the bluetooth dongles led). But all attempts to pair, fail with "unable to communicate with ...". This dongle works perfectly on OSX (I can pair). But I'm coming up empty handed on FreeBSD. I'm running (depending on the box) RELENG_9, or CURRENT (11). What more must I do, or is it even possible on FreeBSD? Thank you! --Chris -- From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 04:01:32 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 E7826E99 for ; Mon, 23 Mar 2015 04:01:32 +0000 (UTC) Received: from udns.ultimatedns.net (unknown [IPv6:2602:d1:b4d6:e600:4261:86ff:fef6:aa2a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC4E7644 for ; Mon, 23 Mar 2015 04:01:32 +0000 (UTC) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.14.9/8.14.9) with ESMTP id t2N43o7c064824 for ; Sun, 22 Mar 2015 21:03:56 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) To: In-Reply-To: <73b93d8629cca8eef3911b4f6a67f14f@ultimatedns.net> References: <73b93d8629cca8eef3911b4f6a67f14f@ultimatedns.net> From: "Chris H" Subject: Does FreeBSD's bluetooth support more than mice/keyboards? -- Was Does FreeBSD's blootooth... Date: Sun, 22 Mar 2015 21:03:56 -0700 Content-Type: text/plain; charset=UTF-8; format=fixed MIME-Version: 1.0 Message-id: <9093a3feff3d3d0f1b679ba9160da464@ultimatedns.net> Content-Transfer-Encoding: 8bit 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: Mon, 23 Mar 2015 04:01:33 -0000 Title correction. Sorry. On Sun, 22 Mar 2015 19:25:52 -0700 "Chris H" wrote Hello, I've spent most of today, and several other occasions to get communication between any of my FreeBSD based boxes, and any of my cell phones to pair with Bluetooth. But all attempts have failed. The dongle initializes, when plugged in: ugen0.2: at usbus0 Mar 22 16:07:39 demon0 kernel: ubt0: on usbus0 Pertinent loader.conf(5) ng_ubt_load="YES" kldstat returns: Id Refs Address Size Name 1 33 0xffffffff80200000 c097f8 kernel 2 3 0xffffffff80e0a000 b3c48 linux.ko 3 1 0xffffffff80ebe000 4610 if_stf.ko 4 1 0xffffffff80ec3000 ef0e20 nvidia.ko 5 1 0xffffffff81db4000 8838 ng_ubt.ko 6 6 0xffffffff81dbd000 156a0 netgraph.ko 7 2 0xffffffff81dd3000 13290 ng_hci.ko 8 4 0xffffffff81de7000 2fd0 ng_bluetooth.ko 9 1 0xffffffff82011000 3eeb linprocfs.ko 10 1 0xffffffff82015000 b4e5 ng_l2cap.ko 11 1 0xffffffff82021000 169ac ng_btsocket.ko 12 1 0xffffffff82038000 1e77 ng_socket.ko hccontrol queries: hccontrol read_bd_addr BD_ADDR: 00:05:16:58:c5:5a hccontrol read_local_name Local name: myhost.mydomain.tld (ubt0) Performing a scan from my cell phone, returns the "Local name", and (the phone) prompts me to "enter pin". I can watch communication (via the bluetooth dongles led). But all attempts to pair, fail with "unable to communicate with ...". This dongle works perfectly on OSX (I can pair). But I'm coming up empty handed on FreeBSD. I'm running (depending on the box) RELENG_9, or CURRENT (11). What more must I do, or is it even possible on FreeBSD? Thank you! --Chris -- > > > _______________________________________________ > freebsd-bluetooth@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth > To unsubscribe, send any mail to "freebsd-bluetooth-unsubscribe@freebsd.org" From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 05:39:20 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 E5C67E77 for ; Mon, 23 Mar 2015 05:39:19 +0000 (UTC) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (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 6E6E9ED9 for ; Mon, 23 Mar 2015 05:39:19 +0000 (UTC) Received: by wibg7 with SMTP id g7so28351525wib.1 for ; Sun, 22 Mar 2015 22:39:17 -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=MCAHP2OdUIC32DxJSGhhhhoxL82bsPTpayGSYkPWBMc=; b=lxxc7b0rn/y8+9YauebNB63PKtwrJkfBu3Kk7EQLcDYRxhULsw+sbtKyVBjqbY6EpM s4Cow4VMhW2pTIz2sC//FpzUS+Ua17dDLh2NKybU5nUwKfULYzWBUAUvqHFlTpq3ag27 XBKF9JDMVyU8motIp4NOXZOjoe9ljB1cPa1vWYK+QGjz0Zs4cjXRLNw0ZMIq3kgiQOi8 Gum1qjEkfNC3zVLKGTRils6VYeXJE2ZfHPHd1Pht0IT4iQJpytkFLwd5mxW5WtIgE26f 4WUkKqlhKzZj+PsabXRnNgIspTenvSpoSEFVzewKEBGUQ5hGS02Z9CPlms38ASMeBOJs gC0A== MIME-Version: 1.0 X-Received: by 10.180.83.195 with SMTP id s3mr16595007wiy.54.1427089157906; Sun, 22 Mar 2015 22:39:17 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 22 Mar 2015 22:39:17 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Sun, 22 Mar 2015 22:39:17 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 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: Mon, 23 Mar 2015 05:39:20 -0000 On Tue, Mar 17, 2015 at 11:33 AM, Maksim Yevmenkin wrote: > On Tue, Mar 17, 2015 at 11:20 AM, Iain Hibbert wrote: >> On Tue, 17 Mar 2015, Waitman Gobble wrote: >> >>> hcidump log https://gist.github.com/waitman/c3f8a3bc9b046e36dbb5 >> >> Kind of unrelatedly, from that log, the Linux machine requests a search >> for Protocol UUID 0x0100 (L2CAP) but gets nothing in return.. >> >>> ACL data: handle 0x0048 flags 0x02 dlen 24 >> L2CAP(d): cid 0x44 len 20 [psm 1] >> SDP SSA Req: tid 0x0 len 0xf >> pat uuid-16 0x0100 (L2CAP) >> max 0xffff >> aid(s) 0x0000 - 0xffff >> cont 00 >> < ACL data: handle 0x0048 flags 0x02 dlen 15 >> L2CAP(d): cid 0x40 len 11 [psm 1] >> SDP SSA Rsp: tid 0x0 len 0x6 >> cnt 0x3 >> cont 00 >> >> ..does the SDP server not return results for that, Max? > > well, i don't think i ever got around to adding a feature that looks > for uuid inside records. it currently only matches service class > uuid's. so, yes, query for l2cap uuid will return nothing currently. > its trivial to add this though. i think i even have a patch somewhere. > > [...] > >> btw .. if you use sdpcontrol(1) to query the local SDP server (see -l) >> then hcidump will not see anything of the interchange, since it does not >> go through the Bluetooth stack. > > absolutely correct > > thanks, > max I'm tracking down a client connection problem, maybe this is causing the issue... checking it out. https://gist.github.com/waitman/c51ea08ebb6a2898f33f client gives up and never opens PSM channel 17 or 19 I did notice some clients request 0x1200 'pnp info' so I added SDP_SERVICE_CLASS_PNP_DEVICE handler to sdpd to see what would happen. The code is here -> https://github.com/waitman/sdpd/blob/master/pnp.c But the configuration parameters should be set by the request, not hardcoded into pnp.c (also hid.c should be fixed) -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 06:46:02 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 DC594BBD for ; Mon, 23 Mar 2015 06:46:01 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::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 63FB075F for ; Mon, 23 Mar 2015 06:46:01 +0000 (UTC) Received: by wixw10 with SMTP id w10so29040805wix.0 for ; Sun, 22 Mar 2015 23:45:59 -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=6i2e9JzZuFmloBxYv+2NP0aVN8LS/WBFW7HXGOuvTxI=; b=JXTEx0PC2yYatk4N3iLDxrjDRoqY3WgHv4/8OlWw56oQEYUCrxNmiEAZWENbxQYuYP bMyhzOOilmLa7eCbf1lLrUfBFYIkHYQX1Xmh31OzN5OWApeZDXjndWAjTiWWeUwUhnkJ i6lIuM+UBDFk0cwObfiUUU4RqTa6S1T8+j/zoyld2BawPId3/zrxr58w7tYXFZgI0NTh ldGfRibq6HZlfRtXqEi0o4W/LapXbwMJzL9Uu0DI9tNHt6fghmjcfr74a685haOwdgKU Ed5JMG1OMqebBGIZJ0uKF1eCzTYmohzZArjaCycTZwndP8vZt+JK6sIGyF4WsdIWGEoM D1tg== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr185719383wjd.134.1427093159652; Sun, 22 Mar 2015 23:45:59 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 22 Mar 2015 23:45:59 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Sun, 22 Mar 2015 23:45:59 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 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: Mon, 23 Mar 2015 06:46:02 -0000 On Sun, Mar 22, 2015 at 10:39 PM, Waitman Gobble wrote: > On Tue, Mar 17, 2015 at 11:33 AM, Maksim Yevmenkin > wrote: >> On Tue, Mar 17, 2015 at 11:20 AM, Iain Hibbert wrote: >>> On Tue, 17 Mar 2015, Waitman Gobble wrote: >>> >>>> hcidump log https://gist.github.com/waitman/c3f8a3bc9b046e36dbb5 >>> >>> Kind of unrelatedly, from that log, the Linux machine requests a search >>> for Protocol UUID 0x0100 (L2CAP) but gets nothing in return.. >>> >>>> ACL data: handle 0x0048 flags 0x02 dlen 24 >>> L2CAP(d): cid 0x44 len 20 [psm 1] >>> SDP SSA Req: tid 0x0 len 0xf >>> pat uuid-16 0x0100 (L2CAP) >>> max 0xffff >>> aid(s) 0x0000 - 0xffff >>> cont 00 >>> < ACL data: handle 0x0048 flags 0x02 dlen 15 >>> L2CAP(d): cid 0x40 len 11 [psm 1] >>> SDP SSA Rsp: tid 0x0 len 0x6 >>> cnt 0x3 >>> cont 00 >>> >>> ..does the SDP server not return results for that, Max? >> >> well, i don't think i ever got around to adding a feature that looks >> for uuid inside records. it currently only matches service class >> uuid's. so, yes, query for l2cap uuid will return nothing currently. >> its trivial to add this though. i think i even have a patch somewhere. >> >> [...] >> >>> btw .. if you use sdpcontrol(1) to query the local SDP server (see -l) >>> then hcidump will not see anything of the interchange, since it does not >>> go through the Bluetooth stack. >> >> absolutely correct >> >> thanks, >> max > > > I'm tracking down a client connection problem, maybe this is causing > the issue... checking it out. > > https://gist.github.com/waitman/c51ea08ebb6a2898f33f > > client gives up and never opens PSM channel 17 or 19 > > I did notice some clients request 0x1200 'pnp info' so I added > SDP_SERVICE_CLASS_PNP_DEVICE handler to sdpd to see what would happen. > The code is here -> https://github.com/waitman/sdpd/blob/master/pnp.c > But the configuration parameters should be set by the request, not > hardcoded into pnp.c (also hid.c should be fixed) > > > > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 Through trial and error I found that this code is preventing the response to the 0x0100 (L2CAP) query. in sdpd/ssar.c around line 230 or so. if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) continue; When I comment that code out then it responds to the request with the list of registered and advertised services and my clients then magically connect. A Linux client connecting to the HID service on my FreeBSD machine doesn't seem to care about the empty response, it opens L2CAP 17&19 and works right away. However Android and some other clients fail after the query returns no results. The good news for me is that my clients are connecting to the HID service, the bad news is I don't yet know what I broke to get it working :) Can you please explain the purpose of that code so I can fully understand what I'm commenting out of the provider lookup loop in sdpd/ssar.c ? in the example below, with the code in place, if it makes it past that statement then "cs #" appears in the log, and rsp > 0. If it doesn't make it past the conditional then it does not send "cs #" to the log and rsp size is 0. Note that it looks like there are always two requests, first one has rsp size, second one is zild. However despite the two requests the server never actually sends the list back to the requesting client. Mar 22 23:31:04 afia hcsecd[29896]: Could not find entry for remote bdaddr bc:44:86:13:0f:ff Mar 22 23:31:04 afia sdpd[37406]: SDP_PDU_SERVICE_SEARCH_ATTRIBUTE_REQUEST Mar 22 23:31:04 afia sdpd[37406]: SDP_DATA_SEQ8 Mar 22 23:31:04 afia sdpd[37406]: SDP_DATA_UUID16 type Mar 22 23:31:04 afia sdpd[37406]: 4096 Mar 22 23:31:04 afia sdpd[37406]: p 4096 Mar 22 23:31:04 afia sdpd[37406]: 4097 Mar 22 23:31:04 afia sdpd[37406]: p 4097 Mar 22 23:31:04 afia sdpd[37406]: 4388 Mar 22 23:31:04 afia sdpd[37406]: p 4388 Mar 22 23:31:04 afia sdpd[37406]: 4608 Mar 22 23:31:04 afia sdpd[37406]: p 4608 Mar 22 23:31:04 afia sdpd[37406]: cs 84 Mar 22 23:31:04 afia sdpd[37406]: rsp size 84 Mar 22 23:31:04 afia sdpd[37406]: SDP_PDU_SERVICE_SEARCH_ATTRIBUTE_REQUEST Mar 22 23:31:04 afia sdpd[37406]: SDP_PDU_SERVICE_SEARCH_ATTRIBUTE_REQUEST Mar 22 23:31:04 afia sdpd[37406]: SDP_DATA_SEQ8 Mar 22 23:31:04 afia sdpd[37406]: SDP_DATA_UUID16 type Mar 22 23:31:04 afia sdpd[37406]: 4096 Mar 22 23:31:04 afia sdpd[37406]: p 4096 Mar 22 23:31:04 afia sdpd[37406]: 4097 Mar 22 23:31:04 afia sdpd[37406]: p 4097 Mar 22 23:31:04 afia sdpd[37406]: 4388 (0x1124 HID) Mar 22 23:31:04 afia sdpd[37406]: p 4388 Mar 22 23:31:04 afia sdpd[37406]: 4608 Mar 22 23:31:04 afia sdpd[37406]: p 4608 (0x1200 PNP) Mar 22 23:31:04 afia sdpd[37406]: rsp size 0 Mar 22 23:31:04 afia sdpd[37406]: SDP_PDU_SERVICE_SEARCH_ATTRIBUTE_REQUEST Thank you, -- Waitman Gobble Los Altos, California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 07:06:18 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 4F0A4FC4 for ; Mon, 23 Mar 2015 07:06:18 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:c:538::198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2E4D908 for ; Mon, 23 Mar 2015 07:06:17 +0000 (UTC) Received: from mfilter24-d.gandi.net (mfilter24-d.gandi.net [217.70.178.152]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 4F0CFFB8A7 for ; Mon, 23 Mar 2015 08:06:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter24-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter24-d.gandi.net (mfilter24-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id ucY0PMxAt74N for ; Mon, 23 Mar 2015 08:06:13 +0100 (CET) X-Originating-IP: 81.168.1.155 Received: from galant.ogmig.net (unknown [81.168.1.155]) (Authenticated sender: plunky@ogmig.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id BD856FB87F for ; Mon, 23 Mar 2015 08:06:13 +0100 (CET) Received: by galant.ogmig.net (Postfix, from userid 1000) id 23D062600C5; Mon, 23 Mar 2015 07:06:12 +0000 (GMT) Date: Mon, 23 Mar 2015 07:06:12 +0000 (GMT) From: Iain Hibbert To: "freebsd-bluetooth@freebsd.org" Subject: Re: register HID with SDP error In-Reply-To: Message-ID: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> User-Agent: Alpine 2.11 (NEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Mon, 23 Mar 2015 07:06:18 -0000 On Sun, 22 Mar 2015, Waitman Gobble wrote: > >> btw .. if you use sdpcontrol(1) to query the local SDP server (see -l) > >> then hcidump will not see anything of the interchange, since it does not > >> go through the Bluetooth stack. > > > > absolutely correct > > I'm tracking down a client connection problem, maybe this is causing > the issue... I doubt that is causing anything, exactly > checking it out. > > https://gist.github.com/waitman/c51ea08ebb6a2898f33f > > client gives up and never opens PSM channel 17 or 19 you didn't say what client it is, and why it should try to connect to HID? Not all will, of course.. It may be more pertinient that when it searches for L2CAP, it did not discover any services? Searching for L2CAP is a lazy way to enumerate services, as many devices failed to provide a proper browse group, but if a device is looking for HID then I would expect it to search for HID? > I did notice some clients request 0x1200 'pnp info' so I added > SDP_SERVICE_CLASS_PNP_DEVICE handler to sdpd to see what would happen. > The code is here -> https://github.com/waitman/sdpd/blob/master/pnp.c > But the configuration parameters should be set by the request, not > hardcoded into pnp.c (also hid.c should be fixed) The PNP Info can be useful, I use it for example (on NetBSD) to get the product and vendor IDs in order to match a specific driver for the Apple Magic Mouse, rather than the generic Bluetooth HID mouse driver. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 07:10:37 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 8BD7E11A for ; Mon, 23 Mar 2015 07:10:37 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:c:538::197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 489569BE for ; Mon, 23 Mar 2015 07:10:37 +0000 (UTC) Received: from mfilter30-d.gandi.net (mfilter30-d.gandi.net [217.70.178.161]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 5D6DD41C06C; Mon, 23 Mar 2015 08:10:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter30-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter30-d.gandi.net (mfilter30-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id I6z0akOX8uva; Mon, 23 Mar 2015 08:10:34 +0100 (CET) X-Originating-IP: 81.168.1.155 Received: from galant.ogmig.net (unknown [81.168.1.155]) (Authenticated sender: plunky@ogmig.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id EBBA741C073; Mon, 23 Mar 2015 08:10:33 +0100 (CET) Received: by galant.ogmig.net (Postfix, from userid 1000) id EC1D22600C5; Mon, 23 Mar 2015 07:10:32 +0000 (GMT) Date: Mon, 23 Mar 2015 07:10:32 +0000 (GMT) From: Iain Hibbert To: Chris H Subject: Re: Does FreeBSD's bluetooth support more than mice/keyboards? In-Reply-To: <9093a3feff3d3d0f1b679ba9160da464@ultimatedns.net> Message-ID: References: <73b93d8629cca8eef3911b4f6a67f14f@ultimatedns.net> <9093a3feff3d3d0f1b679ba9160da464@ultimatedns.net> User-Agent: Alpine 2.11 (NEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-bluetooth@freebsd.org 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: Mon, 23 Mar 2015 07:10:37 -0000 On Sun, 22 Mar 2015, Chris H wrote: > This dongle works perfectly on OSX (I can pair). But > I'm coming up empty handed on FreeBSD. I'm running > (depending on the box) RELENG_9, or CURRENT (11). perhaps you need to specify a PIN at the FreeBSD side..? (see hcsecd.conf(5)) > What more must I do, or is it even possible on FreeBSD? also, what service do you wish to provide? AFAIK none are built in, but obexapp is available in ports (comms/obexapp) which can provide file transfer/object push services. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 07:25:50 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 A443141E for ; Mon, 23 Mar 2015 07:25:50 +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 2547DADE for ; Mon, 23 Mar 2015 07:25:50 +0000 (UTC) Received: by wegp1 with SMTP id p1so130187627weg.1 for ; Mon, 23 Mar 2015 00:25:48 -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=hcOKYri2xX4XfQOGiCBuYHZ9RJI4cFHpLy6vgC1MZt4=; b=oSOYNLbn7Kd/qOzbEbkyKxt4jIuXwUuH5R3xTR50V6+Muf3TaECbkT8f/u5y8kaAV0 3BREjGarKCG5WhZ652rVnNV7OTtA356F99s3uytxjlw3uc/tH1mzbe9oqYwyuOQjDeVf zG7IFVNGbLbxub8Ch4g8LyDdjqbrJp5Nxcr9rgwWHKgL1JsiCfD55Qa3hIIqBniE6dMZ JorHijDNhPkoobCkRE78U8wPdlUhnDhawDWVFVouEcc5T3nCnHsgorKlGag7FvwXo6rv sueKtTzSiM4HKr3aG5zUPShRf5LTVkzLqZrahxfSvBJizgV4I5v+hNtKTJzM9SYC3fC0 BIWw== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr185988230wjd.134.1427095548593; Mon, 23 Mar 2015 00:25:48 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Mon, 23 Mar 2015 00:25:48 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Mon, 23 Mar 2015 00:25:48 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Mon, 23 Mar 2015 00:25:48 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-bluetooth@freebsd.org 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: Mon, 23 Mar 2015 07:25:50 -0000 On Mar 23, 2015 12:06 AM, "Iain Hibbert" wrote: > > On Sun, 22 Mar 2015, Waitman Gobble wrote: > > > >> btw .. if you use sdpcontrol(1) to query the local SDP server (see -l) > > >> then hcidump will not see anything of the interchange, since it does not > > >> go through the Bluetooth stack. > > > > > > absolutely correct > > > > I'm tracking down a client connection problem, maybe this is causing > > the issue... > > I doubt that is causing anything, exactly > > > checking it out. > > > > https://gist.github.com/waitman/c51ea08ebb6a2898f33f > > > > client gives up and never opens PSM channel 17 or 19 > > you didn't say what client it is, and why it should try to connect to HID? > Not all will, of course.. It may be more pertinient that when it searches > for L2CAP, it did not discover any services? Searching for L2CAP is a lazy > way to enumerate services, as many devices failed to provide a proper > browse group, but if a device is looking for HID then I would expect it to > search for HID? Yes, it may be lazy perhaps. However, I have noticed that when the l2cap query results are returned (see my note about commenting out a line if code to get a response sent back).. then it starts working as HID keyboard on android phone, Windows installs a device driver and registers as keyboard, and mac os x comes up with a message about unrecognized keyboard, and closes both PSM connections. (i was faking an apple keyboard which is risky when actually connecting to an apple computer i suppose. I need to work that out) without the reaoonse to the l2cap query, the virtual HID shows up on these devices as a keyboard, and after pairing the connection is stopped before ever opening psm channel 17 or 19 Thank you. > > > I did notice some clients request 0x1200 'pnp info' so I added > > SDP_SERVICE_CLASS_PNP_DEVICE handler to sdpd to see what would happen. > > The code is here -> https://github.com/waitman/sdpd/blob/master/pnp.c > > But the configuration parameters should be set by the request, not > > hardcoded into pnp.c (also hid.c should be fixed) > > The PNP Info can be useful, I use it for example (on NetBSD) to get the > product and vendor IDs in order to match a specific driver for the Apple > Magic Mouse, rather than the generic Bluetooth HID mouse driver. > > regards, > iain > _______________________________________________ > freebsd-bluetooth@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth > To unsubscribe, send any mail to " freebsd-bluetooth-unsubscribe@freebsd.org" From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 07:42:45 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 CEABB780 for ; Mon, 23 Mar 2015 07:42:45 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:c:538::195]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C44D17 for ; Mon, 23 Mar 2015 07:42:45 +0000 (UTC) Received: from mfilter2-d.gandi.net (mfilter2-d.gandi.net [217.70.178.140]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 661ADA80CE; Mon, 23 Mar 2015 08:42:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter2-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter2-d.gandi.net (mfilter2-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 6FfGBZ8ezwat; Mon, 23 Mar 2015 08:42:41 +0100 (CET) X-Originating-IP: 81.168.1.155 Received: from galant.ogmig.net (unknown [81.168.1.155]) (Authenticated sender: plunky@ogmig.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A67A7A80D5; Mon, 23 Mar 2015 08:42:41 +0100 (CET) Received: by galant.ogmig.net (Postfix, from userid 1000) id D32922600C5; Mon, 23 Mar 2015 07:42:40 +0000 (GMT) Date: Mon, 23 Mar 2015 07:42:40 +0000 (GMT) From: Iain Hibbert To: Waitman Gobble Subject: Re: register HID with SDP error In-Reply-To: Message-ID: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> User-Agent: Alpine 2.11 (NEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "freebsd-bluetooth@freebsd.org" 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: Mon, 23 Mar 2015 07:42:45 -0000 On Sun, 22 Mar 2015, Waitman Gobble wrote: > Through trial and error I found that this code is preventing the > response to the 0x0100 (L2CAP) query. > > in sdpd/ssar.c around line 230 or so. > > if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && > memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) > continue; > > > When I comment that code out then it responds to the request with the > list of registered and advertised services and my clients then > magically connect. and if you search for some other protocol UUID that is perhaps not present? I suspect that without that code, you will get all profiles back, whatever you search for (which is going to be wrong :) the real problem is, that sdpd does not enumerate the Protocol UUIDs in each profile that it has stored, and therefore cannot respond properly to the request for 'all records containing UUID 0x0100' for example. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 23 08:01:57 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 C1A22C1F for ; Mon, 23 Mar 2015 08:01:57 +0000 (UTC) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (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 47111F28 for ; Mon, 23 Mar 2015 08:01:57 +0000 (UTC) Received: by wetk59 with SMTP id k59so130871363wet.3 for ; Mon, 23 Mar 2015 01:01:55 -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=ZqhQZTsLMlu0w0owFoeOAsjONLV7kPWmzrxMMJhHxak=; b=WYDniXQRkj9GXtvVhhEnY1TYqRi4OMC+aDFsbhghROaHgNThhLZoApLfv6v9n16gFr hlLd2CEGfk6gbIHs04gjikIHpnlqOfO3iuqMeqf6yPesV6wmdhlAHaMndAF/YeLCK4o+ 9TFI4bg61M4DRnFqSIrMd1IVxrFnN5CFdvqF9f3mpX9N1q3EyV7NeeGFNiZ9wY3Rdn/G izneie6a3s/GXy9Xh85NoZZLFFAcCr3n66v6XnjG+94kaSbUgpUm7FtKBGzng4UzbUV7 yIy6XqTlVGxeURdxIsVm5MShC7jGp569db58Ljy1GHqgtLqJdENIronH/O//kdp4dxNE QBFg== MIME-Version: 1.0 X-Received: by 10.180.104.35 with SMTP id gb3mr17057692wib.60.1427097715775; Mon, 23 Mar 2015 01:01:55 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Mon, 23 Mar 2015 01:01:55 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Mon, 23 Mar 2015 01:01:55 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Mon, 23 Mar 2015 01:01:55 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-bluetooth@freebsd.org 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: Mon, 23 Mar 2015 08:01:57 -0000 On Mar 23, 2015 12:42 AM, "Iain Hibbert" wrote: > > On Sun, 22 Mar 2015, Waitman Gobble wrote: > > > Through trial and error I found that this code is preventing the > > response to the 0x0100 (L2CAP) query. > > > > in sdpd/ssar.c around line 230 or so. > > > > if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && > > memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) > > continue; > > > > > > When I comment that code out then it responds to the request with the > > list of registered and advertised services and my clients then > > magically connect. > > and if you search for some other protocol UUID that is perhaps not > present? I suspect that without that code, you will get all profiles > back, whatever you search for (which is going to be wrong :) > > the real problem is, that sdpd does not enumerate the Protocol UUIDs in > each profile that it has stored, and therefore cannot respond properly to > the request for 'all records containing UUID 0x0100' for example. > > regards, > iain Thank you, I appreciate the info. I'm thinking it's probably not causing issues for most people at the moment, however I am going to have to make it work on my system, because apparently Android, OS X and MS Windows all seem to depend on those results in order to properly open the connection to an HID device. It could potentially be an issue if using the GATT protocols with embedded ARM, etc, devices running FreeBSD which I presume will happen someday. (But it does seem like alot of people these days are popping out devices running proprietary software mixed in with GPLv3 code *a hunch* and not even thinking about it, which can possibly turn into an interesting legal mess. Will have to get some popcorn and watch.) Thanks, Waitman From owner-freebsd-bluetooth@FreeBSD.ORG Wed Mar 25 03:10:51 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 B4690766 for ; Wed, 25 Mar 2015 03:10:51 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (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 3CE4F818 for ; Wed, 25 Mar 2015 03:10:51 +0000 (UTC) Received: by wibbg6 with SMTP id bg6so7018753wib.0 for ; Tue, 24 Mar 2015 20:10:49 -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=R9eebD1ect34dxScOMKkmO3c9OGmmsCfwYHlm1AiDjc=; b=ol3aafGM62cRhTTzf/Bbn2YMh2a13e3dCzxW7aH1SqoQzRnR8KcrDO+K6I/FDR/qkY AabzyQVUp+8FWYFdLjO2IjocUqxqo74+v81x11CEB5j0U2LEPcDdyYhdm0OqjO2zqtRU qkMILj1wEtn0knmXTVBkyfzuKR0Hm4lpyuzGeVpF0SKFUgDLRBBrXSvR4fc3BmaUvulQ yrsVlbptDTR0yFKYenxwbO9qO6Q1jZl4M5vRU1FypnK9imvE6aU0wltdOMswI+EN3bkh MULXYMfUedrM4kkkSNc9jhOHKBg6ba6I1j3oY+ta6GEODgmjDI6Wcx/7M6+MOgszM0+R 84Aw== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr13963450wjd.134.1427253049471; Tue, 24 Mar 2015 20:10:49 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Tue, 24 Mar 2015 20:10:49 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Tue, 24 Mar 2015 20:10:49 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" 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: Wed, 25 Mar 2015 03:10:51 -0000 >> I did notice some clients request 0x1200 'pnp info' so I added >> SDP_SERVICE_CLASS_PNP_DEVICE handler to sdpd to see what would happen. >> The code is here -> https://github.com/waitman/sdpd/blob/master/pnp.c >> But the configuration parameters should be set by the request, not >> hardcoded into pnp.c (also hid.c should be fixed) > > The PNP Info can be useful, I use it for example (on NetBSD) to get the > product and vendor IDs in order to match a specific driver for the Apple > Magic Mouse, rather than the generic Bluetooth HID mouse driver. > > regards, > iain > _______________________________________________ > freebsd-bluetooth@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth > To unsubscribe, send any mail to "freebsd-bluetooth-unsubscribe@freebsd.org" I updated the PNP code so the info is set by the register function. It's totally not monumental, but it was annoying to me that clients were 'asking for it' and not getting a response. There is an issue is that this software presumes it's the only thing on the device. 'primary'. that's a TODO. Fine now, when things become more complicated it will need to be addressed. https://github.com/waitman/sdpd/blob/master/pnp.c to set up a PNP profile on the SDP server, (at this moment these are not defined in sdp.h) #define SDP_SERVICE_CLASS_PNP_DEVICE 0x1200 struct sdp_pnp_profile { uint8_t authority; /* 0x1 or 0x2 */ uint16_t vendor_id; uint16_t product_id; uint16_t product_version; uint16_t bt_version; }; typedef struct sdp_pnp_profile sdp_pnp_profile_t; sdp_pnp_profile_t pnp; memset(&pnp, 0, sizeof(pnp)); pnp.authority = 0x1; /* where your got your mfg number. 0x1 Bluetooth SIG, 0x2 USB */ pnp.vendor_id = 0x05ac; /* your assigned vendor ID. this one for TEST only */ pnp.product_id = 0x0239; /* your product ID. this one for TEST only */ pnp.product_version = 0x050; /* the version of your product. this one for TEST only */ pnp.bt_version = 0x0102; /* bt v1.2 example */ if (sdp_register_service(ss, SDP_SERVICE_CLASS_PNP_DEVICE, &bt_addr_any, (void *)&pnp, sizeof(pnp), &sdp_handle) != 0) { /* there's an error */ } -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Wed Mar 25 15:16:30 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 7ED8FD94 for ; Wed, 25 Mar 2015 15:16:30 +0000 (UTC) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (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 36BED2AA for ; Wed, 25 Mar 2015 15:16:30 +0000 (UTC) Received: by igcxg11 with SMTP id xg11so28366556igc.0 for ; Wed, 25 Mar 2015 08:16:29 -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=kPgaWOyY+T1MsoLboM4NXK7UeSx/CkX1PsURgOG06x0=; b=WL5sxKvM9pxA9+VrOtSM5nsY0m4ESQ5SZNj21AyO8JkCEcyhCDLC/nc4GHjpXx2jzQ Nzhe3mZE4cmqgelGUUm3DtJQZJwq+RLuKgXVepZv0OacnqBuXTWnCHbTX+P4755DZ+ir NYWhRAQrIr1rWIrzh/xuLkzunAg0MKU4H7MZAInrllbwrj7NckJL6UX/WFZEKTIwfz1V 8Kh3IvoztCUwqqbU9RQzhvYGu6j2VAdbx5taMBSqti7eAfOtHqeYXN6vSoyNaqjkSkJW mlSi8uC8+eJ6RXOFtYL2wvV2I7acBNJ8H/V6I5gXcdUyg27WrGq4Ewc3i/3KuZUwDJZE nTag== MIME-Version: 1.0 X-Received: by 10.42.89.200 with SMTP id h8mr18365126icm.48.1427296589647; Wed, 25 Mar 2015 08:16:29 -0700 (PDT) Received: by 10.36.66.74 with HTTP; Wed, 25 Mar 2015 08:16:29 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 25 Mar 2015 08:16:29 -0700 Message-ID: Subject: Re: register HID with SDP error From: Maksim Yevmenkin To: Waitman Gobble Content-Type: text/plain; charset=UTF-8 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: Wed, 25 Mar 2015 15:16:30 -0000 Hello, sorry for the delay... > Through trial and error I found that this code is preventing the > response to the 0x0100 (L2CAP) query. > > in sdpd/ssar.c around line 230 or so. > > if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && > memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) > continue; right. this is to match uuid from the request with the uuid of registered services, or, special case, uuid for public browse group that is expected to return everything that is public. > When I comment that code out then it responds to the request with the > list of registered and advertised services and my clients then > magically connect. well, that's plain just wrong. you completely disabled any filtering. basically request for any uuid will return everything. including things that client has not asked for. the correct way is to add a list of addition uuid's (such as l2cap uuid) to every profile that should be checked as well. when client makes request for l2cap uuid it effectively asking to give back everything that "runs over l2cap". > Can you please explain the purpose of that code so I can fully > understand what I'm commenting out of the provider lookup loop in > sdpd/ssar.c ? please read above. also please read SDP spec, particularly part that talks about Service Search Request and Service Search Attribute Request. thanks max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Mar 25 15:21:42 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 D7F3B9E for ; Wed, 25 Mar 2015 15:21:42 +0000 (UTC) Received: from mail-ie0-x229.google.com (mail-ie0-x229.google.com [IPv6:2607:f8b0:4001:c03::229]) (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 9C6433CD for ; Wed, 25 Mar 2015 15:21:42 +0000 (UTC) Received: by iedm5 with SMTP id m5so24574721ied.3 for ; Wed, 25 Mar 2015 08:21:41 -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=0e8gTJpR+ueWXxKSEtfV+7+o3oYCH1CU7ILfe1fxpwg=; b=lpkExphgqc/Vx72VoS+XOPv+7/A2xQjWtsjYDZZGSuczcc0W0d5Aoo01ZyNAPjcrIV 8tbLQnUGoUTWvB7Ixxxrvgk4qLB7FrZegvriB4yu8lUOuxoVaPfggDcTTd24S1HQrel/ IYKughOnYDgz5CRAk2ZMP7dnbUW62maXQbWKoS+PZ77oeSs0HX6aekf0q9EIu973xO9l K+VOX+Hl0NcqQdFGRS1nyUjHBfy5W3dq6OCiT/exp2xpEjFtCVqwOPF01EhAlaxMkK42 d8U9+xnQvA17hT6bI+NiFpRvAbNHBX48XnixOWtrvl8SOVzXhf4ahDPDseQAz7pXU+k2 hKMQ== MIME-Version: 1.0 X-Received: by 10.42.89.200 with SMTP id h8mr18393427icm.48.1427296899965; Wed, 25 Mar 2015 08:21:39 -0700 (PDT) Received: by 10.36.66.74 with HTTP; Wed, 25 Mar 2015 08:21:39 -0700 (PDT) In-Reply-To: References: <73b93d8629cca8eef3911b4f6a67f14f@ultimatedns.net> <9093a3feff3d3d0f1b679ba9160da464@ultimatedns.net> Date: Wed, 25 Mar 2015 08:21:39 -0700 Message-ID: Subject: Re: Does FreeBSD's bluetooth support more than mice/keyboards? From: Maksim Yevmenkin To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" 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: Wed, 25 Mar 2015 15:21:42 -0000 On Mon, Mar 23, 2015 at 12:10 AM, Iain Hibbert wrote: > On Sun, 22 Mar 2015, Chris H wrote: > >> This dongle works perfectly on OSX (I can pair). But >> I'm coming up empty handed on FreeBSD. I'm running >> (depending on the box) RELENG_9, or CURRENT (11). > > perhaps you need to specify a PIN at the FreeBSD side..? (see > hcsecd.conf(5)) yes, thanks Iain! :) also https://www.freebsd.org/doc/handbook/network-bluetooth.html is always a good place to start >> What more must I do, or is it even possible on FreeBSD? > > also, what service do you wish to provide? AFAIK none are built in, but > obexapp is available in ports (comms/obexapp) which can provide file > transfer/object push services. well, not quite. there are a number of daemons that implement a handful of services: serial port, dun, lan, pan. and, yes. ports tree has obexapp too :) thanks max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Mar 25 15:46:43 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 6E745F71 for ; Wed, 25 Mar 2015 15:46:43 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (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 EE59392C for ; Wed, 25 Mar 2015 15:46:42 +0000 (UTC) Received: by wgs2 with SMTP id 2so32605183wgs.1 for ; Wed, 25 Mar 2015 08:46:41 -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=KJpKyuCWRe/pRtdNmMxYDhn/q0e/I87XwlA1iwf2nB0=; b=m5B2Ac6PPmWeiCMq6RwOC62oxdqV4l3yLoIj7FT7qshDum4HC/MdVjgxBUvkDynqCq Ny2YVcsuGuv9NCNPdpSOT3/mdYV7W+Vx9wYm2l1ue+hY+atbtWlMClmq4R+KqXFkX8Kz CE+gedKq1+IFdMpA00L4vVZQH+ADFzz5M9BFk/s2Lm+EkAkk7ke04W+wPpPSuvVeEg6q 5gyyUUfMV1469ZtF5ZiRTdHMpiJUqbPsvWM3UymlA9WhpxicueLHxeNo9HOX4cgMqpMK V9taPP60ZutcBW79Cvp+vR1krkSVKl7W6uOrLDxlXDB+0zVMEPAHGXeJRSbLhtWfWtcD yiXA== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr19700714wjd.134.1427298401335; Wed, 25 Mar 2015 08:46:41 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 25 Mar 2015 08:46:41 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 25 Mar 2015 08:46:41 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 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: Wed, 25 Mar 2015 15:46:43 -0000 On Wed, Mar 25, 2015 at 8:16 AM, Maksim Yevmenkin wrote: > Hello, > > sorry for the delay... > >> Through trial and error I found that this code is preventing the >> response to the 0x0100 (L2CAP) query. >> >> in sdpd/ssar.c around line 230 or so. >> >> if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && >> memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) >> continue; > > right. this is to match uuid from the request with the uuid of > registered services, or, special case, uuid for public browse group > that is expected to return everything that is public. > >> When I comment that code out then it responds to the request with the >> list of registered and advertised services and my clients then >> magically connect. > > well, that's plain just wrong. you completely disabled any filtering. > basically request for any uuid will return everything. including > things that client has not asked for. the correct way is to add a list > of addition uuid's (such as l2cap uuid) to every profile that should > be checked as well. when client makes request for l2cap uuid it > effectively asking to give back everything that "runs over l2cap". > >> Can you please explain the purpose of that code so I can fully >> understand what I'm commenting out of the provider lookup loop in >> sdpd/ssar.c ? > > please read above. also please read SDP spec, particularly part that > talks about Service Search Request and Service Search Attribute > Request. > > thanks > max Thanks Max, I appreciate your reply and helpful information. I will experiment and see if I can get this right. -- Waitman Gobble Los Altos California USA 510-830-7975