| Index: device/bluetooth/bluetooth_low_energy_device_mac.h
|
| diff --git a/device/bluetooth/bluetooth_low_energy_device_mac.h b/device/bluetooth/bluetooth_low_energy_device_mac.h
|
| index d8d62efc4d276da29463a10ac7d40eb9e5e7789e..5c517ed39e580f5f3aa40f0d9773a49dd8a61619 100644
|
| --- a/device/bluetooth/bluetooth_low_energy_device_mac.h
|
| +++ b/device/bluetooth/bluetooth_low_energy_device_mac.h
|
| @@ -13,13 +13,15 @@
|
|
|
| #include "base/mac/scoped_nsobject.h"
|
| #include "base/mac/sdk_forward_declarations.h"
|
| +#include "crypto/sha2.h"
|
| #include "device/bluetooth/bluetooth_device_mac.h"
|
|
|
| namespace device {
|
|
|
| class BluetoothLowEnergyDiscoverManagerMac;
|
|
|
| -class BluetoothLowEnergyDeviceMac : public BluetoothDeviceMac {
|
| +class DEVICE_BLUETOOTH_EXPORT BluetoothLowEnergyDeviceMac
|
| + : public BluetoothDeviceMac {
|
| public:
|
| BluetoothLowEnergyDeviceMac(CBPeripheral* peripheral,
|
| NSDictionary* advertisementData,
|
| @@ -84,8 +86,13 @@ class BluetoothLowEnergyDeviceMac : public BluetoothDeviceMac {
|
|
|
| static std::string GetPeripheralIdentifier(CBPeripheral* peripheral);
|
|
|
| + // Hashes and truncates the peripheral identifier to deterministically
|
| + // construct an address.
|
| + static std::string GetPeripheralHashAddress(CBPeripheral* peripheral);
|
| +
|
| private:
|
| friend class BluetoothAdapterMac;
|
| + friend class BluetoothAdapterMacTest;
|
|
|
| // CoreBluetooth data structure.
|
| base::scoped_nsobject<CBPeripheral> peripheral_;
|
| @@ -96,6 +103,13 @@ class BluetoothLowEnergyDeviceMac : public BluetoothDeviceMac {
|
| // Whether the device is connectable.
|
| bool connectable_;
|
|
|
| + // The peripheral's identifier, as returned by [CBPeripheral identifier].
|
| + std::string identifier_;
|
| +
|
| + // A local address for the device created by hashing the peripheral
|
| + // identifier.
|
| + std::string hash_address_;
|
| +
|
| // Stores the time of the most recent call to Update().
|
| base::scoped_nsobject<NSDate> last_update_time_;
|
|
|
|
|