| 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_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 #import <IOBluetooth/IOBluetooth.h> | 8 #import <IOBluetooth/IOBluetooth.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 explicit BluetoothDeviceMac(IOBluetoothDevice* device); | 23 explicit BluetoothDeviceMac(IOBluetoothDevice* device); |
| 24 ~BluetoothDeviceMac() override; | 24 ~BluetoothDeviceMac() override; |
| 25 | 25 |
| 26 // BluetoothDevice override | 26 // BluetoothDevice override |
| 27 uint32 GetBluetoothClass() const override; | 27 uint32 GetBluetoothClass() const override; |
| 28 std::string GetAddress() const override; | 28 std::string GetAddress() const override; |
| 29 VendorIDSource GetVendorIDSource() const override; | 29 VendorIDSource GetVendorIDSource() const override; |
| 30 uint16 GetVendorID() const override; | 30 uint16 GetVendorID() const override; |
| 31 uint16 GetProductID() const override; | 31 uint16 GetProductID() const override; |
| 32 uint16 GetDeviceID() const override; | 32 uint16 GetDeviceID() const override; |
| 33 int GetRSSI() const override; | |
| 34 int GetCurrentHostTransmitPower() const override; | |
| 35 int GetMaximumHostTransmitPower() const override; | |
| 36 bool IsPaired() const override; | 33 bool IsPaired() const override; |
| 37 bool IsConnected() const override; | 34 bool IsConnected() const override; |
| 38 bool IsConnectable() const override; | 35 bool IsConnectable() const override; |
| 39 bool IsConnecting() const override; | 36 bool IsConnecting() const override; |
| 40 UUIDList GetUUIDs() const override; | 37 UUIDList GetUUIDs() const override; |
| 41 bool ExpectingPinCode() const override; | 38 bool ExpectingPinCode() const override; |
| 42 bool ExpectingPasskey() const override; | 39 bool ExpectingPasskey() const override; |
| 43 bool ExpectingConfirmation() const override; | 40 bool ExpectingConfirmation() const override; |
| 41 void GetConnectionInfo(const ConnectionInfoCallback& callback) override; |
| 44 void Connect(PairingDelegate* pairing_delegate, | 42 void Connect(PairingDelegate* pairing_delegate, |
| 45 const base::Closure& callback, | 43 const base::Closure& callback, |
| 46 const ConnectErrorCallback& error_callback) override; | 44 const ConnectErrorCallback& error_callback) override; |
| 47 void SetPinCode(const std::string& pincode) override; | 45 void SetPinCode(const std::string& pincode) override; |
| 48 void SetPasskey(uint32 passkey) override; | 46 void SetPasskey(uint32 passkey) override; |
| 49 void ConfirmPairing() override; | 47 void ConfirmPairing() override; |
| 50 void RejectPairing() override; | 48 void RejectPairing() override; |
| 51 void CancelPairing() override; | 49 void CancelPairing() override; |
| 52 void Disconnect(const base::Closure& callback, | 50 void Disconnect(const base::Closure& callback, |
| 53 const ErrorCallback& error_callback) override; | 51 const ErrorCallback& error_callback) override; |
| 54 void Forget(const ErrorCallback& error_callback) override; | 52 void Forget(const ErrorCallback& error_callback) override; |
| 55 void ConnectToService( | 53 void ConnectToService( |
| 56 const BluetoothUUID& uuid, | 54 const BluetoothUUID& uuid, |
| 57 const ConnectToServiceCallback& callback, | 55 const ConnectToServiceCallback& callback, |
| 58 const ConnectToServiceErrorCallback& error_callback) override; | 56 const ConnectToServiceErrorCallback& error_callback) override; |
| 59 void ConnectToServiceInsecurely( | 57 void ConnectToServiceInsecurely( |
| 60 const BluetoothUUID& uuid, | 58 const BluetoothUUID& uuid, |
| 61 const ConnectToServiceCallback& callback, | 59 const ConnectToServiceCallback& callback, |
| 62 const ConnectToServiceErrorCallback& error_callback) override; | 60 const ConnectToServiceErrorCallback& error_callback) override; |
| 63 void CreateGattConnection( | 61 void CreateGattConnection( |
| 64 const GattConnectionCallback& callback, | 62 const GattConnectionCallback& callback, |
| 65 const ConnectErrorCallback& error_callback) override; | 63 const ConnectErrorCallback& error_callback) override; |
| 66 void StartConnectionMonitor(const base::Closure& callback, | |
| 67 const ErrorCallback& error_callback) override; | |
| 68 | 64 |
| 69 // Returns the timestamp when the device was last seen during an inquiry. | 65 // Returns the timestamp when the device was last seen during an inquiry. |
| 70 // Returns nil if the device has never been seen during an inquiry. | 66 // Returns nil if the device has never been seen during an inquiry. |
| 71 NSDate* GetLastInquiryUpdate(); | 67 NSDate* GetLastInquiryUpdate(); |
| 72 | 68 |
| 73 // Returns the Bluetooth address for the |device|. The returned address has a | 69 // Returns the Bluetooth address for the |device|. The returned address has a |
| 74 // normalized format (see below). | 70 // normalized format (see below). |
| 75 static std::string GetDeviceAddress(IOBluetoothDevice* device); | 71 static std::string GetDeviceAddress(IOBluetoothDevice* device); |
| 76 | 72 |
| 77 protected: | 73 protected: |
| 78 // BluetoothDevice override | 74 // BluetoothDevice override |
| 79 std::string GetDeviceName() const override; | 75 std::string GetDeviceName() const override; |
| 80 | 76 |
| 81 private: | 77 private: |
| 82 friend class BluetoothAdapterMac; | 78 friend class BluetoothAdapterMac; |
| 83 | 79 |
| 84 // Implementation to read the host's transmit power level of type | 80 // Implementation to read the host's transmit power level of type |
| 85 // |power_level_type|. | 81 // |power_level_type|. |
| 86 int GetHostTransmitPower( | 82 int GetHostTransmitPower( |
| 87 BluetoothHCITransmitPowerLevelType power_level_type) const; | 83 BluetoothHCITransmitPowerLevelType power_level_type) const; |
| 88 | 84 |
| 89 base::scoped_nsobject<IOBluetoothDevice> device_; | 85 base::scoped_nsobject<IOBluetoothDevice> device_; |
| 90 | 86 |
| 91 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); | 87 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); |
| 92 }; | 88 }; |
| 93 | 89 |
| 94 } // namespace device | 90 } // namespace device |
| 95 | 91 |
| 96 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ | 92 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
| OLD | NEW |