| 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 9f2ca5c57c914a3833e529cbec144f7305ee532f..a23f165c9dcbe0809feead6226bac1e5e319eb12 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().
|
| NSDate* last_update_time = nil;
|
|
|
|
|