| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 const base::Closure& callback, | 74 const base::Closure& callback, |
| 75 const ErrorCallback& error_callback) OVERRIDE; | 75 const ErrorCallback& error_callback) OVERRIDE; |
| 76 virtual void StartConnectionMonitor( | 76 virtual void StartConnectionMonitor( |
| 77 const base::Closure& callback, | 77 const base::Closure& callback, |
| 78 const ErrorCallback& error_callback) OVERRIDE; | 78 const ErrorCallback& error_callback) OVERRIDE; |
| 79 | 79 |
| 80 // Returns the Bluetooth address for the |device|. The returned address has a | 80 // Returns the Bluetooth address for the |device|. The returned address has a |
| 81 // normalized format (see below). | 81 // normalized format (see below). |
| 82 static std::string GetDeviceAddress(IOBluetoothDevice* device); | 82 static std::string GetDeviceAddress(IOBluetoothDevice* device); |
| 83 | 83 |
| 84 // Returns the address formatted according to Chrome's expectations rather | |
| 85 // than per the system convention: octets are separated by colons rather than | |
| 86 // by dashes. That is, the returned format is XX:XX:XX:XX:XX:XX rather than | |
| 87 // xx-xx-xx-xx-xx-xx. | |
| 88 static std::string NormalizeAddress(const std::string& address); | |
| 89 | |
| 90 protected: | 84 protected: |
| 91 // BluetoothDevice override | 85 // BluetoothDevice override |
| 92 virtual std::string GetDeviceName() const OVERRIDE; | 86 virtual std::string GetDeviceName() const OVERRIDE; |
| 93 | 87 |
| 94 private: | 88 private: |
| 95 friend class BluetoothAdapterMac; | 89 friend class BluetoothAdapterMac; |
| 96 | 90 |
| 97 // Implementation to read the host's transmit power level of type | 91 // Implementation to read the host's transmit power level of type |
| 98 // |power_level_type|. | 92 // |power_level_type|. |
| 99 int GetHostTransmitPower( | 93 int GetHostTransmitPower( |
| 100 BluetoothHCITransmitPowerLevelType power_level_type) const; | 94 BluetoothHCITransmitPowerLevelType power_level_type) const; |
| 101 | 95 |
| 102 // List of observers interested in event notifications from us. | 96 // List of observers interested in event notifications from us. |
| 103 ObserverList<Observer> observers_; | 97 ObserverList<Observer> observers_; |
| 104 | 98 |
| 105 base::scoped_nsobject<IOBluetoothDevice> device_; | 99 base::scoped_nsobject<IOBluetoothDevice> device_; |
| 106 | 100 |
| 107 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); | 101 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); |
| 108 }; | 102 }; |
| 109 | 103 |
| 110 } // namespace device | 104 } // namespace device |
| 111 | 105 |
| 112 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ | 106 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
| OLD | NEW |