From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 16 18:53:46 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 C610D2D3 for ; Mon, 16 Mar 2015 18:53:46 +0000 (UTC) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (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 866D4170 for ; Mon, 16 Mar 2015 18:53:46 +0000 (UTC) Received: by ieclw3 with SMTP id lw3so179568474iec.2 for ; Mon, 16 Mar 2015 11:53:46 -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=vUp6iSh6Do7zIlJY4khcLFDX9nNUgznzW7jIlvoIfPE=; b=IvfikdUQuKbxfnaFAMUckM+Afd9CYTXYum3520Rermu5iBii1aEZMPQhE+4ix6H4Ud q39LE8lLl+DLUniG6m0jDPERU+hGCzrkAZ4BJUna8W9FmJV3mmzgDwUO1B+zGGXh/sW+ gsXYwlWeQjQQJMVL+TokEqZq+LTzq7Ng2RHsumzSsQCQgbAGiycC4Q1fkThm0uDlGMp1 f7Wh36RbbZIUOVlAZdikJz3mMtIZ6Wlq4vQ97BsXib7xvLdZrE/ZB2B34Hm3D1YcoTRu MkbJ3UvGHb+AdfJV+TE8A/n6Xusm+tIa+fet8xW2XAIZP22QdPUHaFs4X0IJMwcK2jS+ cdiw== MIME-Version: 1.0 X-Received: by 10.42.52.209 with SMTP id k17mr7324214icg.11.1426532026061; Mon, 16 Mar 2015 11:53:46 -0700 (PDT) Received: by 10.36.66.74 with HTTP; Mon, 16 Mar 2015 11:53:46 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Mar 2015 11:53:46 -0700 Message-ID: Subject: Re: register HID with SDP error From: Maksim Yevmenkin To: Waitman Gobble 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: Mon, 16 Mar 2015 18:53:47 -0000 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