Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2015 11:53:46 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
To:        Waitman Gobble <gobble.wa@gmail.com>
Cc:        "freebsd-bluetooth@freebsd.org" <freebsd-bluetooth@freebsd.org>
Subject:   Re: register HID with SDP error
Message-ID:  <CAFPOs6r_D7bcGCMP_bP%2BQtZgKt7Oj5jRJ2v872RODekn%2B6xv1Q@mail.gmail.com>
In-Reply-To: <CAFuo_fxgBVKxmzbJs%2B-XDz%2Bu4tb2_i3eYXSa-oiOoU%2BQD6ApwQ@mail.gmail.com>
References:  <CAFuo_fy9xRU2T3GUPY8116yZCUd8sL9pBQ9ixXnMwO56niJFog@mail.gmail.com> <CAFuo_fzdmB79qdoH8P5EcO_ZZoa=_id6h=eqFBXvP_a%2B3WMkLw@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>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello!


> Thanks for your replies and helpful information. I think I did pull
> out the rfcomm protocol in hid.c, and advertise l2cap. But it's
> obviously not 100% working..
>
> basically what I need to do is have my FreeBSD box announce that it's
> a keyboard, then send strings from the box such as "012345" that
> appear on the client as if they were typed.

thank you for the clarification. in this case, you need to construct
sdp record as per bluetooth hid spec. if my reading of the spec if
correct, you need to provide the following mandatory attributes

1) Service Class ID List 0x0001
2) Protocol Descriptor List  0x0004
3) LanguageBaseAttributeIDL 0x0006
4) AdditionalProtocolDescriptorList 0x000d
5) BluetoothProfile DescriptorList  0x0009
6) HIDParserVersion 0x0201
7) HIDDeviceSubclass 0x0202
8) HIDCountryCode 0x0203
9) HIDVirtualCable 0x0204
10) HIDReconnectInitiate 0x0205
11) HIDDescriptorList 0x0206
12) HIDLANGIDBaseList 0x0207
13) HIDBootDevice 0x020e

there are others (optional) attributes as well. i might missed some,
so, please, double check the spec.

to "pretend" to be a keyboard, you will need to generate hid
descriptor for your virtual keyboard. you can use one of the tools
available for download, or, just use hid descriptor of a real usb
keyboard. that hid descriptor needs to go into a sdp record as well
(thus it has to be a parameter). PSMs for control and interrupt
channel go into the protocol descriptor list and additional protocol
descriptor list, so, those are parameters too. hid device subclass and
hid country code are parameters too.  so, basically, i hope you got
the idea by now.

once you construct the proper sdp record, your virtual keyboard should
be "visible" and "usable" from the remote host. to send keystrokes,
you simply need to construct and send hid reports (in the format
described by hid descriptor). one hid report in one l2cap packet.

bthidd(8) can be used as reference to see what happens on host side.
you basically need to send something that bthidd(8) will understand.

i hope it makes sense. if not, please feel free to ask.

thanks
max



>
> Thank you,
>
> --
> 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?CAFPOs6r_D7bcGCMP_bP%2BQtZgKt7Oj5jRJ2v872RODekn%2B6xv1Q>