确定私有的可解析蓝牙 LE 地址 [英] Determine private resolvable Bluetooth LE address

查看:34
本文介绍了确定私有的可解析蓝牙 LE 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个应用程序,它使用 UWP 类来提供 GATT-Server(即我的笔记本电脑用作 BLE 外设).

I have written an application that uses the UWP classes to offer a GATT-Server (i. e. my laptop functions as a BLE peripheral).

我可以成功地发布、连接和使用它,但有一点我想不通:我如何才能找到中央正在查看的当前私有可解析地址?

I can successfully advertise, connect, and use it, but there's one thing I cannot figure out: how can I find out the current private resolvable address that the central is seeing?

我的蓝牙适配器似乎具有内部地址 9C:B6:D0:XX:YY:ZZ.我可以通过多种方式找到并确认该地址:

My bluetooth adapter appears to have the internal address 9C:B6:D0:XX:YY:ZZ. I can find and confirm that address in various ways:

  • BluetoothAdapter.GetDefaultAsync().AsTask().Result.BluetoothAddress.ToString(X12") 返回 9CB6D0XXYYZZ" 作为结果在视觉工作室.
  • 如果我在任何读取请求处理程序中添加断点,则 GattReadRequestedEventArgs.Session.DeviceId.Id"BluetoothLE#BluetoothLE9c:b6:d0:xx:yy:zz-gg:hh:ii:jj:kk:ll".
  • 设备管理器>蓝牙 >{设备名称} >属性 >高级显示9c:b6:d0:xx:yy:zz.
  • BluetoothAdapter.GetDefaultAsync().AsTask().Result.BluetoothAddress.ToString("X12") returns "9CB6D0XXYYZZ" as result in the direct window of Visual Studio.
  • If I add a breakpoint in any read request handler, then GattReadRequestedEventArgs.Session.DeviceId.Id is "BluetoothLE#BluetoothLE9c:b6:d0:xx:yy:zz-gg:hh:ii:jj:kk:ll".
  • Device Manager > Bluetooth > {Device Name} > Properties > Advanced shows 9c:b6:d0:xx:yy:zz.

我正在使用nRF Connect"适用于 Android 的应用程序连接到我的人工外围设备并对其 BLE 服务和特性进行操作,并且效果很好.然而,nRF Connect 显示的地址是不同的,例如5F:69:8A:DD:C9:ED".每次我重新启动 GATT-Server 时它也会改变.

I'm using the "nRF Connect" app for Android to connect to my artificial peripheral and operate on its BLE services and characteristics, and it works great. However, the address that nRF Connect shows is a different one, for example "5F:69:8A:DD:C9:ED". It also changes every time I restart the GATT-Server.

我想这是一个私有的可解析地址,用于出于隐私原因隐藏实际适配器的地址.但是我似乎无法从 GATT 服务器中的代码中找到确定该地址的方法.我所知道的是它既不是 BluetoothAdapter.BluetoothAddress,也不是 GattReadRequestedEventArgs.Session.DeviceId.Id 的一部分,因为两者都只包含从不改变的内部地址,以及 gg:hh:ii:jj:kk:ll 上面提到的部分是另一个地址(但不是 nRF Connect 显示的那个).

I suppose this is a private resolvable address, used to hide the actual adapter's address for privacy reasons. But I cannot seem to find a way to determine that address from the code in the GATT server. All I know is that it is neither the BluetoothAdapter.BluetoothAddress, nor part of the GattReadRequestedEventArgs.Session.DeviceId.Id, because both contain only the internal address that never changes, and the gg:hh:ii:jj:kk:ll part mentioned above is yet another address (but not the one nRF Connect shows).

推荐答案

确定私有的可解析蓝牙 LE 地址

Determine private resolvable Bluetooth LE address

对于 API 地址和私有轮换地址.API 返回一个静态地址,广告包含私有旋转地址.UWP 中无法获取私有轮换地址,这是设计使然.

For API Address and the Private Rotating Address. The API returns a Static Address and the advertisement contains the private Rotating Address. There is no way in UWP to get the private rotating address and this is by design.

这篇关于确定私有的可解析蓝牙 LE 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆