OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CLASSIC_DEVICE_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_ |
7 | 7 |
8 #import <IOBluetooth/IOBluetooth.h> | 8 #import <IOBluetooth/IOBluetooth.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/time/time.h" |
16 #include "device/bluetooth/bluetooth_device_mac.h" | 17 #include "device/bluetooth/bluetooth_device_mac.h" |
17 | 18 |
18 @class IOBluetoothDevice; | 19 @class IOBluetoothDevice; |
19 | 20 |
20 namespace device { | 21 namespace device { |
21 | 22 |
22 class BluetoothAdapterMac; | 23 class BluetoothAdapterMac; |
23 | 24 |
24 class BluetoothClassicDeviceMac : public BluetoothDeviceMac { | 25 class BluetoothClassicDeviceMac : public BluetoothDeviceMac { |
25 public: | 26 public: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const ConnectToServiceCallback& callback, | 65 const ConnectToServiceCallback& callback, |
65 const ConnectToServiceErrorCallback& error_callback) override; | 66 const ConnectToServiceErrorCallback& error_callback) override; |
66 void ConnectToServiceInsecurely( | 67 void ConnectToServiceInsecurely( |
67 const BluetoothUUID& uuid, | 68 const BluetoothUUID& uuid, |
68 const ConnectToServiceCallback& callback, | 69 const ConnectToServiceCallback& callback, |
69 const ConnectToServiceErrorCallback& error_callback) override; | 70 const ConnectToServiceErrorCallback& error_callback) override; |
70 void CreateGattConnection( | 71 void CreateGattConnection( |
71 const GattConnectionCallback& callback, | 72 const GattConnectionCallback& callback, |
72 const ConnectErrorCallback& error_callback) override; | 73 const ConnectErrorCallback& error_callback) override; |
73 | 74 |
74 // BluetoothDeviceMac override. | 75 base::Time GetLastUpdateTime() const; |
75 NSDate* GetLastUpdateTime() const override; | |
76 | 76 |
77 // Returns the Bluetooth address for the |device|. The returned address has a | 77 // Returns the Bluetooth address for the |device|. The returned address has a |
78 // normalized format (see below). | 78 // normalized format (see below). |
79 static std::string GetDeviceAddress(IOBluetoothDevice* device); | 79 static std::string GetDeviceAddress(IOBluetoothDevice* device); |
80 | 80 |
81 protected: | 81 protected: |
82 // BluetoothDevice override | 82 // BluetoothDevice override |
83 std::string GetDeviceName() const override; | 83 std::string GetDeviceName() const override; |
84 void CreateGattConnectionImpl() override; | 84 void CreateGattConnectionImpl() override; |
85 void DisconnectGatt() override; | 85 void DisconnectGatt() override; |
86 | 86 |
87 private: | 87 private: |
88 friend class BluetoothAdapterMac; | 88 friend class BluetoothAdapterMac; |
89 | 89 |
90 // Implementation to read the host's transmit power level of type | 90 // Implementation to read the host's transmit power level of type |
91 // |power_level_type|. | 91 // |power_level_type|. |
92 int GetHostTransmitPower( | 92 int GetHostTransmitPower( |
93 BluetoothHCITransmitPowerLevelType power_level_type) const; | 93 BluetoothHCITransmitPowerLevelType power_level_type) const; |
94 | 94 |
95 base::scoped_nsobject<IOBluetoothDevice> device_; | 95 base::scoped_nsobject<IOBluetoothDevice> device_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(BluetoothClassicDeviceMac); | 97 DISALLOW_COPY_AND_ASSIGN(BluetoothClassicDeviceMac); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace device | 100 } // namespace device |
101 | 101 |
102 #endif // DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_ | 102 #endif // DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_ |
OLD | NEW |