Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 2015 20:10:49 -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_fwMSPNW5ttPPtNTZuQavGW7SV4PA9ofrjR9TDyAT7BOow@mail.gmail.com>
In-Reply-To: <alpine.NEB.2.11.1503230646520.15407@galant.ogmig.net>
References:  <CAFuo_fy9xRU2T3GUPY8116yZCUd8sL9pBQ9ixXnMwO56niJFog@mail.gmail.com> <CAFuo_fzB3A5L3vivH7Z80OEoBtVEHftEYE4LUkhnrkguzL5GDA@mail.gmail.com> <CAFuo_fzrk%2BWLXivZrnTsGQD%2BS7mq%2BUSXB7Mn6%2BJT=y64JakGSw@mail.gmail.com> <CAFPOs6q3iVcNthF=S--UgTm=5wA0HM6coqB7AcmCKb=55OWdTQ@mail.gmail.com> <CAFuo_fxgBVKxmzbJs%2B-XDz%2Bu4tb2_i3eYXSa-oiOoU%2BQD6ApwQ@mail.gmail.com> <CAFPOs6r_D7bcGCMP_bP%2BQtZgKt7Oj5jRJ2v872RODekn%2B6xv1Q@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> <alpine.NEB.2.11.1503230646520.15407@galant.ogmig.net>

next in thread | previous in thread | raw e-mail | index | archive | help
>> 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



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