| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 BluetoothAdapterMac* GetMacAdapter(); | 121 BluetoothAdapterMac* GetMacAdapter(); |
| 122 | 122 |
| 123 // Returns the CoreBluetooth Peripheral. | 123 // Returns the CoreBluetooth Peripheral. |
| 124 CBPeripheral* GetPeripheral(); | 124 CBPeripheral* GetPeripheral(); |
| 125 | 125 |
| 126 // Returns BluetoothRemoteGattServiceMac based on the CBService. | 126 // Returns BluetoothRemoteGattServiceMac based on the CBService. |
| 127 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService( | 127 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService( |
| 128 CBService* service) const; | 128 CBService* service) const; |
| 129 | 129 |
| 130 // Callback used when the CoreBluetooth Peripheral is disconnected. | 130 // Callback used when the CoreBluetooth Peripheral is disconnected. |
| 131 void DidDisconnectPeripheral(); |
| 131 void DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode error_code); | 132 void DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode error_code); |
| 132 | 133 |
| 134 // Remove all services. |
| 135 void RemoveAllServices(); |
| 136 |
| 133 // CoreBluetooth data structure. | 137 // CoreBluetooth data structure. |
| 134 base::scoped_nsobject<CBPeripheral> peripheral_; | 138 base::scoped_nsobject<CBPeripheral> peripheral_; |
| 135 | 139 |
| 136 // Objective-C delegate for the CBPeripheral. | 140 // Objective-C delegate for the CBPeripheral. |
| 137 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> | 141 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> |
| 138 peripheral_delegate_; | 142 peripheral_delegate_; |
| 139 | 143 |
| 140 // RSSI value. | 144 // RSSI value. |
| 141 int rssi_; | 145 int rssi_; |
| 142 | 146 |
| 143 // Whether the device is connectable. | 147 // Whether the device is connectable. |
| 144 bool connectable_; | 148 bool connectable_; |
| 145 | 149 |
| 146 // The peripheral's identifier, as returned by [CBPeripheral identifier]. | 150 // The peripheral's identifier, as returned by [CBPeripheral identifier]. |
| 147 std::string identifier_; | 151 std::string identifier_; |
| 148 | 152 |
| 149 // A local address for the device created by hashing the peripheral | 153 // A local address for the device created by hashing the peripheral |
| 150 // identifier. | 154 // identifier. |
| 151 std::string hash_address_; | 155 std::string hash_address_; |
| 152 | 156 |
| 153 // The services (identified by UUIDs) that this device provides. | 157 // The services (identified by UUIDs) that this device provides. |
| 154 std::set<BluetoothUUID> advertised_uuids_; | 158 std::set<BluetoothUUID> advertised_uuids_; |
| 155 | 159 |
| 156 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); | 160 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); |
| 157 }; | 161 }; |
| 158 | 162 |
| 159 } // namespace device | 163 } // namespace device |
| 160 | 164 |
| 161 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 165 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
| OLD | NEW |