Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2015 07:58:37 -0700
From:      Waitman Gobble <gobble.wa@gmail.com>
To:        Iain Hibbert <plunky@ogmig.net>
Cc:        "freebsd-bluetooth@freebsd.org" <freebsd-bluetooth@freebsd.org>
Subject:   Re: register HID with SDP error
Message-ID:  <CAFuo_fyvvJkfvpGfx-0dhhAsY6i_wMwZz4wEi47kEoLfaEV4EA@mail.gmail.com>
In-Reply-To: <alpine.NEB.2.11.1503301614370.9398@galant.ogmig.net>
References:  <CAFuo_fy9xRU2T3GUPY8116yZCUd8sL9pBQ9ixXnMwO56niJFog@mail.gmail.com> <CAFuo_fwPuaD4bYwfZou0RBswZsTmdtVZA1B2GqUdo3ZJJiWRQg@mail.gmail.com> <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> <CAFuo_fye5RWNtjsutHa%2BbXL0AYHYRpJxW-b=48o0iMwX227wdA@mail.gmail.com> <alpine.NEB.2.11.1503170658130.4414@galant.ogmig.net> <CAFuo_fx47uRC-eKD_KtsSsrMCQZauyHyCOgRxGbtp_WEZ49o_Q@mail.gmail.com> <alpine.NEB.2.11.1503171759510.4792@galant.ogmig.net> <CAFPOs6omaOOOumNk2Zg=YBgK9cy7JumOZ6k-89oTbVw-3PgAvg@mail.gmail.com> <CAFuo_fy%2BdmpcswwLMV3LaGGkN6VyQ%2B=ieEzYUT=omSLkhS8=EA@mail.gmail.com> <CAFuo_fwBcBQOZzFNntBSP0AwyAkGq=s-eeKJ1CCgjPp5tWdG=A@mail.gmail.com> <CAFPOs6rJJW2BC3rru%2Bvb5dAE0yaHGvr=0s8K9FZ1ee0rf-ML-w@mail.gmail.com> <CAFuo_fzRGc0_yrHYyqcfLrWX7q3AuLwA3v%2B9_QRTirU-Bx4xkw@mail.gmail.com> <CAFuo_fyYyoX6rNwN6_TfB01_xp5EQHFu-CJG=_dab_Qe7x1hkA@mail.gmail.com> <alpine.NEB.2.11.1503301517330.9258@galant.ogmig.net> <CAFuo_fxuTJqdvMg7jQ4rZy8qHLpNe2nRo%2B0JftGGBG2cjQ_QZg@mail.gmail.com> <alpine.NEB.2.11.1503301614370.9398@galant.ogmig.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 30, 2015 at 8:37 AM, Iain Hibbert <plunky@ogmig.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFuo_fyvvJkfvpGfx-0dhhAsY6i_wMwZz4wEi47kEoLfaEV4EA>