简体   繁体   中英

Determine private resolvable Bluetooth LE address

I have written an application that uses the UWP classes to offer a GATT-Server (ie 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?

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") 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 .

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.

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).

Determine private resolvable Bluetooth LE address

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM