From owner-freebsd-bluetooth@FreeBSD.ORG Sat Mar 21 18:02:31 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 CE826455 for ; Sat, 21 Mar 2015 18:02:31 +0000 (UTC) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (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 7E78E5E4 for ; Sat, 21 Mar 2015 18:02:31 +0000 (UTC) Received: by igbud6 with SMTP id ud6so12555863igb.1 for ; Sat, 21 Mar 2015 11:02:31 -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=hKYGx/SDn1FDxukMlINfb9ahYhB6/5DqP6+fKtawKAA=; b=e10mvc1KLEdiXdK4wW91Y/77WsyJ9hT4RQQV1O88/tun1gaIqvElHQwz62ILuUpvRv Pb8L69E1xlFY1iVF1U1xSQHrlAYVy9BarvbuY7scSgj2PdknvFvGIsdCMbKmBingrBKV bjXFeZ8gkWZweZdQcul1YJZKI13aKWAC2UJyI6Hwwjfq459hZFqTCaN3MxUmLpRmdQzs rLX8yVLVR9ANt9FAQ/NEFUP4C7YZYVaUFacIhAwNdJbWs8CmPLURv9iPLNprGycxmbaR EtafJwFKqJHsdGJKBI1MyUAVwnrfaLiL2SnxQXzbuIfG9K1BUplYYTe+dBsxcgTFgzb6 DF6Q== MIME-Version: 1.0 X-Received: by 10.107.12.70 with SMTP id w67mr118795360ioi.10.1426960951039; Sat, 21 Mar 2015 11:02:31 -0700 (PDT) Received: by 10.36.66.74 with HTTP; Sat, 21 Mar 2015 11:02:30 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> <77352B43-637C-4E0D-B4CC-B42D977551F6@gmail.com> Date: Sat, 21 Mar 2015 11:02:30 -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" , Iain Hibbert 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: Sat, 21 Mar 2015 18:02:32 -0000 [...] > Hey, that works! Thank you. > > hccontrol Write_Class_Of_Device 02:50:40 great! as i said, you can also automate it. please read bluetooth.device.conf(5). in your case you will need to create /etc/bluetooth/ubt0.conf and add class="02:50:40" this way class will be applied every time you start ubt0 device. > so now I have to figure out how to send the PIN that the connecting > device demands to receive. I suppose it's sending 0000. But it appears > there has to be a human action in this case. you have a couple of options here: (1) use hcsecd(8). since you want to pair with any host (because your code implements device) you can use default entry. please read hcsecd.conf(5) for more details. device { bdaddr 00:00:00:00:00:00; name "Default entry"; key nokey; pin "0000"; } something like this might work; (2) write your own code. basically, you want to open raw HCI socket and listen for PIN code and link key requests and events. hcsecd(8) source code can be used as reference; thanks, max