Linux bluetooth development
 help / color / mirror / Atom feed
From: John Keeping <john@metanate.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Determining whether a Bluetooth device supports pairing
Date: Mon, 22 May 2017 12:15:03 +0100	[thread overview]
Message-ID: <20170522121503.126355ed.john@metanate.com> (raw)
In-Reply-To: <5C9B4D2C-2410-4FB9-9BBF-F6FDB60BB6B6@holtmann.org>

[-- Attachment #1: Type: text/plain, Size: 3607 bytes --]

Hi Marcel,

On Thu, 18 May 2017 16:56:14 +0200, Marcel Holtmann wrote:

> > Am I missing some method for determining whether or not a device
> > supports pairing?  Or do we need to handle SMP_PAIRING_NOTSUPP
> > specially?
> 
> I do not remember any indication from the Bluetooth Core specification
> that would tell you in advance if you support pairing or not. Mainly
> since most devices actually just support pairing. Can you show us the
> btmon trace output of the advertising reports.

Here's the advertising report and scan response:

-- >8 --
> HCI Event: LE Meta Event (0x3e) plen 33
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Public (0x00)
        Address: A0:E6:F8:4A:AE:AD (Texas Instruments)
        Data length: 21
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        128-bit Service UUIDs (complete): 1 entry
          Vendor specific (03b80e5a-ede8-4b33-a751-6ce34ec4c700)
        RSSI: -66 dBm (0xbe)
> HCI Event: LE Meta Event (0x3e) plen 42
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Scan response - SCAN_RSP (0x04)
        Address type: Public (0x00)
        Address: A0:E6:F8:4A:AE:AD (Texas Instruments)
        Data length: 30
        Name (complete): Akai LPK25 Wireless
        Slave Conn. Interval: 0x000a - 0x0014
        TX power: 0 dBm
        RSSI: -67 dBm (0xbd)
-- 8< --

> One thing that I can think of is that Pair Device should return a
> reasonable error code so that bluetoothd can detect non-supported
> pairing and treat it as non-bonded device. Best would be a full btmon
> -w trace.log trace with a recent kernel that also monitors mgmt
> commands and events.

I've attached the full trace, but I think this is the interesting
section:

-- >8 --
@ MGMT Command: Pair Device (0x0019) plen 8
        LE Address: A0:E6:F8:4A:AE:AD (Texas Instruments)
        Capability: KeyboardDisplay (0x04)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11
      SMP: Pairing Request (0x01) len 6
        IO capability: KeyboardDisplay (0x04)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, MITM, SC, No Keypresses, CT2 (0x2d)
        Max encryption key size: 16
        Initiator key distribution: EncKey Sign LinkKey (0x0d)
        Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 6
      SMP: Pairing Failed (0x05) len 1
        Reason: Pairing not supported (0x05)
@ MGMT Event: Authentication Failed (0x0011) plen 8
        LE Address: A0:E6:F8:4A:AE:AD (Texas Instruments)
        Status: Authentication Failed (0x05)
@ MGMT Event: Command Complete (0x0001) plen 10
      Pair Device (0x0019) plen 7
        Status: Authentication Failed (0x05)
        LE Address: A0:E6:F8:4A:AE:AD (Texas Instruments)
< HCI Command: Disconnect (0x01|0x0006) plen 3
        Handle: 3585
        Reason: Authentication Failure (0x05)
> HCI Event: Command Status (0x0f) plen 4
      Disconnect (0x01|0x0006) ncmd 1
        Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4
        Status: Success (0x00)
        Handle: 3585
        Reason: Connection Terminated By Local Host (0x16)
@ MGMT Event: Device Disconnected (0x000c) plen 8
        LE Address: A0:E6:F8:4A:AE:AD (Texas Instruments)
        Reason: Connection terminated by local host (0x02)
-- 8< --


Regards,
John

[-- Attachment #2: lpk25.log --]
[-- Type: application/octet-stream, Size: 4333 bytes --]

  reply	other threads:[~2017-05-22 11:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 14:45 Determining whether a Bluetooth device supports pairing John Keeping
2017-05-18 14:56 ` Marcel Holtmann
2017-05-22 11:15   ` John Keeping [this message]
2017-05-23 14:33     ` Marcel Holtmann

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=20170522121503.126355ed.john@metanate.com \
    --to=john@metanate.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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