Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / device / bluetooth / bluetooth_classic_device_mac.h
blob16bfea8ec132788f3fbaad0b227cc886b957199a
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
3 // found in the LICENSE file.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_
8 #import <IOBluetooth/IOBluetooth.h>
10 #include <string>
12 #include "base/basictypes.h"
13 #include "base/mac/scoped_nsobject.h"
14 #include "base/observer_list.h"
15 #include "device/bluetooth/bluetooth_device_mac.h"
17 @class IOBluetoothDevice;
19 namespace device {
21 class BluetoothAdapterMac;
23 class BluetoothClassicDeviceMac : public BluetoothDeviceMac {
24 public:
25 explicit BluetoothClassicDeviceMac(BluetoothAdapterMac* adapter,
26 IOBluetoothDevice* device);
27 ~BluetoothClassicDeviceMac() override;
29 // BluetoothDevice override
30 uint32 GetBluetoothClass() const override;
31 std::string GetAddress() const override;
32 VendorIDSource GetVendorIDSource() const override;
33 uint16 GetVendorID() const override;
34 uint16 GetProductID() const override;
35 uint16 GetDeviceID() const override;
36 bool IsPaired() const override;
37 bool IsConnected() const override;
38 bool IsGattConnected() const override;
39 bool IsConnectable() const override;
40 bool IsConnecting() const override;
41 UUIDList GetUUIDs() const override;
42 int16 GetInquiryRSSI() const override;
43 int16 GetInquiryTxPower() const override;
44 bool ExpectingPinCode() const override;
45 bool ExpectingPasskey() const override;
46 bool ExpectingConfirmation() const override;
47 void GetConnectionInfo(const ConnectionInfoCallback& callback) override;
48 void Connect(PairingDelegate* pairing_delegate,
49 const base::Closure& callback,
50 const ConnectErrorCallback& error_callback) override;
51 void SetPinCode(const std::string& pincode) override;
52 void SetPasskey(uint32 passkey) override;
53 void ConfirmPairing() override;
54 void RejectPairing() override;
55 void CancelPairing() override;
56 void Disconnect(const base::Closure& callback,
57 const ErrorCallback& error_callback) override;
58 void Forget(const ErrorCallback& error_callback) override;
59 void ConnectToService(
60 const BluetoothUUID& uuid,
61 const ConnectToServiceCallback& callback,
62 const ConnectToServiceErrorCallback& error_callback) override;
63 void ConnectToServiceInsecurely(
64 const BluetoothUUID& uuid,
65 const ConnectToServiceCallback& callback,
66 const ConnectToServiceErrorCallback& error_callback) override;
67 void CreateGattConnection(
68 const GattConnectionCallback& callback,
69 const ConnectErrorCallback& error_callback) override;
71 // BluetoothDeviceMac override.
72 NSDate* GetLastUpdateTime() const override;
74 // Returns the Bluetooth address for the |device|. The returned address has a
75 // normalized format (see below).
76 static std::string GetDeviceAddress(IOBluetoothDevice* device);
78 protected:
79 // BluetoothDevice override
80 std::string GetDeviceName() const override;
81 void CreateGattConnectionImpl() override;
82 void DisconnectGatt() override;
84 private:
85 friend class BluetoothAdapterMac;
87 // Implementation to read the host's transmit power level of type
88 // |power_level_type|.
89 int GetHostTransmitPower(
90 BluetoothHCITransmitPowerLevelType power_level_type) const;
92 base::scoped_nsobject<IOBluetoothDevice> device_;
94 DISALLOW_COPY_AND_ASSIGN(BluetoothClassicDeviceMac);
97 } // namespace device
99 #endif // DEVICE_BLUETOOTH_BLUETOOTH_CLASSIC_DEVICE_MAC_H_