Remove chromeos==0 blacklist for test_isolation_mode.
[chromium-blink-merge.git] / device / bluetooth / bluetooth_low_energy_device_mac.h
blob5fa43355c83eb3967560df43b9edb3a41d1e7e13
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
3 // found in the LICENSE file.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
8 #if defined(OS_IOS)
9 #import <CoreBluetooth/CoreBluetooth.h>
10 #else
11 #import <IOBluetooth/IOBluetooth.h>
12 #endif
14 #include "base/mac/scoped_nsobject.h"
15 #include "base/mac/sdk_forward_declarations.h"
16 #include "device/bluetooth/bluetooth_device.h"
18 namespace device {
20 class BluetoothLowEnergyDiscoverManagerMac;
22 class BluetoothLowEnergyDeviceMac : public BluetoothDevice {
23 public:
24 BluetoothLowEnergyDeviceMac(CBPeripheral* peripheral,
25 NSDictionary* advertisementData,
26 int rssi);
27 ~BluetoothLowEnergyDeviceMac() override;
29 int GetRSSI() const;
31 // BluetoothDevice overrides.
32 std::string GetIdentifier() const override;
33 uint32 GetBluetoothClass() const override;
34 std::string GetAddress() const override;
35 BluetoothDevice::VendorIDSource GetVendorIDSource() const override;
36 uint16 GetVendorID() const override;
37 uint16 GetProductID() const override;
38 uint16 GetDeviceID() const override;
39 bool IsPaired() const override;
40 bool IsConnected() const override;
41 bool IsConnectable() const override;
42 bool IsConnecting() const override;
43 BluetoothDevice::UUIDList GetUUIDs() const override;
44 int16 GetInquiryRSSI() const override;
45 int16 GetInquiryTxPower() const override;
46 bool ExpectingPinCode() const override;
47 bool ExpectingPasskey() const override;
48 bool ExpectingConfirmation() const override;
49 void GetConnectionInfo(const ConnectionInfoCallback& callback) override;
50 void Connect(PairingDelegate* pairing_delegate,
51 const base::Closure& callback,
52 const ConnectErrorCallback& error_callback) override;
53 void SetPinCode(const std::string& pincode) override;
54 void SetPasskey(uint32 passkey) override;
55 void ConfirmPairing() override;
56 void RejectPairing() override;
57 void CancelPairing() override;
58 void Disconnect(const base::Closure& callback,
59 const ErrorCallback& error_callback) override;
60 void Forget(const ErrorCallback& error_callback) override;
61 void ConnectToService(
62 const BluetoothUUID& uuid,
63 const ConnectToServiceCallback& callback,
64 const ConnectToServiceErrorCallback& error_callback) override;
65 void ConnectToServiceInsecurely(
66 const device::BluetoothUUID& uuid,
67 const ConnectToServiceCallback& callback,
68 const ConnectToServiceErrorCallback& error_callback) override;
69 void CreateGattConnection(
70 const GattConnectionCallback& callback,
71 const ConnectErrorCallback& error_callback) override;
73 protected:
74 // BluetoothDevice override.
75 std::string GetDeviceName() const override;
77 // Updates information about the device.
78 virtual void Update(CBPeripheral* peripheral,
79 NSDictionary* advertisementData,
80 int rssi);
82 static std::string GetPeripheralIdentifier(CBPeripheral* peripheral);
84 private:
85 friend class BluetoothAdapterMac;
87 // CoreBluetooth data structure.
88 base::scoped_nsobject<CBPeripheral> peripheral_;
90 // RSSI value.
91 int rssi_;
93 // Whether the device is connectable.
94 bool connectable_;
96 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac);
99 } // namespace device
101 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_