From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 30 03:48:17 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 C92B4F99 for ; Mon, 30 Mar 2015 03:48:17 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::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 4DFC3880 for ; Mon, 30 Mar 2015 03:48:17 +0000 (UTC) Received: by wiaa2 with SMTP id a2so108905486wia.0 for ; Sun, 29 Mar 2015 20:48:15 -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=3/g3mpUlyDEIPfzDkvlz1j3G39dSATQMLKhG4CCw/pA=; b=IYdG+jdRTFUm/VuuL5AT04c4ScDVcBCv1fyL0A9v/U+BgNtKlnUE9pTfWHcYEPw2Ek 4cSxuTkMEyBlBn3iN0WlZdvgvY/cdMJr8ShnNJZ8OHZuMnrjAG3nSrBZVU5oELH/I5vo AaoyG1J+8LuvNA2cgnca1FuhDX2gJuqfOKkX9ylmaIQ/VSfHsRWyjb/2NA26HQE1mJjP X7vbxhaJOF4W8Q0nqVWcX7MApCSt9kL2fdhCzOpUuk9k+W6KOhMyLR9h8MSCiMOf3ZdJ QTs+jRQzE8SAxRN5hvMhyfsONI8yRp36le8ri5sRtkLigMfKkPc97xM9FOHmQInJa3m6 QRVg== MIME-Version: 1.0 X-Received: by 10.180.77.40 with SMTP id p8mr17813199wiw.1.1427687295879; Sun, 29 Mar 2015 20:48:15 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Sun, 29 Mar 2015 20:48:15 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Sun, 29 Mar 2015 20:48:15 -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, 30 Mar 2015 03:48:17 -0000 On Wed, Mar 25, 2015 at 8:46 AM, Waitman Gobble wrote: > 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 Hi, I'm not sure I'm getting it right.. in ssar.c, if the uuid query is L2CAP 0x0100 i set dol2capquery = 1; /* * Service Search Attribute Response format * * value16 - 2 bytes AttributeListByteCount (not incl.) * seq8 len16 - 3 bytes * attr list - 3+ bytes AttributeLists * [ attr list ] */ ptr = rsp + 3; while (ssplen > 0) { SDP_GET8(type, sspptr); ssplen --; switch (type) { case SDP_DATA_UUID16: if (ssplen < 2) return (SDP_ERROR_CODE_INVALID_REQUEST_SYNTAX); memcpy(&uuid, &uuid_base, sizeof(uuid)); uuid.b[2] = *sspptr ++; uuid.b[3] = *sspptr ++; if ((uuid.b[2]==1) && (uuid.b[3]==0)) //0x0100 { dol2capquery = 1; } ssplen -= 2; break; Then while iterating through provider list, if the uuid matches something with l2cap then it sends back the response with those records. I don't think this should be 'hardcoded' in this way, but at the moment I'm tinkering. for (provider = provider_get_first(); provider != NULL; provider = provider_get_next(provider)) { if (!provider_match_bdaddr(provider, &srv->req_sa.l2cap_bdaddr)) continue; memcpy(&puuid, &uuid_base, sizeof(puuid)); puuid.b[2] = provider->profile->uuid >> 8; puuid.b[3] = provider->profile->uuid; if (dol2capquery) { switch (provider->profile->uuid) { case 0x1124: /* HID */ case 0x1200: /* PNP */ break; default: continue; break; } } else { if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) continue; } My client is still connecting to PSM channels, but I'm seeing syntax errors https://gist.github.com/waitman/811e4dde41bfefd32054 So I'm wondering if i'm supposed to send the whole record or maybe just matching aids... Also just in case someone reading mailing list messages needs a way to associate BDADDR with 'previously negotiated human identification numbers' instead of hard config-file pins, I added a "BRIG" mode to hcsecd. As an example, you might want 1000 clients to pair and you wish to associate the BDADDR with a phone number or some other number the people know exclusively and can remember. # printf "5108307975" > /tmp/brig.txt Then the person pairs using their phone number. The tmp file is removed by hcsecd after use. This isn't something you'd want to set up a long time before pairing. But, like the person doing the pairing is standing there and is ready to pair. Then you can build an index of BDADDR with human id's which can be used later when either continuous scanning of devices and/or pairing from a database. https://github.com/waitman/hcsecd Thank you, -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 30 14:35:46 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 5F87E667 for ; Mon, 30 Mar 2015 14:35:46 +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 0D6D5B7D for ; Mon, 30 Mar 2015 14:35:45 +0000 (UTC) Received: from mfilter28-d.gandi.net (mfilter28-d.gandi.net [217.70.178.159]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 0CD7FFB87F for ; Mon, 30 Mar 2015 16:35:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter28-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter28-d.gandi.net (mfilter28-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 8uF2ySeBjg-m for ; Mon, 30 Mar 2015 16:35:41 +0200 (CEST) X-Originating-IP: 31.68.198.229 Received: from galant.ogmig.net (unknown [31.68.198.229]) (Authenticated sender: plunky@ogmig.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 99499FB8D2 for ; Mon, 30 Mar 2015 16:35:39 +0200 (CEST) Received: by galant.ogmig.net (Postfix, from userid 1000) id 7B5912600C5; Mon, 30 Mar 2015 15:35:29 +0100 (BST) Date: Mon, 30 Mar 2015 15:35:29 +0100 (BST) 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, 30 Mar 2015 14:35:46 -0000 On Sun, 29 Mar 2015, Waitman Gobble wrote: > I'm not sure I'm getting it right.. > > in ssar.c, if the uuid query is L2CAP 0x0100 i set dol2capquery = 1; probably not, if you do it like that :) > if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && > memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) my advice is to change this match (in ssr.c and ssar.c), to use an array of profile UUIDs, so that you can add all the UUIDs for the indivudal profiles. > My client is still connecting to PSM channels, but I'm seeing syntax errors > > https://gist.github.com/waitman/811e4dde41bfefd32054 > > So I'm wondering if i'm supposed to send the whole record or maybe > just matching aids... you are only supposed to send requested AIDs but I don't think your syntax error is that.. perhaps you got the length of the string wrong, or the sequence? Without the raw data its difficult to tell.. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 30 14:58:18 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 5A69FA40 for ; Mon, 30 Mar 2015 14:58:18 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::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 D4BEBDC9 for ; Mon, 30 Mar 2015 14:58:17 +0000 (UTC) Received: by wiaa2 with SMTP id a2so133700825wia.0 for ; Mon, 30 Mar 2015 07:58:16 -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=S/2uuOHIKEsZ8oQuRgEK10XXGSd+EzA1gukrSeCkkwA=; b=xPCnyoEH696nBioA1mFruhFS+zOLuWnLcSVeTlUGO1N2DZCGuUUnsrcmHjSgdwWniO KKW1D6kvH96dulPDU6gPQVSnCzRRnyBbdkxa4BGAKJzO/UXdHaOuIejtsIOSV/eeueJB CeNds5W5s03VdAhQ71+v9Xx0zuhoci6SjsedCEQvfGkXBj2eW4yiG0MUxHMMtDeK4ZMI o9zrzM0WCmjoAmnIFOTo47klnNRicxzSRsvA06sOvYhgqkgwSE3LnuFAq8Rj9I4FCBsg tqmp99a+uA/dRZbAfsWBPzawMT1M+pW6oaQ0wP6pAWgr2vyF4IscCOfSXWJEu+4B9ihU UJQA== MIME-Version: 1.0 X-Received: by 10.180.104.35 with SMTP id gb3mr23380176wib.60.1427727463666; Mon, 30 Mar 2015 07:57:43 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Mon, 30 Mar 2015 07:57:43 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Mon, 30 Mar 2015 07:57:43 -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: Mon, 30 Mar 2015 14:58:18 -0000 On Mon, Mar 30, 2015 at 7:35 AM, Iain Hibbert wrote: > On Sun, 29 Mar 2015, Waitman Gobble wrote: > >> I'm not sure I'm getting it right.. >> >> in ssar.c, if the uuid query is L2CAP 0x0100 i set dol2capquery = 1; > > probably not, if you do it like that :) > >> if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && >> memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) > > my advice is to change this match (in ssr.c and ssar.c), to use an array > of profile UUIDs, so that you can add all the UUIDs for the indivudal > profiles. > >> My client is still connecting to PSM channels, but I'm seeing syntax errors >> >> https://gist.github.com/waitman/811e4dde41bfefd32054 >> >> So I'm wondering if i'm supposed to send the whole record or maybe >> just matching aids... > > you are only supposed to send requested AIDs Iain - Thanks so much for your help on this, ok, so in this loop (sar.c) int32_t server_prepare_attr_list(....) { for (; lo <= hi; lo ++) { len = server_prepare_attr_value_pair(provider, lo, ptr, rsp_end); } } it's going through all the specified aid's. ie, "aid(s) 0x0000 - 0xffff" in the query request: SDP SSA Req: tid 0x0 len 0xf pat uuid-16 0x0100 (L2CAP) max 0xf0 aid(s) 0x0000 - 0xffff cont 00 lo = 0x0000 hi = 0xffff So.. I only want to generate 'server_prepare_attr_value_pair()' based on the query parameters? > > but I don't think your syntax error is that.. perhaps you got the length > of the string wrong, or the sequence? Without the raw data its difficult > to tell.. > > 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" -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 30 15:37:15 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 5FB399ED for ; Mon, 30 Mar 2015 15:37:15 +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 0E55628B for ; Mon, 30 Mar 2015 15:37:15 +0000 (UTC) Received: from mfilter35-d.gandi.net (mfilter35-d.gandi.net [217.70.178.166]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 4777CFB8A7 for ; Mon, 30 Mar 2015 17:37:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter35-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter35-d.gandi.net (mfilter35-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id s7buaD2IwZZv for ; Mon, 30 Mar 2015 17:37:11 +0200 (CEST) X-Originating-IP: 31.68.198.229 Received: from galant.ogmig.net (unknown [31.68.198.229]) (Authenticated sender: plunky@ogmig.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 10683FB8EC for ; Mon, 30 Mar 2015 17:37:09 +0200 (CEST) Received: by galant.ogmig.net (Postfix, from userid 1000) id 6DCC92600C5; Mon, 30 Mar 2015 16:37:01 +0100 (BST) Date: Mon, 30 Mar 2015 16:37:01 +0100 (BST) 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, 30 Mar 2015 15:37:15 -0000 On Mon, 30 Mar 2015, Waitman Gobble wrote: > ok, so in this loop (sar.c) > > int32_t server_prepare_attr_list(....) > { > for (; lo <= hi; lo ++) { > len = server_prepare_attr_value_pair(provider, lo, ptr, rsp_end); > } > } > > it's going through all the specified aid's. ie, "aid(s) 0x0000 - > 0xffff" in the query request: > > SDP SSA Req: tid 0x0 len 0xf > pat uuid-16 0x0100 (L2CAP) > max 0xf0 > aid(s) 0x0000 - 0xffff > cont 00 > > lo = 0x0000 > hi = 0xffff > > So.. I only want to generate 'server_prepare_attr_value_pair()' based > on the query parameters? I think yes, but does that bit not work properly already? (in your example, it asks for all possible Attribute IDs anyway) I thought your problem was that the search for UUID was not working correctly.. that failure is where it selects the records to respond to, because it doesn't select any. The reason for that, is that the FreeBSD sdpd doesn't actually store a record, it relies on there being a single service class (this is a UUID) stored in the profile->uuid field and only looks at that, which is wrong. You will need to change the 'struct profile' to have a list of UUIDs, and the ServiceSearchPattern will contain a list of (up to 12) UUIDs and all must be contained in the profile for it to be a match. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 14:58:39 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 83DDA8CB for ; Wed, 1 Apr 2015 14:58:39 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::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 0ACD49A5 for ; Wed, 1 Apr 2015 14:58:39 +0000 (UTC) Received: by wgbdm7 with SMTP id dm7so56470136wgb.1 for ; Wed, 01 Apr 2015 07:58:37 -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=7FmjXo8ZZ4Ujyk8qpOvGvwn2+XG9IPLt4wAGSyMt82w=; b=aEEw/PY8rQvNzFl9DSDUthesYxajcKhbrI+/i6YQHt0Un5w0w6NHGJEsiL1cJuog+6 qAl2s7s4sVT/636pnpUffuJzhibO7U2NXd0SNL2DyGh82MCfkS37ReTOcYpGa2730lW/ CyGI2dz7xXmZDb4DYM+P9wPOpTv6tFEjKutA5lZ2KgzoQg0jhvj4jAXyTD6EA+qClkXP ynbIwa3rKwtCLK49i+rmMmfI0KnI2G1hx0MG4Ko7xH3HdcIvBPr6izEk+P3GzRna7kNG D+K7rJmAoWTzp1R1LAYnOxejgfUpSArC5EK3rIeJzM/YUDSNYuoHzRRvXbxgAzj91WUL q2mQ== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr86387086wjd.134.1427900317455; Wed, 01 Apr 2015 07:58:37 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 07:58:37 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 1 Apr 2015 07:58:37 -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, 01 Apr 2015 14:58:39 -0000 On Mon, Mar 30, 2015 at 8:37 AM, Iain Hibbert wrote: > On Mon, 30 Mar 2015, Waitman Gobble wrote: > >> ok, so in this loop (sar.c) >> >> int32_t server_prepare_attr_list(....) >> { >> for (; lo <= hi; lo ++) { >> len = server_prepare_attr_value_pair(provider, lo, ptr, rsp_end); >> } >> } >> >> it's going through all the specified aid's. ie, "aid(s) 0x0000 - >> 0xffff" in the query request: >> >> SDP SSA Req: tid 0x0 len 0xf >> pat uuid-16 0x0100 (L2CAP) >> max 0xf0 >> aid(s) 0x0000 - 0xffff >> cont 00 >> >> lo = 0x0000 >> hi = 0xffff >> >> So.. I only want to generate 'server_prepare_attr_value_pair()' based >> on the query parameters? > > I think yes, but does that bit not work properly already? > > (in your example, it asks for all possible Attribute IDs anyway) > > I thought your problem was that the search for UUID was not working > correctly.. that failure is where it selects the records to respond to, > because it doesn't select any. > > The reason for that, is that the FreeBSD sdpd doesn't actually store a > record, it relies on there being a single service class (this is a UUID) > stored in the profile->uuid field and only looks at that, which is wrong. > > You will need to change the 'struct profile' to have a list of UUIDs, and > the ServiceSearchPattern will contain a list of (up to 12) UUIDs and all > must be contained in the profile for it to be a match. > > 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" Can this 'syntax error' problem be related to the requested MTU? with essentially the 'same' connection request, here's the transaction log from an MS Windows client. No syntax errors. The requested MTU is 1024 https://gist.github.com/waitman/2d5a72e9f9544848e832 L2CAP(d): cid 0x40 len 346 [psm 1] and a log from android client. Requested MTU is 256. https://gist.github.com/waitman/e365debcd4a96d849153 L2CAP(d): cid 0x43 len 247 [psm 1] note it's bombing out with something about aid 0x0200, which isn't actually an aid specified in my 0x1124 record. I am very new to Bluetooth and SDP, but I'm wondering if this syntax error problem is 'just' the hcidump program (mis) reporting the 'bump' in packets, and there's not actually any error 'seen' or received by the client. looks like the actual response should be 346 bytes but the android client is demanding 256, so hcidump 'sees' the overrage as syntax error. this line: ERROR: Unexpected syntax 07 35 08 35 06 09 04 09 09 01 00 09 02 0E 28 00 36 00 51 09 00 00 0A 00 00 00 03 09 00 01 35 03 19 12 00 09 00 04 35 0D 35 06 19 01 00 09 00 01 35 03 19 00 01 09 00 09 35 08 35 06 19 12 00 09 01 00 09 02 00 09 01 02 09 02 01 09 05 AC 09 02 02 09 02 39 09 02 03 09 00 50 09 02 04 28 01 09 02 05 08 01 00 looks like the bytes of the SDP response coming in 'mid stream', ie i can see 09 02 0E which is the 0x020e uuid. This error is about 100 bytes, so if the first packet is 247 bytes, that kinda makes sense to me I guess, since the response to the MS client was 347 bytes. Maybe this is actually a "bug" in hcidump, it's 'seeing' the second packet and getting confused. Also, to note that the android client opens up psm 17 & 19 right away and connects, and the HID service on the FreeBSD machine works fine. But the MS Windows machine doesn't ever even try to open PSM 17 or 19. It connects as a keyboard, does it's 'driver download' thing and shows up in the hardware list as a keyboard, but never opens up the PSM channels. Haven't solved that problem yet, but maybe it's not solvable and not actually significant in regards to my system anyway. I've read several reports of people claiming their BT keyboards stopped working on MS Win 8.1 system after some update. Thank you, Waitman -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 15:06:20 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 196ADC41 for ; Wed, 1 Apr 2015 15:06:20 +0000 (UTC) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::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 B6F41AA9 for ; Wed, 1 Apr 2015 15:06:19 +0000 (UTC) Received: by qgh3 with SMTP id 3so44837269qgh.2 for ; Wed, 01 Apr 2015 08:06:19 -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=m50M8DSGmmVzlKoNjyLN59UG+aiGCrdY0ekWdPJ4du4=; b=mSX0xKREyhJGwVJ4wOgyhEatcB0C8DKi5fhmPgDUA+w9flM0lS9Zc2Fikym4FWaujh CI7yTyRgqbdZmPOJwqEfHbZuosfNXMCwOwBlhgTofvgK0hClVYzfiILWRJhPd3gQWePw XI3/RD0zgFLbjd6I3VePscHUWWrBKp1euuDpuWZYSVKMtrBBVK2vo2WDh+ajSwpaR2er 6bL+YEpStOq29tqExfoZdv7wPHbrH1ACOwpaxh5yIn3mwPBcdYy9B7DPNwEKwNnwHJzp 7OFzgO2C/mm2M27qlk6csZUXC98kocnjWfU+H1Dp25d72pX5Hap8MGYVTI0U9glg5IyD 0z7g== MIME-Version: 1.0 X-Received: by 10.140.239.140 with SMTP id k134mr56198405qhc.98.1427900778965; Wed, 01 Apr 2015 08:06:18 -0700 (PDT) Received: by 10.140.138.206 with HTTP; Wed, 1 Apr 2015 08:06:18 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 1 Apr 2015 08:06:18 -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, 01 Apr 2015 15:06:20 -0000 Hello, [...] > Can this 'syntax error' problem be related to the requested MTU? > > with essentially the 'same' connection request, > > here's the transaction log from an MS Windows client. No syntax > errors. The requested MTU is 1024 > > https://gist.github.com/waitman/2d5a72e9f9544848e832 > > L2CAP(d): cid 0x40 len 346 [psm 1] > > > and a log from android client. Requested MTU is 256. > > https://gist.github.com/waitman/e365debcd4a96d849153 > > L2CAP(d): cid 0x43 len 247 [psm 1] > > note it's bombing out with something about aid 0x0200, which isn't > actually an aid specified in my 0x1124 record. just a wild guess. please make sure that you maintain continuation state properly. when sdp response is bigger than l2cap mtu, response is chunked. thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 15:06: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 43EEEC54 for ; Wed, 1 Apr 2015 15:06:24 +0000 (UTC) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (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 E2B98AAC for ; Wed, 1 Apr 2015 15:06:23 +0000 (UTC) Received: by igcau2 with SMTP id au2so50565316igc.0 for ; Wed, 01 Apr 2015 08:05:50 -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=m50M8DSGmmVzlKoNjyLN59UG+aiGCrdY0ekWdPJ4du4=; b=xzwj7SZZ67rPKRB+h/iGEjVPbhV3p9y6xzwfUjqkzVqTMxNK2Q/D4cRRMU7pMo8DNm RmzNPzZBAJ5x5fx8ZlY1RdSQItn59Ax9Ra4lHL6I9FFFr2cr+gFEwjqN5UtRXgNQ8x00 ROurJUBE2SJR1JkBd9OicU1NkKIx7SftnZQz4BYUXzEmQKU4h/djkZpzpTDLGGvo+k2j j3vlzYvCcwAtZhtChr14UeYEIJQWWERj0AKZzpLIngcbmHbyhTbMfFaBk3jj8B1icibJ bSuP0AO9Zikp3EwBhqPMFB0ZlMYr+uXSMqi8hMW/DBVwhcpAk/mED8cwjmtgmUl9swlA gXww== MIME-Version: 1.0 X-Received: by 10.107.136.165 with SMTP id s37mr37614401ioi.37.1427900750719; Wed, 01 Apr 2015 08:05:50 -0700 (PDT) Received: by 10.36.66.74 with HTTP; Wed, 1 Apr 2015 08:05:50 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 1 Apr 2015 08:05:50 -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, 01 Apr 2015 15:06:24 -0000 Hello, [...] > Can this 'syntax error' problem be related to the requested MTU? > > with essentially the 'same' connection request, > > here's the transaction log from an MS Windows client. No syntax > errors. The requested MTU is 1024 > > https://gist.github.com/waitman/2d5a72e9f9544848e832 > > L2CAP(d): cid 0x40 len 346 [psm 1] > > > and a log from android client. Requested MTU is 256. > > https://gist.github.com/waitman/e365debcd4a96d849153 > > L2CAP(d): cid 0x43 len 247 [psm 1] > > note it's bombing out with something about aid 0x0200, which isn't > actually an aid specified in my 0x1124 record. just a wild guess. please make sure that you maintain continuation state properly. when sdp response is bigger than l2cap mtu, response is chunked. thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 15:09:46 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 67210E23 for ; Wed, 1 Apr 2015 15:09:46 +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 EAB64AD5 for ; Wed, 1 Apr 2015 15:09:45 +0000 (UTC) Received: by wixo5 with SMTP id o5so53008867wix.1 for ; Wed, 01 Apr 2015 08:09:44 -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=+qkuXXfCsHNS1ssDulns7NLty4ExPvu/QUVHJByOeWg=; b=Ag4dDBXdhm6+igtgpr4SldxelnmdVCUqum8fzzP/fKaC5PYEGwiTaXWJWrjkdCtqtI +hnNpCgN0OqltMGBZ3ymtaHQj8PfbhX2Pqcor9IHMlQJSYe5MZZ1E8NJ7cfBAjTmKS70 C6WW3z3WR3Cns+9eK5f+L+4IpE86IysmCdCt5b1Vzeauzm4tJGZmzvMGjO9nOkP7va7u Szm7bUk4IM6SIRMtWl2xqk49XA1AFTnUvN1BrJjX3+YwS5fpNWFtlwRIlKuz4ihLrbWp p0VIKLfcDQFjtITPumYH9tjHu4XLmzA+Q9SQsEFyQLmM+p9byl4XquxEBVRnCTwzxnvm opRg== MIME-Version: 1.0 X-Received: by 10.180.104.35 with SMTP id gb3mr15983730wib.60.1427900984478; Wed, 01 Apr 2015 08:09:44 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 08:09:44 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 1 Apr 2015 08:09:44 -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, 01 Apr 2015 15:09:46 -0000 On Wed, Apr 1, 2015 at 8:05 AM, Maksim Yevmenkin wrote: > Hello, > > [...] > >> Can this 'syntax error' problem be related to the requested MTU? >> >> with essentially the 'same' connection request, >> >> here's the transaction log from an MS Windows client. No syntax >> errors. The requested MTU is 1024 >> >> https://gist.github.com/waitman/2d5a72e9f9544848e832 >> >> L2CAP(d): cid 0x40 len 346 [psm 1] >> >> >> and a log from android client. Requested MTU is 256. >> >> https://gist.github.com/waitman/e365debcd4a96d849153 >> >> L2CAP(d): cid 0x43 len 247 [psm 1] >> >> note it's bombing out with something about aid 0x0200, which isn't >> actually an aid specified in my 0x1124 record. > > just a wild guess. please make sure that you maintain continuation > state properly. when sdp response is bigger than l2cap mtu, response > is chunked. > > thanks, > max Thank you, I was tinkering with things for awhile to try to find out why I was seeing 'syntax errors', but I'm thinking now there isn't a syntax error with the record, it's the hcidump program reading the broken up response. -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 15:15: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 4B736345 for ; Wed, 1 Apr 2015 15:15:37 +0000 (UTC) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 E785DBF4 for ; Wed, 1 Apr 2015 15:15:36 +0000 (UTC) Received: by qgep97 with SMTP id p97so45167392qge.1 for ; Wed, 01 Apr 2015 08:15:36 -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=NdvE3ox8E4B2wVgV1OPFkTXsuK+GbPnLwUB9yXQ7zZ4=; b=r4DbPDVVV5k5r4kFT4WgLRHqkMDnnz8SfOUXdDNDhU3qDL2buEvRC8cKQmyZzNoQ9W YYB2OIMa1l6QINq7LCQ76Go7Pnp2xuzD41h7TSAPCsO8Cg2g7EPRYDdvba7PLd7jxIjW 5MXWBbO1wckrYq/zK4IaWTdRnFshPnErHy5uK/9pzQZwnJtxLzoTIbJ62Znnx+H7VYM7 ptUVPzn+kLCg8v4ce5i6VgVEchTAZAG2F1veOjOnmOBy8KrtcqQUE6rYSIDqz9XkA4EL jQ4C8475uvglBPLcHMQKSOk+y7zMh1T47HF4KFANB76VHqinVds23DEE1ySWhY5BNqao MhEg== MIME-Version: 1.0 X-Received: by 10.140.86.199 with SMTP id p65mr55279372qgd.49.1427901336168; Wed, 01 Apr 2015 08:15:36 -0700 (PDT) Received: by 10.140.138.206 with HTTP; Wed, 1 Apr 2015 08:15:35 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 1 Apr 2015 08:15:35 -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, 01 Apr 2015 15:15:37 -0000 On Wed, Apr 1, 2015 at 8:09 AM, Waitman Gobble wrote: > On Wed, Apr 1, 2015 at 8:05 AM, Maksim Yevmenkin > wrote: >> Hello, >> >> [...] >> >>> Can this 'syntax error' problem be related to the requested MTU? >>> >>> with essentially the 'same' connection request, >>> >>> here's the transaction log from an MS Windows client. No syntax >>> errors. The requested MTU is 1024 >>> >>> https://gist.github.com/waitman/2d5a72e9f9544848e832 >>> >>> L2CAP(d): cid 0x40 len 346 [psm 1] >>> >>> >>> and a log from android client. Requested MTU is 256. >>> >>> https://gist.github.com/waitman/e365debcd4a96d849153 >>> >>> L2CAP(d): cid 0x43 len 247 [psm 1] >>> >>> note it's bombing out with something about aid 0x0200, which isn't >>> actually an aid specified in my 0x1124 record. >> >> just a wild guess. please make sure that you maintain continuation >> state properly. when sdp response is bigger than l2cap mtu, response >> is chunked. > > Thank you, I was tinkering with things for awhile to try to find out > why I was seeing 'syntax errors', but I'm thinking now there isn't a > syntax error with the record, it's the hcidump program reading the > broken up response. hcidump tries do be smart and re-assemble spd responses. if your continuation state is wrong, hcidump might not be able to re-assemble and parse response correctly thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 15:24:14 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 2D2EF4F6 for ; Wed, 1 Apr 2015 15:24:14 +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 A181ACF5 for ; Wed, 1 Apr 2015 15:24:13 +0000 (UTC) Received: by wixm2 with SMTP id m2so38053189wix.0 for ; Wed, 01 Apr 2015 08:24:12 -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=jY+4Kcgfxp/YZ7dMJSXk7QLZV8YOKXxPgnSwmzl1eLQ=; b=nInLyTZKnaPTKtk96bl6ALGO3Z9AGwS0GIASlEPV9skPvQOA+5gzwtUlClyq5G6eTk MShCUy2ZMwE7+LPMKYHCDVed7Fk9ub+eDOVLADLqLXrX88LRcImr31VaWQsIMNdNjKSl O4LLGOJh23vOU9NY8SFfTDFwVHYLNIIdKm4pQn2R3/apC+oSpp0zTdesJD98ol/m42yP vMLscVRxrOLLlZTU1fQvprF2YL5aQWjWu9z+RpXayn+vK3N3O0PYebWZdjiJsgpgWVKe c7RrK0qkBiB5tshzH9sSHsSAMJuPfuYeKjLLYoM6SxoQsIDGIMWOSXS+YmtKwXu4HBIu 6MLA== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr86615005wjd.134.1427901852171; Wed, 01 Apr 2015 08:24:12 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 08:24:12 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 08:24:12 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 1 Apr 2015 08:24:12 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Maksim Yevmenkin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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, 01 Apr 2015 15:24:14 -0000 On Apr 1, 2015 8:15 AM, "Maksim Yevmenkin" wrote: > > On Wed, Apr 1, 2015 at 8:09 AM, Waitman Gobble wrote: > > On Wed, Apr 1, 2015 at 8:05 AM, Maksim Yevmenkin > > wrote: > >> Hello, > >> > >> [...] > >> > >>> Can this 'syntax error' problem be related to the requested MTU? > >>> > >>> with essentially the 'same' connection request, > >>> > >>> here's the transaction log from an MS Windows client. No syntax > >>> errors. The requested MTU is 1024 > >>> > >>> https://gist.github.com/waitman/2d5a72e9f9544848e832 > >>> > >>> L2CAP(d): cid 0x40 len 346 [psm 1] > >>> > >>> > >>> and a log from android client. Requested MTU is 256. > >>> > >>> https://gist.github.com/waitman/e365debcd4a96d849153 > >>> > >>> L2CAP(d): cid 0x43 len 247 [psm 1] > >>> > >>> note it's bombing out with something about aid 0x0200, which isn't > >>> actually an aid specified in my 0x1124 record. > >> > >> just a wild guess. please make sure that you maintain continuation > >> state properly. when sdp response is bigger than l2cap mtu, response > >> is chunked. > > > > Thank you, I was tinkering with things for awhile to try to find out > > why I was seeing 'syntax errors', but I'm thinking now there isn't a > > syntax error with the record, it's the hcidump program reading the > > broken up response. > > hcidump tries do be smart and re-assemble spd responses. if your > continuation state is wrong, hcidump might not be able to re-assemble > and parse response correctly > > thanks, > max Interesting. I will check into this. Thanks for the info. Waitman From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 15:55: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 2D32F3D0 for ; Wed, 1 Apr 2015 15:55:51 +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 CC956E2 for ; Wed, 1 Apr 2015 15:55:50 +0000 (UTC) Received: from mfilter40-d.gandi.net (mfilter40-d.gandi.net [217.70.178.171]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 14D2641C083; Wed, 1 Apr 2015 17:55:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter40-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter40-d.gandi.net (mfilter40-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id ODqTb+NnWUgS; Wed, 1 Apr 2015 17:55:46 +0200 (CEST) X-Originating-IP: 149.254.56.251 Received: from [10.108.131.238] (genkt-056-251.t-mobile.co.uk [149.254.56.251]) (Authenticated sender: plunky@ogmig.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 9196F41C0A2; Wed, 1 Apr 2015 17:55:45 +0200 (CEST) User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Subject: Re: register HID with SDP error From: Iain Hibbert Date: Wed, 01 Apr 2015 16:55:43 +0100 To: Waitman Gobble , Maksim Yevmenkin Message-ID: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Wed, 01 Apr 2015 15:55:51 -0000 save the binary with 'hcidump -w file' and let's see it On 1 April 2015 16:24:12 BST, Waitman Gobble wrote: >On Apr 1, 2015 8:15 AM, "Maksim Yevmenkin" >wrote: >> >> On Wed, Apr 1, 2015 at 8:09 AM, Waitman Gobble >wrote: >> > On Wed, Apr 1, 2015 at 8:05 AM, Maksim Yevmenkin >> > wrote: >> >> Hello, >> >> >> >> [...] >> >> >> >>> Can this 'syntax error' problem be related to the requested MTU? >> >>> >> >>> with essentially the 'same' connection request, >> >>> >> >>> here's the transaction log from an MS Windows client. No syntax >> >>> errors. The requested MTU is 1024 >> >>> >> >>> https://gist.github.com/waitman/2d5a72e9f9544848e832 >> >>> >> >>> L2CAP(d): cid 0x40 len 346 [psm 1] >> >>> >> >>> >> >>> and a log from android client. Requested MTU is 256. >> >>> >> >>> https://gist.github.com/waitman/e365debcd4a96d849153 >> >>> >> >>> L2CAP(d): cid 0x43 len 247 [psm 1] >> >>> >> >>> note it's bombing out with something about aid 0x0200, which >isn't >> >>> actually an aid specified in my 0x1124 record. >> >> >> >> just a wild guess. please make sure that you maintain continuation >> >> state properly. when sdp response is bigger than l2cap mtu, >response >> >> is chunked. >> > >> > Thank you, I was tinkering with things for awhile to try to find >out >> > why I was seeing 'syntax errors', but I'm thinking now there isn't >a >> > syntax error with the record, it's the hcidump program reading the >> > broken up response. >> >> hcidump tries do be smart and re-assemble spd responses. if your >> continuation state is wrong, hcidump might not be able to re-assemble >> and parse response correctly >> >> thanks, >> max > >Interesting. I will check into this. Thanks for the info. > >Waitman iain From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 16:40:22 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 11CA829C for ; Wed, 1 Apr 2015 16:40:22 +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 8EB6E7E5 for ; Wed, 1 Apr 2015 16:40:21 +0000 (UTC) Received: by wiaa2 with SMTP id a2so73708879wia.0 for ; Wed, 01 Apr 2015 09:40:20 -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=onoHldEF4JmgWcIQr9UHTEAj2tLRQzVWIBnpDtT5GeY=; b=a5qmTyGpBBqmFAJSsrsGGUXlmlEyBwqTZSzLcLogBOjMeTYlx07aDzw8S6f2EDD12/ rG3gim+rpwPyvf245mxhvpbvS1WMyWeSZoFzRC8iG687dCI6O7BxS1xhLTPMmtqhoeYh Y3DCG3vuVdyZWUGATIGx9YZhW6Iu5mchC3XlS03K+V0x6Bx3LNObFOrTek58nJGtliXG pg0WqA1rAHyzKQKebiOqYfaRCmhybzRicwz39s8wKrFl3GBAxZ9IbfUETizOA1BVXmUg mjrfzfIVL29j3/KHEc0uJE6qaLLxYAOHPDMZfIf5uAB6D1oiz9v1LwGcz6buNVQ4+ECy BQLw== MIME-Version: 1.0 X-Received: by 10.195.12.35 with SMTP id en3mr82456160wjd.129.1427906419446; Wed, 01 Apr 2015 09:40:19 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 09:40:19 -0700 (PDT) In-Reply-To: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> References: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> Date: Wed, 1 Apr 2015 09:40:19 -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, 01 Apr 2015 16:40:22 -0000 On Wed, Apr 1, 2015 at 8:55 AM, Iain Hibbert wrote: > save the binary with 'hcidump -w file' and let's see it > > > On 1 April 2015 16:24:12 BST, Waitman Gobble wrote: >> >> >> On Apr 1, 2015 8:15 AM, "Maksim Yevmenkin" >> wrote: >> > >> > On Wed, Apr 1, 2015 at 8:09 AM, Waitman Gobble >> > wrote: >> > > On Wed, Apr 1, 2015 at 8:05 AM, Maksim Yevmenkin >> > > wrote: >> > >> Hello, >> > >> >> > >> [...] >> > >> >> > >>> Can this 'syntax error' problem be related to the requested MTU? >> > >>> >> > >>> with essentially the 'same' connection request, >> > >>> >> > >>> here's the transaction log from an MS Windows client. No syntax >> > >>> errors. The requested MTU is 1024 >> > >>> >> > >>> https://gist.github.com/waitman/2d5a72e9f9544848e832 >> > >>> >> > >>> L2CAP(d): cid 0x40 len 346 [psm 1] >> > >>> >> > >>> >> > >>> and a log from android client. Requested MTU is 256. >> > >>> >> > >>> https://gist.github.com/waitman/e365debcd4a96d849153 >> > >>> >> > >>> L2CAP(d): cid 0x43 len 247 [psm 1] >> > >>> >> > >>> note it's bombing out with something about aid 0x0200, which isn't >> > >>> actually an aid specified in my 0x1124 record. >> > >> >> > >> just a wild guess. please make sure that you maintain continuation >> > >> state properly. when sdp response is bigger than l2cap mtu, response >> > >> is chunked. >> > > >> > > Thank you, I was tinkering with things for awhile to try to find out >> > > why I was seeing 'syntax errors', but I'm thinking now there isn't a >> > > syntax error with the record, it's the hcidump program reading the >> > > broken up response. >> > >> > hcidump tries do be smart and re-assemble spd responses. if your >> > continuation state is wrong, hcidump might not be able to re-assemble >> > and parse response correctly >> > >> > thanks, >> > max >> >> Interesting. I will check into this. Thanks for the info. >> >> Waitman > > > iain Ok, here's a dump with the 'syntax error' https://artiming.com/andbin.xz Thank you, Waitman -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 20:50: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 ECE56EDA for ; Wed, 1 Apr 2015 20:50:43 +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 6FB6687B for ; Wed, 1 Apr 2015 20:50:43 +0000 (UTC) Received: from mfilter29-d.gandi.net (mfilter29-d.gandi.net [217.70.178.160]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 72F78FB8C8 for ; Wed, 1 Apr 2015 22:50:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter29-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter29-d.gandi.net (mfilter29-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id wB9LcnZN+8yf for ; Wed, 1 Apr 2015 22:50:39 +0200 (CEST) X-Originating-IP: 31.69.69.94 Received: from galant.ogmig.net (unknown [31.69.69.94]) (Authenticated sender: plunky@ogmig.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 4E213FB8C7 for ; Wed, 1 Apr 2015 22:50:35 +0200 (CEST) Received: by galant.ogmig.net (Postfix, from userid 1000) id B68532600C5; Wed, 1 Apr 2015 21:50:33 +0100 (BST) Date: Wed, 1 Apr 2015 21:50:33 +0100 (BST) From: Iain Hibbert To: freebsd-bluetooth@freebsd.org Subject: Re: register HID with SDP error In-Reply-To: Message-ID: References: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> 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: Wed, 01 Apr 2015 20:50:44 -0000 On Wed, 1 Apr 2015, Waitman Gobble wrote: > Ok, here's a dump with the 'syntax error' > > https://artiming.com/andbin.xz Y'all were right, the syntax error is something related to continuation and MTU.. but the error is probably just in the ancient version of hcidump that FreeBSD uses. So, with a patched for NetBSD version of a more recent hcidump from BlueZ 5.27 (Dec 2014) I see the connection as normal, then > ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 1 scid 0x0048 < ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0214 scid 0x0048 result 0 status 0 Connection successful > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Config req: dcid 0x0214 flags 0x00 clen 4 MTU 256 < ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0048 flags 0x00 result 0 clen 0 Success they ask for MTU of 256, and we agree.. < ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x0048 flags 0x00 clen 0 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0214 flags 0x00 result 0 clen 0 Success > ACL data: handle 67 flags 0x02 dlen 24 L2CAP(d): cid 0x0214 len 20 [psm 1] SDP SSA Req: tid 0x0 len 0xf pat uuid-16 0x1200 (PNPInfo) max 240 aid(s) 0x0000 - 0xffff cont 00 they ask for PNPInfo UUID, all AIDs < ACL data: handle 67 flags 0x02 dlen 99 L2CAP(d): cid 0x0048 len 95 [psm 1] SDP SSA Rsp: tid 0x0 len 0x5a count 87 record #0 aid 0x0000 (SrvRecHndl) uint 0x3 aid 0x0001 (SrvClassIDList) < uuid-16 0x1200 (PNPInfo) > aid 0x0004 (ProtocolDescList) < < uuid-16 0x0100 (L2CAP) uint 0x1 > < uuid-16 0x0001 (SDP) > > aid 0x0009 (BTProfileDescList) < < uuid-16 0x1200 (PNPInfo) uint 0x100 > > aid 0x0200 (VersionNumList) uint 0x102 aid 0x0201 (SrvDBState) uint 0x5ac aid 0x0202 (unknown) uint 0x239 aid 0x0203 (unknown) uint 0x50 aid 0x0204 (unknown) bool 0x1 aid 0x0205 (unknown) uint 0x1 cont 00 and we provide that ok > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Disconn req: dcid 0x0214 scid 0x0048 < ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Disconn rsp: dcid 0x0214 scid 0x0048 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 disconnect, and reconnect again > ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 1 scid 0x0042 < ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0215 scid 0x0042 result 0 status 0 Connection successful > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Config req: dcid 0x0215 flags 0x00 clen 4 MTU 256 and MTU 256 again < ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0042 flags 0x00 result 0 clen 0 Success < ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x0042 flags 0x00 clen 0 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0215 flags 0x00 result 0 clen 0 Success all ok > ACL data: handle 67 flags 0x02 dlen 24 L2CAP(d): cid 0x0215 len 20 [psm 1] SDP SSA Req: tid 0x0 len 0xf pat uuid-16 0x0100 (L2CAP) max 240 aid(s) 0x0000 - 0xffff cont 00 now, they ask for L2CAP UUID, all AIDs and max 240 bytes < ACL data: handle 67 flags 0x02 dlen 251 L2CAP(d): cid 0x0042 len 247 [psm 1] SDP SSA Rsp: tid 0x0 len 0xf2 count 237 cont 02 00 ED the first packet is sent, with 237 bytes and continuation. (hcidump doesn't show it yet, it waits until the rest of it arrives) > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 26 L2CAP(d): cid 0x0215 len 22 [psm 1] SDP SSA Req: tid 0x1 len 0x11 pat uuid-16 0x0100 (L2CAP) max 240 aid(s) 0x0000 - 0xffff cont 02 00 ED they ask for the second packet, with same continuation < ACL data: handle 67 flags 0x02 dlen 113 L2CAP(d): cid 0x0042 len 109 [psm 1] SDP SSA Rsp: tid 0x1 len 0x68 count 101 record #0 aid 0x0000 (SrvRecHndl) uint 0x2 aid 0x0001 (SrvClassIDList) < uuid-16 0x1124 (HID) > aid 0x0004 (ProtocolDescList) < < uuid-16 0x0100 (L2CAP) uint 0x11 > < uuid-16 0x0011 (HIDP) > > aid 0x0006 (LangBaseAttrIDList) < uint 0x656e uint 0x6a uint 0x100 > aid 0x0009 (BTProfileDescList) < < uuid-16 0x1124 (HID) uint 0x100 > > aid 0x000d (AdditionalProtocolDescLists) < < < uuid-16 0x0100 (L2CAP) uint 0x13 > < uuid-16 0x0011 (HIDP) > > > aid 0x0100 (SrvName) str "keyboard" aid 0x0201 (SrvDBState) uint 0x111 aid 0x0202 (unknown) uint 0x1 aid 0x0203 (unknown) uint 0x0 aid 0x0204 (unknown) bool 0x1 aid 0x0205 (unknown) bool 0x1 aid 0x0206 (unknown) < < uint 0x22 str 05 01 09 06 a1 01 85 01 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 75 08 95 01 81 01 75 01 95 05 05 08 19 01 29 05 91 02 75 03 95 01 91 01 75 08 95 06 15 00 26 ff 00 05 07 19 00 2a ff 00 81 00 75 01 95 01 15 00 25 01 05 0c 09 b8 81 06 09 e2 81 06 09 e9 81 02 09 ea 81 02 75 01 95 04 81 01 c0 > > aid 0x0207 (unknown) < < uint 0x409 uint 0x100 > > aid 0x020e (unknown) bool 0x0 record #1 aid 0x0000 (SrvRecHndl) uint 0x3 aid 0x0001 (SrvClassIDList) < uuid-16 0x1200 (PNPInfo) > aid 0x0004 (ProtocolDescList) < < uuid-16 0x0100 (L2CAP) uint 0x1 > < uuid-16 0x0001 (SDP) > > aid 0x0009 (BTProfileDescList) < < uuid-16 0x1200 (PNPInfo) uint 0x100 > > aid 0x0200 (VersionNumList) uint 0x102 aid 0x0201 (SrvDBState) uint 0x5ac aid 0x0202 (unknown) uint 0x239 aid 0x0203 (unknown) uint 0x50 aid 0x0204 (unknown) bool 0x1 aid 0x0205 (unknown) uint 0x1 cont 00 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 and the second packet arrives with 101 bytes. hcidump manages to put it all together and shows it all here, but extracting with hcidump -R will show the individual packet data[**] > ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Disconn req: dcid 0x0215 scid 0x0042 < ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Disconn rsp: dcid 0x0215 scid 0x0042 disconnected from SDP service > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 17 scid 0x0049 < ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0216 scid 0x0049 result 0 status 0 Connection successful this time connecting to control channel > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Config req: dcid 0x0216 flags 0x00 clen 4 MTU 640 < ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0049 flags 0x00 result 0 clen 0 Success < ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x0049 flags 0x00 clen 0 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0216 flags 0x00 result 0 clen 0 Success is ok > HCI Event: Encrypt Change (0x08) plen 4 status 0x00 handle 67 encrypt 0x01 and encryption is enabled by remote side > ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 19 scid 0x004c < ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0217 scid 0x004c result 0 status 0 Connection successful now connecting to interrupt channel > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 16 L2CAP(s): Config req: dcid 0x0217 flags 0x00 clen 4 MTU 640 < ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x004c flags 0x00 result 0 clen 0 Success < ACL data: handle 67 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x004c flags 0x00 clen 0 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 67 packets 1 > ACL data: handle 67 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0217 flags 0x00 result 0 clen 0 Success all ok > ACL data: handle 67 flags 0x02 dlen 6 L2CAP(d): cid 0x0216 len 2 [psm 17] HIDP: Set idle: 0000: 00 . and then the remote device sends a HID command, I can't remember what that does (turn idle off?) .. so it seems you can start sending reports now regards, iain [**] the actual data from the ServiceSearchAttribute request was > 02 43 20 18 00 14 00 15 02 06 00 00 00 0F 35 03 19 01 00 00 F0 35 05 0A 00 00 FF FF 00 < 02 43 20 FB 00 F7 00 42 00 07 00 00 00 F2 00 ED 36 01 4F 36 00 F8 09 00 00 0A 00 00 00 02 09 00 01 35 03 19 11 24 09 00 04 35 0D 35 06 19 01 00 09 00 11 35 03 19 00 11 09 00 06 35 09 09 65 6E 09 00 6A 09 01 00 09 00 09 35 08 35 06 19 11 24 09 01 00 09 00 0D 35 0F 35 0B 35 06 19 01 00 09 00 13 35 03 19 00 11 09 01 00 25 08 6B 65 79 62 6F 61 72 64 09 02 01 09 01 11 09 02 02 08 01 09 02 03 08 00 09 02 04 28 01 09 02 05 28 01 09 02 06 35 69 35 67 08 22 25 63 05 01 09 06 A1 01 85 01 05 07 19 E0 29 E7 15 00 25 01 75 01 95 08 81 02 75 08 95 01 81 01 75 01 95 05 05 08 19 01 29 05 91 02 75 03 95 01 91 01 75 08 95 06 15 00 26 FF 00 05 07 19 00 2A FF 00 81 00 75 01 95 01 15 00 25 01 05 0C 09 B8 81 06 09 E2 81 06 09 E9 81 02 09 EA 81 02 75 01 95 04 81 01 C0 09 02 00 ED > 02 43 20 1A 00 16 00 15 02 06 00 01 00 11 35 03 19 01 00 00 F0 35 05 0A 00 00 FF FF 02 00 ED < 02 43 20 71 00 6D 00 42 00 07 00 01 00 68 00 65 02 07 35 08 35 06 09 04 09 09 01 00 09 02 0E 28 00 36 00 51 09 00 00 0A 00 00 00 03 09 00 01 35 03 19 12 00 09 00 04 35 0D 35 06 19 01 00 09 00 01 35 03 19 00 01 09 00 09 35 08 35 06 19 12 00 09 01 00 09 02 00 09 01 02 09 02 01 09 05 AC 09 02 02 09 02 39 09 02 03 09 00 50 09 02 04 28 01 09 02 05 08 01 00 but bear in mind that this includes HCI and L2CAP headers.. From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 1 21:18: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 600B6B51 for ; Wed, 1 Apr 2015 21:18:57 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::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 BF2ABBAA for ; Wed, 1 Apr 2015 21:18:56 +0000 (UTC) Received: by wgdm6 with SMTP id m6so66677013wgd.2 for ; Wed, 01 Apr 2015 14:18: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=vB4IDQ1vdaTbqJrcAqDlSS9ax5UQ63LOeUf2UJ0YHYk=; b=suN5XLqsOiMGXUwIBL0aG/b3VpT6OaaHA0WQx3UUxscFlLBmfrblNwL4aKZsamTCBa Ld6AnrwQgikuGr4esFwymfIKNZpPMRJrUpc3qBr1K2+avXLoMR+CY92Sx03B/HE+cct6 ogT28ZMsb5nKKbNIdvoxCO+3SQiGlpJGWduglsZLDM0hPnqFpYxjpayUGzZs3uyRWLb2 +C2QYBN8FpjXjtCEa93pvA12MsvdwN0A0A34aHH3ynyOrHdBC0uWunQszA1YgyBAEE80 oZaCCtvH5E0gkloM3MIPt7OPfW72IaLGCR+NRY3K750dw61f9a7IZ5HdyeQYiPUW+Ono tZkg== MIME-Version: 1.0 X-Received: by 10.194.237.34 with SMTP id uz2mr86137033wjc.157.1427923135165; Wed, 01 Apr 2015 14:18:55 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 14:18:54 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 14:18:54 -0700 (PDT) In-Reply-To: References: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> Date: Wed, 1 Apr 2015 14:18:54 -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: Wed, 01 Apr 2015 21:18:57 -0000 On Apr 1, 2015 1:50 PM, "Iain Hibbert" wrote: > > On Wed, 1 Apr 2015, Waitman Gobble wrote: > > > Ok, here's a dump with the 'syntax error' > > > > https://artiming.com/andbin.xz > > Y'all were right, the syntax error is something related to continuation > and MTU.. but the error is probably just in the ancient version of hcidump > that FreeBSD uses. > > So, with a patched for NetBSD version of a more recent hcidump from BlueZ > 5.27 (Dec 2014) I see the connection as normal, then > > > ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Connect req: psm 1 scid 0x0048 > < ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Connect rsp: dcid 0x0214 scid 0x0048 result 0 status 0 > Connection successful > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > > ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Config req: dcid 0x0214 flags 0x00 clen 4 > MTU 256 > < ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0048 flags 0x00 result 0 clen 0 > Success > > they ask for MTU of 256, and we agree.. > > < ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Config req: dcid 0x0048 flags 0x00 clen 0 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0214 flags 0x00 result 0 clen 0 > Success > > > ACL data: handle 67 flags 0x02 dlen 24 > L2CAP(d): cid 0x0214 len 20 [psm 1] > SDP SSA Req: tid 0x0 len 0xf > pat uuid-16 0x1200 (PNPInfo) > max 240 > aid(s) 0x0000 - 0xffff > cont 00 > > they ask for PNPInfo UUID, all AIDs > > < ACL data: handle 67 flags 0x02 dlen 99 > L2CAP(d): cid 0x0048 len 95 [psm 1] > SDP SSA Rsp: tid 0x0 len 0x5a > count 87 > record #0 > aid 0x0000 (SrvRecHndl) > uint 0x3 > aid 0x0001 (SrvClassIDList) > < uuid-16 0x1200 (PNPInfo) > > aid 0x0004 (ProtocolDescList) > < < uuid-16 0x0100 (L2CAP) uint 0x1 > < > uuid-16 0x0001 (SDP) > > > aid 0x0009 (BTProfileDescList) > < < uuid-16 0x1200 (PNPInfo) uint 0x100 > > > aid 0x0200 (VersionNumList) > uint 0x102 > aid 0x0201 (SrvDBState) > uint 0x5ac > aid 0x0202 (unknown) > uint 0x239 > aid 0x0203 (unknown) > uint 0x50 > aid 0x0204 (unknown) > bool 0x1 > aid 0x0205 (unknown) > uint 0x1 > cont 00 > > and we provide that ok > > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Disconn req: dcid 0x0214 scid 0x0048 > < ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Disconn rsp: dcid 0x0214 scid 0x0048 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > disconnect, and reconnect again > > > ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Connect req: psm 1 scid 0x0042 > < ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Connect rsp: dcid 0x0215 scid 0x0042 result 0 status 0 > Connection successful > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Config req: dcid 0x0215 flags 0x00 clen 4 > MTU 256 > > and MTU 256 again > > < ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0042 flags 0x00 result 0 clen 0 > Success > < ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Config req: dcid 0x0042 flags 0x00 clen 0 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0215 flags 0x00 result 0 clen 0 > Success > > all ok > > > ACL data: handle 67 flags 0x02 dlen 24 > L2CAP(d): cid 0x0215 len 20 [psm 1] > SDP SSA Req: tid 0x0 len 0xf > pat uuid-16 0x0100 (L2CAP) > max 240 > aid(s) 0x0000 - 0xffff > cont 00 > > now, they ask for L2CAP UUID, all AIDs and max 240 bytes > > < ACL data: handle 67 flags 0x02 dlen 251 > L2CAP(d): cid 0x0042 len 247 [psm 1] > SDP SSA Rsp: tid 0x0 len 0xf2 > count 237 > cont 02 00 ED > > the first packet is sent, with 237 bytes and continuation. > > (hcidump doesn't show it yet, it waits until the rest of it arrives) > > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 26 > L2CAP(d): cid 0x0215 len 22 [psm 1] > SDP SSA Req: tid 0x1 len 0x11 > pat uuid-16 0x0100 (L2CAP) > max 240 > aid(s) 0x0000 - 0xffff > cont 02 00 ED > > they ask for the second packet, with same continuation > > < ACL data: handle 67 flags 0x02 dlen 113 > L2CAP(d): cid 0x0042 len 109 [psm 1] > SDP SSA Rsp: tid 0x1 len 0x68 > count 101 > record #0 > aid 0x0000 (SrvRecHndl) > uint 0x2 > aid 0x0001 (SrvClassIDList) > < uuid-16 0x1124 (HID) > > aid 0x0004 (ProtocolDescList) > < < uuid-16 0x0100 (L2CAP) uint 0x11 > < > uuid-16 0x0011 (HIDP) > > > aid 0x0006 (LangBaseAttrIDList) > < uint 0x656e uint 0x6a uint 0x100 > > aid 0x0009 (BTProfileDescList) > < < uuid-16 0x1124 (HID) uint 0x100 > > > aid 0x000d (AdditionalProtocolDescLists) > < < < uuid-16 0x0100 (L2CAP) uint 0x13 > < uuid-16 0x0011 (HIDP) > > > > aid 0x0100 (SrvName) > str "keyboard" > aid 0x0201 (SrvDBState) > uint 0x111 > aid 0x0202 (unknown) > uint 0x1 > aid 0x0203 (unknown) > uint 0x0 > aid 0x0204 (unknown) > bool 0x1 > aid 0x0205 (unknown) > bool 0x1 > aid 0x0206 (unknown) > < < uint 0x22 str 05 01 09 06 a1 01 85 01 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 75 08 95 01 81 01 75 01 95 05 05 08 19 01 29 05 91 02 75 03 95 01 91 01 75 08 95 06 15 00 26 ff 00 05 07 19 00 2a ff 00 81 00 75 01 95 01 15 00 25 01 05 0c 09 b8 81 06 09 e2 81 06 09 e9 81 02 09 ea 81 02 75 01 95 04 81 01 c0 > > > aid 0x0207 (unknown) > < < uint 0x409 uint 0x100 > > > aid 0x020e (unknown) > bool 0x0 > record #1 > aid 0x0000 (SrvRecHndl) > uint 0x3 > aid 0x0001 (SrvClassIDList) > < uuid-16 0x1200 (PNPInfo) > > aid 0x0004 (ProtocolDescList) > < < uuid-16 0x0100 (L2CAP) uint 0x1 > < > uuid-16 0x0001 (SDP) > > > aid 0x0009 (BTProfileDescList) > < < uuid-16 0x1200 (PNPInfo) uint 0x100 > > > aid 0x0200 (VersionNumList) > uint 0x102 > aid 0x0201 (SrvDBState) > uint 0x5ac > aid 0x0202 (unknown) > uint 0x239 > aid 0x0203 (unknown) > uint 0x50 > aid 0x0204 (unknown) > bool 0x1 > aid 0x0205 (unknown) > uint 0x1 > cont 00 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > and the second packet arrives with 101 bytes. hcidump manages to put it > all together and shows it all here, but extracting with hcidump -R will > show the individual packet data[**] > > > ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Disconn req: dcid 0x0215 scid 0x0042 > < ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Disconn rsp: dcid 0x0215 scid 0x0042 > > disconnected from SDP service > > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Connect req: psm 17 scid 0x0049 > < ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Connect rsp: dcid 0x0216 scid 0x0049 result 0 status 0 > Connection successful > > this time connecting to control channel > > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Config req: dcid 0x0216 flags 0x00 clen 4 > MTU 640 > < ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0049 flags 0x00 result 0 clen 0 > Success > < ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Config req: dcid 0x0049 flags 0x00 clen 0 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0216 flags 0x00 result 0 clen 0 > Success > > is ok > > > HCI Event: Encrypt Change (0x08) plen 4 > status 0x00 handle 67 encrypt 0x01 > > and encryption is enabled by remote side > > > ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Connect req: psm 19 scid 0x004c > < ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Connect rsp: dcid 0x0217 scid 0x004c result 0 status 0 > Connection successful > > now connecting to interrupt channel > > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 16 > L2CAP(s): Config req: dcid 0x0217 flags 0x00 clen 4 > MTU 640 > < ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x004c flags 0x00 result 0 clen 0 > Success > < ACL data: handle 67 flags 0x02 dlen 12 > L2CAP(s): Config req: dcid 0x004c flags 0x00 clen 0 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 67 packets 1 > > ACL data: handle 67 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0217 flags 0x00 result 0 clen 0 > Success > > all ok > > > ACL data: handle 67 flags 0x02 dlen 6 > L2CAP(d): cid 0x0216 len 2 [psm 17] > HIDP: Set idle: > 0000: 00 . > > and then the remote device sends a HID command, I can't remember what that > does (turn idle off?) > > .. so it seems you can start sending reports now > > regards, > iain > > [**] the actual data from the ServiceSearchAttribute request was > > > 02 43 20 18 00 14 00 15 02 06 00 00 00 0F 35 03 19 01 00 00 > F0 35 05 0A 00 00 FF FF 00 > < 02 43 20 FB 00 F7 00 42 00 07 00 00 00 F2 00 ED 36 01 4F 36 > 00 F8 09 00 00 0A 00 00 00 02 09 00 01 35 03 19 11 24 09 00 > 04 35 0D 35 06 19 01 00 09 00 11 35 03 19 00 11 09 00 06 35 > 09 09 65 6E 09 00 6A 09 01 00 09 00 09 35 08 35 06 19 11 24 > 09 01 00 09 00 0D 35 0F 35 0B 35 06 19 01 00 09 00 13 35 03 > 19 00 11 09 01 00 25 08 6B 65 79 62 6F 61 72 64 09 02 01 09 > 01 11 09 02 02 08 01 09 02 03 08 00 09 02 04 28 01 09 02 05 > 28 01 09 02 06 35 69 35 67 08 22 25 63 05 01 09 06 A1 01 85 > 01 05 07 19 E0 29 E7 15 00 25 01 75 01 95 08 81 02 75 08 95 > 01 81 01 75 01 95 05 05 08 19 01 29 05 91 02 75 03 95 01 91 > 01 75 08 95 06 15 00 26 FF 00 05 07 19 00 2A FF 00 81 00 75 > 01 95 01 15 00 25 01 05 0C 09 B8 81 06 09 E2 81 06 09 E9 81 > 02 09 EA 81 02 75 01 95 04 81 01 C0 09 02 00 ED > > > 02 43 20 1A 00 16 00 15 02 06 00 01 00 11 35 03 19 01 00 00 > F0 35 05 0A 00 00 FF FF 02 00 ED > < 02 43 20 71 00 6D 00 42 00 07 00 01 00 68 00 65 02 07 35 08 > 35 06 09 04 09 09 01 00 09 02 0E 28 00 36 00 51 09 00 00 0A > 00 00 00 03 09 00 01 35 03 19 12 00 09 00 04 35 0D 35 06 19 > 01 00 09 00 01 35 03 19 00 01 09 00 09 35 08 35 06 19 12 00 > 09 01 00 09 02 00 09 01 02 09 02 01 09 05 AC 09 02 02 09 02 > 39 09 02 03 09 00 50 09 02 04 28 01 09 02 05 08 01 00 > > but bear in mind that this includes HCI and L2CAP headers.. > Thanks so much, I'll check out updating hcidump. Maybe time to update the port. Waitman _______________________________________________ > 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 Thu Apr 2 02:48:42 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 DF98B556 for ; Thu, 2 Apr 2015 02:48:42 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (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 68013206 for ; Thu, 2 Apr 2015 02:48:42 +0000 (UTC) Received: by wixm2 with SMTP id m2so47073242wix.0 for ; Wed, 01 Apr 2015 19:48:40 -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=J0+FKMCXzu9sNRMTvxDumzFuUdo5TweH9BYsCHYIzbk=; b=czcrWxeFerAFJUK2HR41YHo2fNwIM2xsfxzTJVSX37jqUpQSHdJVO4haIlTUnvtOOo e7thxwhzAYzFm6t3mMjcOD0vMcp9ajdygXIwMCWAEXlLuOvyFJNNEPF3VCtAdDdJ8lNh w4lusAwb+iZYhU1uZ501ee+hX80L4hXw7u+m1DSDj1vP9CcYGL/l1w6s1uf4k8I0Ukz2 K/WDQpHIlapQL+BLI1lufjc/9whzOZrJRxu+DmpfUTOlpDbVGaac32gtjHbhiRGQL3hS VOWuOrF2p9Jk1jDcj5UV/xxTw+CTxHp8jvR3mwE7B+iA8Do734+MOrrpiLnEwUbWETAp Wmng== MIME-Version: 1.0 X-Received: by 10.195.12.35 with SMTP id en3mr86025647wjd.129.1427942920946; Wed, 01 Apr 2015 19:48:40 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Wed, 1 Apr 2015 19:48:40 -0700 (PDT) In-Reply-To: References: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> Date: Wed, 1 Apr 2015 19:48:40 -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: Thu, 02 Apr 2015 02:48:43 -0000 >> Y'all were right, the syntax error is something related to continuation >> and MTU.. but the error is probably just in the ancient version of hcidump >> that FreeBSD uses. Here's hcidump from the latest BlueZ release, that runs on FreeBSD. https://github.com/waitman/hcidump25 I got rid of the GNU configure/makefile stuff and wrote a BSD Makefile. It needs more work, at the moment it will parse the binary dump from the hcidump in the FreeBSD ports tree. (without syntax errors) ie, # ./hcidump HCI sniffer - Bluetooth packet analyzer ver 2.5 Can't open device: Protocol not supported but this works: # ./hcidump -r /xj/waitman/andbin When I get a chance I'll see about working out the issues. Thanks, -- Waitman Gobble Los Altos California USA 510-830-7975 From owner-freebsd-bluetooth@FreeBSD.ORG Fri Apr 3 06:34:51 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 55483845 for ; Fri, 3 Apr 2015 06:34:51 +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 034EFA00 for ; Fri, 3 Apr 2015 06:34:50 +0000 (UTC) Received: from mfilter40-d.gandi.net (mfilter40-d.gandi.net [217.70.178.171]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 5446A41C06D for ; Fri, 3 Apr 2015 08:34:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter40-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter40-d.gandi.net (mfilter40-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Gv2F65XCA6ed for ; Fri, 3 Apr 2015 08:34:46 +0200 (CEST) X-Originating-IP: 84.13.245.18 Received: from galant.ogmig.net (host-84-13-245-18.opaltelecom.net [84.13.245.18]) (Authenticated sender: plunky@ogmig.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id C014941C064 for ; Fri, 3 Apr 2015 08:34:46 +0200 (CEST) Received: by galant.ogmig.net (Postfix, from userid 1000) id 686112600C5; Fri, 3 Apr 2015 07:34:50 +0100 (BST) Date: Fri, 3 Apr 2015 07:34:50 +0100 (BST) From: Iain Hibbert To: "freebsd-bluetooth@freebsd.org" Subject: Re: register HID with SDP error In-Reply-To: Message-ID: References: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> 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: Fri, 03 Apr 2015 06:34:51 -0000 On Wed, 1 Apr 2015, Waitman Gobble wrote: > >> Y'all were right, the syntax error is something related to continuation > >> and MTU.. but the error is probably just in the ancient version of hcidump > >> that FreeBSD uses. > > Here's hcidump from the latest BlueZ release, that runs on FreeBSD. > > https://github.com/waitman/hcidump25 > > I got rid of the GNU configure/makefile stuff and wrote a BSD Makefile. > > It needs more work, at the moment it will parse the binary dump from > the hcidump in the FreeBSD ports tree. (without syntax errors) that is probably good, though I think you committed the changed version so its difficult to see the changes you made? github seems to lock up my firefox for some reason.. anyway the version I have is based on the BlueZ 5.27 release (they integrated hcidump finally) and the patches against that can be found in http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/sysutils/netbt-hcidump/patches/ and the general scheme is make only the parts of BlueZ lib that we need to build as libbt.a patch the parser to actually build as libparser.a modify the hcidump source to handle the differences in device access I guess you would find that the FreeBSD changes would be largely similar I guess, and the device access you could find about from the old hcidump. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Fri Apr 3 11:51:29 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 61E9436B for ; Fri, 3 Apr 2015 11:51:29 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (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 DE033E18 for ; Fri, 3 Apr 2015 11:51:28 +0000 (UTC) Received: by wgdm6 with SMTP id m6so109323963wgd.2 for ; Fri, 03 Apr 2015 04:51: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=Bkdbh4pMRipK+Oj3ZKwsJZa+0a4GV1OJP0GxZmiFliU=; b=lma8YDsSJNZ+Dx9smj1W+pSXtz2Ht7myIpoCdZI10eeLqOLz1q1IAGOOZJaN5JqLw2 ucI/pV/29p7O8XgOGj91vdUarE4+ubOtavax8XkFSulDnvBY0Ih7r6zB5SUE6exKju9L wV6hGVqLRRt6ZKtNxydOuEds69jTITeLhbujYEvSTa68biCp2FEQphIfsqkSmHdS+6Um cUw1t8R4FoPJLuxGuYAroCb2Qp27Ny6g80ECDl5LANUC1WFvgfpfUoKgWMujgqbS6+lz t1zvoW2LolTo3b4gLJ+C8jfIZSyZUyWIQjsgISJYQt1k4xfobQ89CY0KAl0WuTPF5mz8 Xtbg== MIME-Version: 1.0 X-Received: by 10.180.11.1 with SMTP id m1mr4868082wib.70.1428061887367; Fri, 03 Apr 2015 04:51:27 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Fri, 3 Apr 2015 04:51:27 -0700 (PDT) In-Reply-To: References: <67671012-52EF-49FA-8820-954E99601210@ogmig.net> Date: Fri, 3 Apr 2015 04:51:27 -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: Fri, 03 Apr 2015 11:51:29 -0000 On Thu, Apr 2, 2015 at 11:34 PM, Iain Hibbert wrote: > On Wed, 1 Apr 2015, Waitman Gobble wrote: > >> >> Y'all were right, the syntax error is something related to continuation >> >> and MTU.. but the error is probably just in the ancient version of hcidump >> >> that FreeBSD uses. >> >> Here's hcidump from the latest BlueZ release, that runs on FreeBSD. >> >> https://github.com/waitman/hcidump25 >> >> I got rid of the GNU configure/makefile stuff and wrote a BSD Makefile. >> >> It needs more work, at the moment it will parse the binary dump from >> the hcidump in the FreeBSD ports tree. (without syntax errors) > > that is probably good, though I think you committed the changed version so > its difficult to see the changes you made? github seems to lock up my > firefox for some reason.. Thanks, sorry about that. I fixed the github repo so you can now see the changes. > > anyway the version I have is based on the BlueZ 5.27 release (they > integrated hcidump finally) and the patches against that can be found in > > http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/sysutils/netbt-hcidump/patches/ > > and the general scheme is > > make only the parts of BlueZ lib that we need to build as libbt.a > > patch the parser to actually build as libparser.a > > modify the hcidump source to handle the differences in device access > > I guess you would find that the FreeBSD changes would be largely similar I > guess, and the device access you could find about from the old hcidump. Thank you, I'll check it out. > > 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" -- Waitman Gobble Los Altos California USA 510-830-7975