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