| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Callback used when the CoreBluetooth Peripheral is disconnected. | 133 // Callback used when the CoreBluetooth Peripheral is disconnected. |
| 134 void DidDisconnectPeripheral(NSError* error); | 134 void DidDisconnectPeripheral(NSError* error); |
| 135 | 135 |
| 136 // CoreBluetooth data structure. | 136 // CoreBluetooth data structure. |
| 137 base::scoped_nsobject<CBPeripheral> peripheral_; | 137 base::scoped_nsobject<CBPeripheral> peripheral_; |
| 138 | 138 |
| 139 // Objective-C delegate for the CBPeripheral. | 139 // Objective-C delegate for the CBPeripheral. |
| 140 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> | 140 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> |
| 141 peripheral_delegate_; | 141 peripheral_delegate_; |
| 142 | 142 |
| 143 // Whether the device is connectable. | |
| 144 bool connectable_; | |
| 145 | |
| 146 // The peripheral's identifier, as returned by [CBPeripheral identifier]. | 143 // The peripheral's identifier, as returned by [CBPeripheral identifier]. |
| 147 std::string identifier_; | 144 std::string identifier_; |
| 148 | 145 |
| 149 // A local address for the device created by hashing the peripheral | 146 // A local address for the device created by hashing the peripheral |
| 150 // identifier. | 147 // identifier. |
| 151 std::string hash_address_; | 148 std::string hash_address_; |
| 152 | 149 |
| 153 // Increases each time -[CBPeripheral discoverServices:] is called, and | 150 // Increases each time -[CBPeripheral discoverServices:] is called, and |
| 154 // decreases each time DidDiscoverPrimaryServices() is called. Once the | 151 // decreases each time DidDiscoverPrimaryServices() is called. Once the |
| 155 // value is set to 0, characteristics and properties are discovered. | 152 // value is set to 0, characteristics and properties are discovered. |
| 156 int discovery_pending_count_; | 153 int discovery_pending_count_; |
| 157 | 154 |
| 158 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); | 155 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); |
| 159 }; | 156 }; |
| 160 | 157 |
| 161 // Stream operator for logging. | 158 // Stream operator for logging. |
| 162 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( | 159 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( |
| 163 std::ostream& out, | 160 std::ostream& out, |
| 164 const BluetoothLowEnergyDeviceMac& device); | 161 const BluetoothLowEnergyDeviceMac& device); |
| 165 | 162 |
| 166 } // namespace device | 163 } // namespace device |
| 167 | 164 |
| 168 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 165 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
| OLD | NEW |