linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice DELENTE <delentef@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: Entering the PIN of a device?
Date: Tue, 14 Feb 2012 23:47:14 +0100	[thread overview]
Message-ID: <20120214224714.GA5586@smtp.free.fr> (raw)
In-Reply-To: <CANq1E4R0xkzJF8CebBFkc5R=idO=cEPciK2XQW9Yv9nWuWGnGw@mail.gmail.com>

> Did the device show up in /sys/bus/hid/devices ? Did you check
> dmesg? I think you got the device connected successfully, it just
> doesn't do anything useful without configuration ;)

My tests have been disappointing, I have the wiimote plugin in
bluetoothd (the grep for wiimote in bluetoothd shows a match), but
there is no auto-pairing...

If I have bluetoothd running, and I press 1+2 (or the red button),
nothing shows in dmesg, nor in /sys/bus/hid/devices...

If I press 1+2 and start simple-agent hci0 $WIIMOTE, I get a message
asking for the PIN, but I can't type it (I must type in the wiimote BT
addr in string form, right?)

I modified simple-agent with a bit of python to return the address in
UTF-8 form:

def RequestPinCode(self, device):
    print "RequestPinCode (%s)" % (device)
    wiimote_address_bytes = os.environ["WIIMOTE"].split(":")
    n = ""
    for i in range(len(wiimote_address_bytes)-1, -1, -1):
    	if int(wiimote_address_bytes[i], 16) == 0:
           break
	n += chr(int(wiimote_address_bytes[i], 16))
    return unicode(n, "utf-8")

but I still have an error:

# ./wiimote-agent hci0 $WIIMOTE
RequestPinCode (/org/bluez/5122/hci0/dev_00_1F_C5_1B_3A_B1)
Creating device failed: org.bluez.Error.AuthenticationRejected: Authentication Rejected

Well... I'll try again after a good night sleep :^)

-- 
F. Delente

  parent reply	other threads:[~2012-02-14 22:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 16:45 Entering the PIN of a device? Fabrice DELENTE
2012-02-14 17:54 ` David Herrmann
     [not found]   ` <20120214175813.GA16393@smtp.free.fr>
     [not found]     ` <CANq1E4Q7UQjQNKPy0c-w4DX8dimuRNYB_mOsetMBNPaY44Ae5A@mail.gmail.com>
2012-02-14 18:09       ` Fabrice DELENTE
2012-02-14 18:15         ` David Herrmann
2012-02-14 18:23           ` Fabrice DELENTE
2012-02-14 22:47           ` Fabrice DELENTE [this message]
2012-02-15 11:16             ` David Herrmann
2012-02-15 11:25               ` Fabrice DELENTE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120214224714.GA5586@smtp.free.fr \
    --to=delentef@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).