All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Mccrae <Jamie.Mccrae@lairdtech.com>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: RE: Getting the address type of a  BLE device
Date: Fri, 14 Oct 2016 12:54:51 +0000	[thread overview]
Message-ID: <5EFE62F1AC977B4F94A5BA55F4D506333BF4DC07@DEDC01MBX02.corp.lairdtech.com> (raw)
In-Reply-To: <20161009145208.GA9550@x1c.P-661HNU-F1>

Hi Johan,

> The LE & BR/EDR D-Bus interface proposal from Szymon (that I mentioned in my earlier email) would likely be the cleanest way to do this.

Do you have a link to this proposal?

> What API does Qt use to connect? The first connection to LE devices is usually either through the Pair() or Connect() D-Bus method. Neither one requires knowledge of the address type. After the initial connection re-connections are typically done through passive background scanning by the kernel, and in this case the application also doesn't need knowledge of the address type.

Qt is using the DBus API but it seems they don't store the device handles/IDs and instead when connecting to a device just require the Bluetooth address (which is why this would be failing as it's not using the kernels cached entries and is specifically setting if it's connecting to a random address or public address before passing it to BlueZ)

> If you're not bonded there's no way to protect against other devices spoofing the address of the real device,

True, I was just referring to at the moment being unable to extract the address type.

> That's only true for BR/EDR Security Mode 4, and even that has some exceptions like SDP.

I'm not sure I follow you? BLE does not require any bonding unless mandated by the service/characteristics. It's possible to have many BLE devices and have them all interacting without any of them ever bonding with another device, yes this means there is no encryption or security but in some instances it is not required.

> I suppose you're referring to the Address property on the Device1 interface? It'd be help understand what exactly your concern is if you could be more specific in this regard. I'll assume you're talking about the Address property. This property was originally created for BR/EDR devices and probably isn't that useful for LE where you need to know the random vs public information. The new LE-specific D-Bus interface talked about earlier would provide this missing info.

I think the confusion comes from how we envisage the address type. When I think of the address type I think of it as part of the BLE address itself and prepend it to the address so with 00:11:22:33:44:55:66 the 00 is indicating that it is a public address and with 01:11:22:33:44:55:66 the 01 is indicating that it is a random address.

Thanks,
Jamie

  reply	other threads:[~2016-10-14 12:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 14:49 Getting the address type of a BLE device Jamie Mccrae
2016-10-07 21:02 ` Emil Lenngren
2016-10-08  6:04 ` Johan Hedberg
2016-10-08 11:21   ` Jamie Mccrae
2016-10-09 14:52     ` Johan Hedberg
2016-10-14 12:54       ` Jamie Mccrae [this message]
2016-10-14 14:58         ` Johan Hedberg

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=5EFE62F1AC977B4F94A5BA55F4D506333BF4DC07@DEDC01MBX02.corp.lairdtech.com \
    --to=jamie.mccrae@lairdtech.com \
    --cc=johan.hedberg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.