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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 friend class BluetoothAdapterMacTest; | 106 friend class BluetoothAdapterMacTest; |
107 friend class BluetoothTestMac; | 107 friend class BluetoothTestMac; |
108 | 108 |
109 // Returns the Bluetooth adapter. | 109 // Returns the Bluetooth adapter. |
110 BluetoothAdapterMac* GetMacAdapter(); | 110 BluetoothAdapterMac* GetMacAdapter(); |
111 | 111 |
112 // Returns the CoreBluetooth Peripheral. | 112 // Returns the CoreBluetooth Peripheral. |
113 CBPeripheral* GetPeripheral(); | 113 CBPeripheral* GetPeripheral(); |
114 | 114 |
115 // Callback used when the CoreBluetooth Peripheral is disconnected. | 115 // Callback used when the CoreBluetooth Peripheral is disconnected. |
116 void DidDisconnectPeripheral(); | 116 void DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode error_code); |
117 | 117 |
118 // Called by the adapter when CoreBluetooth calls CBCentralManager's delegate. | 118 // Called by the adapter when CoreBluetooth calls CBCentralManager's delegate. |
119 void GattConnected(); | 119 void GattConnected(); |
120 | 120 |
121 // Equivalent to [peripheral_ state]. Allows compilation on OS X 10.6. | 121 // Equivalent to [peripheral_ state]. Allows compilation on OS X 10.6. |
122 CBPeripheralState GetPeripheralState() const; | 122 CBPeripheralState GetPeripheralState() const; |
123 | 123 |
124 // CoreBluetooth data structure. | 124 // CoreBluetooth data structure. |
125 base::scoped_nsobject<CBPeripheral> peripheral_; | 125 base::scoped_nsobject<CBPeripheral> peripheral_; |
126 | 126 |
(...skipping 15 matching lines...) Expand all Loading... |
142 | 142 |
143 // The services (identified by UUIDs) that this device provides. | 143 // The services (identified by UUIDs) that this device provides. |
144 std::set<BluetoothUUID> advertised_uuids_; | 144 std::set<BluetoothUUID> advertised_uuids_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); | 146 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); |
147 }; | 147 }; |
148 | 148 |
149 } // namespace device | 149 } // namespace device |
150 | 150 |
151 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 151 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
OLD | NEW |