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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 BluetoothAdapterMac* GetMacAdapter(); | 113 BluetoothAdapterMac* GetMacAdapter(); |
114 | 114 |
115 // Returns the CoreBluetooth Peripheral. | 115 // Returns the CoreBluetooth Peripheral. |
116 CBPeripheral* GetPeripheral(); | 116 CBPeripheral* GetPeripheral(); |
117 | 117 |
118 // Returns BluetoothRemoteGattServiceMac based on the CBService. | 118 // Returns BluetoothRemoteGattServiceMac based on the CBService. |
119 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService( | 119 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService( |
120 CBService* service) const; | 120 CBService* service) const; |
121 | 121 |
122 // Callback used when the CoreBluetooth Peripheral is disconnected. | 122 // Callback used when the CoreBluetooth Peripheral is disconnected. |
123 void DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode error_code); | 123 void DidDisconnectPeripheral(NSError* error); |
124 | 124 |
125 // CoreBluetooth data structure. | 125 // CoreBluetooth data structure. |
126 base::scoped_nsobject<CBPeripheral> peripheral_; | 126 base::scoped_nsobject<CBPeripheral> peripheral_; |
127 | 127 |
128 // Objective-C delegate for the CBPeripheral. | 128 // Objective-C delegate for the CBPeripheral. |
129 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> | 129 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> |
130 peripheral_delegate_; | 130 peripheral_delegate_; |
131 | 131 |
132 // Whether the device is connectable. | 132 // Whether the device is connectable. |
133 bool connectable_; | 133 bool connectable_; |
134 | 134 |
135 // The peripheral's identifier, as returned by [CBPeripheral identifier]. | 135 // The peripheral's identifier, as returned by [CBPeripheral identifier]. |
136 std::string identifier_; | 136 std::string identifier_; |
137 | 137 |
138 // A local address for the device created by hashing the peripheral | 138 // A local address for the device created by hashing the peripheral |
139 // identifier. | 139 // identifier. |
140 std::string hash_address_; | 140 std::string hash_address_; |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); | 142 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); |
143 }; | 143 }; |
144 | 144 |
145 } // namespace device | 145 } // namespace device |
146 | 146 |
147 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 147 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
OLD | NEW |