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_DEVICE_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "device/bluetooth/bluetooth_device.h" | 9 #include "device/bluetooth/bluetooth_device.h" |
10 | 10 |
11 @class NSDate; | 11 @class NSDate; |
12 | 12 |
13 namespace device { | 13 namespace device { |
14 | 14 |
15 class BluetoothAdapterMac; | 15 class BluetoothAdapterMac; |
16 | 16 |
17 class BluetoothDeviceMac : public BluetoothDevice { | 17 class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceMac : public BluetoothDevice { |
18 public: | 18 public: |
19 ~BluetoothDeviceMac() override; | 19 ~BluetoothDeviceMac() override; |
20 | 20 |
21 // Returns the time of the most recent interaction with the device. Returns | 21 // Returns the time of the most recent interaction with the device. Returns |
22 // nil if the device has never been seen. | 22 // nil if the device has never been seen. |
23 virtual NSDate* GetLastUpdateTime() const = 0; | 23 virtual NSDate* GetLastUpdateTime() const = 0; |
24 | 24 |
| 25 // Converts between ConnectErrorCode and NSError. |
| 26 static NSError* GetNSErrorFromConnectErrorCode( |
| 27 BluetoothDevice::ConnectErrorCode error_code); |
| 28 static BluetoothDevice::ConnectErrorCode GetConnectErrorCodeFromNSError( |
| 29 NSError* error); |
| 30 |
25 protected: | 31 protected: |
26 BluetoothDeviceMac(BluetoothAdapterMac* adapter); | 32 BluetoothDeviceMac(BluetoothAdapterMac* adapter); |
27 | 33 |
28 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); | 34 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); |
29 }; | 35 }; |
30 | 36 |
31 } // namespace device | 37 } // namespace device |
32 | 38 |
33 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ | 39 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
OLD | NEW |