From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 16 01:19:16 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 691B6EE9 for ; Mon, 16 Mar 2015 01:19:16 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (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 F1C2E236 for ; Mon, 16 Mar 2015 01:19:15 +0000 (UTC) Received: by wifj2 with SMTP id j2so30522200wif.1 for ; Sun, 15 Mar 2015 18:19:13 -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 :content-type; bh=4nAUZEPf0Awl8Efxl/DGkSlfhWczMIIYFEQaGj3DRKE=; b=C4gVfpVQVpaaXSAC9XWe7QoIqAN+G/1SFJbeFmcqyLNYwRKCiyWYCVL+v+tJnp7+iq jLyrsxpEg0kBPNF5ilztDlCpIrCWNC1KA9qY0tAoD3w1+HdGvlughzBCkPatF2qQ+BAp kmYuDpUmIuWd+fBYduGrECZdRtFcXZIJZxygxeSm27nt6wtGKrHFb1/ViIKVYa7hPuQw W7rC8flNakcfQhubPhyGBBsdnBooBH0syOQ0bs22iAvSjWMbnxNLeiDwVk+TzpVCd4hO nzS3kcSWbUL7GvpcYZtBS3EIXGjse2xnUYKqR1wdwg0gSrdeLQyITYjv+TDszD408tHV kgBg== MIME-Version: 1.0 X-Received: by 10.194.75.168 with SMTP id d8mr119489247wjw.87.1426468753221; Sun, 15 Mar 2015 18:19:13 -0700 (PDT) Received: by 10.27.214.136 with HTTP; Sun, 15 Mar 2015 18:19:13 -0700 (PDT) In-Reply-To: References: Date: Sun, 15 Mar 2015 18:19:13 -0700 Message-ID: Subject: Re: register HID with SDP error From: Waitman Gobble To: freebsd-bluetooth@freebsd.org Content-Type: text/plain; charset=UTF-8 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 01:19:16 -0000 On Sun, Mar 15, 2015 at 4:48 PM, Waitman Gobble wrote: > On Sun, Mar 15, 2015 at 7:58 AM, Waitman Gobble wrote: >> Hi, >> >> I'm having trouble registering HID service with sdpd, here is a simple example: >> >> >> sdp_sp_profile_t sp; >> bdaddr_t bt_addr_any; >> void *ss; >> uint32_t sdp_handle; >> >> memcpy(&addr, NG_HCI_BDADDR_ANY, sizeof(addr)); >> memset(&sp, 0, sizeof(sp)); >> sp.server_channel = 0; >> >> ss = sdp_open_local(NULL); >> >> sdp_register_service(ss, SDP_SERVICE_CLASS_HUMAN_INTERFACE_DEVICE, >> &bt_addr_any, (void *)&sp, sizeof(sp), >> &sdp_handle); >> >> >> >> messages I am receiving: >> >> sdp_error(ss) is Input/output error (5) >> >> sdpd[6621]: Could not process SDP request from control socket, >> pdu->pid=129, pdu->tid=1, pdu->len=12, len=17, error=3 >> >> >> I see /usr/src/usr.sbin/bluetooth/bthidd/ but I believe that's to >> connect to remote HID services. >> >> >> Also I went to the local electronics store and picked up every bt >> dongle they had on the shelf. (it looks like v4 bt devices they have >> use the CSR8510 chip despite the "brand name". but I also have v3, v2, >> and v1 devices to test). Starting the bluetooth service always seems >> to result in error for all the devices, however I can run sdpd and >> also browse remote services and pair from client to server and >> vice-versa, so I'm not exactly sure of the importance of the bluetooth >> service? >> >> ubt0: on usbus0 >> ubt0: ubt_bulk_read_callback:977: bulk-in transfer failed: USB_ERR_IOERROR >> ubt0: at uhub0, port 8, addr 5 (disconnected) >> ubt0: on usbus0 >> ubt0: at uhub0, port 8, addr 6 (disconnected) >> ubt0: on usbus0 >> ng_hci_process_command_timeout: ubt0hci - unable to complete HCI >> command OGF=0x3, OCF=0x3. Timeout >> ng_hci_process_command_timeout: ubt0hci - unable to complete HCI >> command OGF=0x4, OCF=0x9. Timeout >> ubt0: ubt_bulk_read_callback:977: bulk-in transfer failed: USB_ERR_IOERROR >> ubt0: at uhub0, port 8, addr 7 (disconnected) >> ubt0: on usbus0 >> ng_hci_process_command_timeout: ubt0hci - unable to complete HCI >> command OGF=0x3, OCF=0x3. Timeout >> ubt0: ubt_bulk_read_callback:977: bulk-in transfer failed: USB_ERR_IOERROR >> ubt0: at uhub0, port 8, addr 8 (disconnected) >> ubt0: on usbus0 >> ng_hci_process_command_complete: ubt0hci - HCI command failed, >> OGF=0x1, OCF=0xe, status=0xc >> ng_hci_process_command_complete: ubt0hci - HCI command failed, >> OGF=0x1, OCF=0xe, status=0xc >> ng_hci_process_command_complete: ubt0hci - HCI command failed, >> OGF=0x1, OCF=0xe, status=0xc >> ubt0: ubt_bulk_read_callback:977: bulk-in transfer failed: USB_ERR_IOERROR >> ubt0: at uhub0, port 8, addr 9 (disconnected) >> ubt0: > 10> on usbus0 >> ubt0: ubt_bulk_read_callback:977: bulk-in transfer failed: USB_ERR_IOERROR >> ubt0: at uhub0, port 8, addr 10 (disconnected) >> ubt0: > 11> on usbus0 >> ubt0: ubt_bulk_read_callback:977: bulk-in transfer failed: USB_ERR_IOERROR >> ubt0: at uhub0, port 8, addr 11 (disconnected) >> ubt0: > 12> on usbus0 >> >> >> >> Thank you for any pointers, help, comments. >> >> -- >> Waitman Gobble >> Los Altos, California USA >> 510-830-7975 > > > it 'seems like' the problem is that there is no corresponding profile > implemented in sdpd, > > ie, /usr/src/usr.sbin/bluetooth/sdpd/profile.c > > profile_p profile_get_descriptor(uint16_t uuid) { ... } > > When I issue a request to register > SDP_SERVICE_CLASS_HUMAN_INTERFACE_DEVICE it's looking for profile > with uuid (base10) 4388 (0x1124), but > 4355,4358,4356,4359,4354,4357,4353,4374,4375,4373 are the only ones > defined in that function. > > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 It's not 100% correct yet but I did have some luck making a hid profile in sdpd, shows up in sdpcontrol local browse. So, it 'appears' . https://github.com/waitman/sdpd Now on to make it actually work as it's supposed to :) # sdpcontrol -l browse Record Handle: 00000000 Service Class ID List: Service Discovery Server (0x1000) Protocol Descriptor List: L2CAP (0x0100) SDP (0x0001) Bluetooth Profile Descriptor List: Service Discovery Server (0x1000) ver. 1.0 Record Handle: 0x00000001 Service Class ID List: Browse Group Descriptor (0x1001) Record Handle: 0x00000002 Service Class ID List: Human Interface Device (0x1124) Bluetooth Profile Descriptor List: Human Interface Device (0x1124) ver. 1.0 -- Waitman Gobble Los Altos California USA 510-830-7975