| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
| 7 | 7 |
| 8 #if defined(OS_IOS) | 8 #if defined(OS_IOS) |
| 9 #import <CoreBluetooth/CoreBluetooth.h> | 9 #import <CoreBluetooth/CoreBluetooth.h> |
| 10 #else // !defined(OS_IOS) | 10 #else // !defined(OS_IOS) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 const ErrorCallback& error_callback) override; | 76 const ErrorCallback& error_callback) override; |
| 77 void ConnectToService( | 77 void ConnectToService( |
| 78 const BluetoothUUID& uuid, | 78 const BluetoothUUID& uuid, |
| 79 const ConnectToServiceCallback& callback, | 79 const ConnectToServiceCallback& callback, |
| 80 const ConnectToServiceErrorCallback& error_callback) override; | 80 const ConnectToServiceErrorCallback& error_callback) override; |
| 81 void ConnectToServiceInsecurely( | 81 void ConnectToServiceInsecurely( |
| 82 const device::BluetoothUUID& uuid, | 82 const device::BluetoothUUID& uuid, |
| 83 const ConnectToServiceCallback& callback, | 83 const ConnectToServiceCallback& callback, |
| 84 const ConnectToServiceErrorCallback& error_callback) override; | 84 const ConnectToServiceErrorCallback& error_callback) override; |
| 85 | 85 |
| 86 // BluetoothDeviceMac override. | |
| 87 NSDate* GetLastUpdateTime() const override; | |
| 88 | |
| 89 protected: | 86 protected: |
| 90 // BluetoothDevice override. | 87 // BluetoothDevice override. |
| 91 std::string GetDeviceName() const override; | 88 std::string GetDeviceName() const override; |
| 92 void CreateGattConnectionImpl() override; | 89 void CreateGattConnectionImpl() override; |
| 93 void DisconnectGatt() override; | 90 void DisconnectGatt() override; |
| 94 | 91 |
| 95 // Methods used by BluetoothLowEnergyPeripheralBridge. | 92 // Methods used by BluetoothLowEnergyPeripheralBridge. |
| 96 void DidDiscoverPrimaryServices(NSError* error); | 93 void DidDiscoverPrimaryServices(NSError* error); |
| 97 void DidModifyServices(NSArray* invalidatedServices); | 94 void DidModifyServices(NSArray* invalidatedServices); |
| 98 | 95 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Whether the device is connectable. | 136 // Whether the device is connectable. |
| 140 bool connectable_; | 137 bool connectable_; |
| 141 | 138 |
| 142 // The peripheral's identifier, as returned by [CBPeripheral identifier]. | 139 // The peripheral's identifier, as returned by [CBPeripheral identifier]. |
| 143 std::string identifier_; | 140 std::string identifier_; |
| 144 | 141 |
| 145 // A local address for the device created by hashing the peripheral | 142 // A local address for the device created by hashing the peripheral |
| 146 // identifier. | 143 // identifier. |
| 147 std::string hash_address_; | 144 std::string hash_address_; |
| 148 | 145 |
| 149 // Stores the time of the most recent call to Update(). | |
| 150 base::scoped_nsobject<NSDate> last_update_time_; | |
| 151 | |
| 152 // The services (identified by UUIDs) that this device provides. | 146 // The services (identified by UUIDs) that this device provides. |
| 153 std::set<BluetoothUUID> advertised_uuids_; | 147 std::set<BluetoothUUID> advertised_uuids_; |
| 154 | 148 |
| 155 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); | 149 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); |
| 156 }; | 150 }; |
| 157 | 151 |
| 158 } // namespace device | 152 } // namespace device |
| 159 | 153 |
| 160 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 154 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
| OLD | NEW |