From owner-freebsd-bluetooth@FreeBSD.ORG Wed Mar 25 03:10:51 2015 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4690766 for ; Wed, 25 Mar 2015 03:10:51 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE4F818 for ; Wed, 25 Mar 2015 03:10:51 +0000 (UTC) Received: by wibbg6 with SMTP id bg6so7018753wib.0 for ; Tue, 24 Mar 2015 20:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=R9eebD1ect34dxScOMKkmO3c9OGmmsCfwYHlm1AiDjc=; b=ol3aafGM62cRhTTzf/Bbn2YMh2a13e3dCzxW7aH1SqoQzRnR8KcrDO+K6I/FDR/qkY AabzyQVUp+8FWYFdLjO2IjocUqxqo74+v81x11CEB5j0U2LEPcDdyYhdm0OqjO2zqtRU qkMILj1wEtn0knmXTVBkyfzuKR0Hm4lpyuzGeVpF0SKFUgDLRBBrXSvR4fc3BmaUvulQ yrsVlbptDTR0yFKYenxwbO9qO6Q1jZl4M5vRU1FypnK9imvE6aU0wltdOMswI+EN3bkh MULXYMfUedrM4kkkSNc9jhOHKBg6ba6I1j3oY+ta6GEODgmjDI6Wcx/7M6+MOgszM0+R 84Aw== MIME-Version: 1.0 X-Received: by 10.195.12.97 with SMTP id ep1mr13963450wjd.134.1427253049471; Tue, 24 Mar 2015 20:10:49 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Tue, 24 Mar 2015 20:10:49 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Tue, 24 Mar 2015 20:10:49 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: Iain Hibbert Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 03:10:51 -0000 >> I did notice some clients request 0x1200 'pnp info' so I added >> SDP_SERVICE_CLASS_PNP_DEVICE handler to sdpd to see what would happen. >> The code is here -> https://github.com/waitman/sdpd/blob/master/pnp.c >> But the configuration parameters should be set by the request, not >> hardcoded into pnp.c (also hid.c should be fixed) > > The PNP Info can be useful, I use it for example (on NetBSD) to get the > product and vendor IDs in order to match a specific driver for the Apple > Magic Mouse, rather than the generic Bluetooth HID mouse driver. > > regards, > iain > _______________________________________________ > freebsd-bluetooth@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth > To unsubscribe, send any mail to "freebsd-bluetooth-unsubscribe@freebsd.org" I updated the PNP code so the info is set by the register function. It's totally not monumental, but it was annoying to me that clients were 'asking for it' and not getting a response. There is an issue is that this software presumes it's the only thing on the device. 'primary'. that's a TODO. Fine now, when things become more complicated it will need to be addressed. https://github.com/waitman/sdpd/blob/master/pnp.c to set up a PNP profile on the SDP server, (at this moment these are not defined in sdp.h) #define SDP_SERVICE_CLASS_PNP_DEVICE 0x1200 struct sdp_pnp_profile { uint8_t authority; /* 0x1 or 0x2 */ uint16_t vendor_id; uint16_t product_id; uint16_t product_version; uint16_t bt_version; }; typedef struct sdp_pnp_profile sdp_pnp_profile_t; sdp_pnp_profile_t pnp; memset(&pnp, 0, sizeof(pnp)); pnp.authority = 0x1; /* where your got your mfg number. 0x1 Bluetooth SIG, 0x2 USB */ pnp.vendor_id = 0x05ac; /* your assigned vendor ID. this one for TEST only */ pnp.product_id = 0x0239; /* your product ID. this one for TEST only */ pnp.product_version = 0x050; /* the version of your product. this one for TEST only */ pnp.bt_version = 0x0102; /* bt v1.2 example */ if (sdp_register_service(ss, SDP_SERVICE_CLASS_PNP_DEVICE, &bt_addr_any, (void *)&pnp, sizeof(pnp), &sdp_handle) != 0) { /* there's an error */ } -- Waitman Gobble Los Altos California USA 510-830-7975