问题
I want to store information about BLE device locally, but I cannot rely on MAC address because it changes too often. Is there any way to do that?
回答1:
The Bluetooth address is the best way you can distinguish between devices. This is mentioned in the Bluetooth specification as follows [1]:
Devices are identified using a device address. Device addresses may be either a public device address or a random device address. A public device address and a random device address are both 48 bits in length
As Mike mentioned, there are a few types of MAC Addresses and the one that is changing is not the one that you want to look at. The Bluetooth specification identifies the following addresses:-
- Public Address: This is a unique address created in accordance with IEEE 802-2014 Standard. For you this is the Address relevant to your answer.
- Random Static Address: This is a randomly generated address that does not change unless the device is power cycled. Therefore, if your device is not power cycled you can use this address to identify it.
- Private Resolvable Address: This is a changing MAC address (with the frequency of the change depending on the application) that can be resolved and associated with the device's unique address if the IRK is known (i.e. if the devices are paired).
- Private Non-resolvable Address: This is a changing MAC address (with the frequency of the change depending on the application) that cannot be resolved nor associated with the device's unique address. This kind of address is usually used for security reasons when a device only advertises.
For more information, please see the reference below.
I hope this helps.
[1] Bluetooth Core Specification Version 5.0, Vol 6, Part B, Section 1.3 DEVICE ADDRESS.
来源:https://stackoverflow.com/questions/54241052/is-there-any-way-to-uniquely-identify-ble-device