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