From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 17 06:34:30 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 850F3466 for ; Tue, 17 Mar 2015 06:34:30 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (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 21A9B892 for ; Tue, 17 Mar 2015 06:34:30 +0000 (UTC) Received: by wggv3 with SMTP id v3so371445wgg.1 for ; Mon, 16 Mar 2015 23:34:28 -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=VSh+yTfSnTOIl49Ac7zmWCCrHzXGKk11gpShduR0MDA=; b=vfRBkyqdzSxAXPznKowhfYQCGmeXQckA7gl2FaTl45Ipg641ZzLxfkE0qm9MZ1gZmT MkmZuPQ5T43IjknvK3TmpdjBGfqy0fXqjRoVA/H/hpY9VW+Tra5f8Q+3mwOuKGdIUwfx cWbIWG2tOT7sdEG++pGtK/7PHVWkijHdxYV3QnBCMVuP5HxvBzhXKCUNb54kyonD6iLE ZBdwvjz+SWywH5ylKDOR2DHBE76115kWVXWjuY/lDqyaJCfyLoLTne8SilwT04ByC9YI dzmIW0g9IFmG7ANskc8/wf97Nuc/PnsEy0CWt9FZQtk1/e1ALg0nm85AudnQMy74sVcv HgZQ== MIME-Version: 1.0 X-Received: by 10.194.237.34 with SMTP id uz2mr127019698wjc.157.1426574068270; Mon, 16 Mar 2015 23:34:28 -0700 (PDT) Received: by 10.27.214.136 with HTTP; Mon, 16 Mar 2015 23:34:28 -0700 (PDT) In-Reply-To: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Mon, 16 Mar 2015 23:34:28 -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" 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: Tue, 17 Mar 2015 06:34:30 -0000 On Mon, Mar 16, 2015 at 1:41 PM, maksim yevmenkin wrote: > > Thanks, that helps alot. > > I am also working on my other issue, the bluetooth stack not starting. The > example in the manual shows the same vendor CSR but product 0x0001, I > believe all my bt devices are 0x0002. It seems that the bluetooth stack will > fail if it does not identify the device.. so I'm tracking down where to add > it.. this device is actually functioning even without the bluetooth stack > starting. > > > Device vendor and product id pair should not matter too much. The driver > makes the match based on usb interface class and subclass. If device is > fully confirms to the spec then it usually just works. > > Some devices (Atheros and Broadcom for example) may require some sort of > firmware download. I've also seen all sort of weirdness in devices usually > requiring special driver or shim. > > In most cases, if ng_ubt(4) driver attaches to the device, then it should > work. If yo get usb transfer errors then I would suspect usb. I've seen this > before. Also what version of FreeBSD are you running this on ? > > Thanks > Max I reviewed the HID_SPEC_V11 PDF and think i'm getting closer. not yet sure about 11 & 12 11) HIDDescriptorList 0x0206 12) HIDLANGIDBaseList 0x0207 I think 12 is a list of available character encodings I can't seem to find examples of people using several of the 'mandatory' attributes. I'm not yet certain if i wrote hid_profile_create_additional_protocol_descriptor_list correctly, it looks like it's the same list as the protocol descriptor list, except one level deeper nesting and I think this is supposed to have reference to the interrupt PSM. At the moment i'm presuming it's the control channel + 2 -- but I seem to remember seeing an example dump that shows "Protocol specific parameter #2" with the interrupt channel. I'll check it out tomorrow. https://github.com/waitman/sdpd/blob/master/hid.c ./sdpcontrol -l search HID Record Handle: 0x00000002 Service Class ID List: Human Interface Device (0x1124) Protocol Descriptor List: L2CAP (0x0100) Protocol specific parameter #1: u/int/uuid16 17 HIDP (0x0011) Bluetooth Profile Descriptor List: Human Interface Device (0x1124) ver. 1.0 system -> # uname -a FreeBSD afia.waitman.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279971M: Mon Mar 16 14:03:44 PDT 2015 waitman@afia.waitman.net:/usr/obj/usr/src/sys/AFIA amd64 The bt device appears to work properly, except I have no /dev/ubt0 and get errors if I try to start the 'bluetooth' service. ubt0: on usbus0 WARNING: attempt to domain_add(netgraph) after domainfinalize() # service bluetooth start ubt0 /etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device ubt0 I changed sdpcontrol a bit for a little more debugging help https://github.com/waitman/sdpcontrol The changes are not that great but /slightly/ more messages in syslog. Thanks alot for your help. -- Waitman Gobble Los Altos California USA 510-830-7975