OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // The BluetoothOutOfBandPairingDataCallback is used to return | 94 // The BluetoothOutOfBandPairingDataCallback is used to return |
95 // BluetoothOutOfBandPairingData to the caller. | 95 // BluetoothOutOfBandPairingData to the caller. |
96 typedef base::Callback<void(const BluetoothOutOfBandPairingData& data)> | 96 typedef base::Callback<void(const BluetoothOutOfBandPairingData& data)> |
97 BluetoothOutOfBandPairingDataCallback; | 97 BluetoothOutOfBandPairingDataCallback; |
98 | 98 |
99 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", | 99 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", |
100 // where each XX is a hexadecimal number. | 100 // where each XX is a hexadecimal number. |
101 const std::string& address() const { return address_; } | 101 const std::string& address() const { return address_; } |
102 | 102 |
| 103 // The name of the adapter. |
| 104 const std::string& name() const { return name_; } |
| 105 |
103 // Indicates whether the adapter is actually present on the system, for | 106 // Indicates whether the adapter is actually present on the system, for |
104 // the default adapter this indicates whether any adapter is present. | 107 // the default adapter this indicates whether any adapter is present. |
105 virtual bool IsPresent() const; | 108 virtual bool IsPresent() const; |
106 | 109 |
107 // Indicates whether the adapter radio is powered. | 110 // Indicates whether the adapter radio is powered. |
108 virtual bool IsPowered() const; | 111 virtual bool IsPowered() const; |
109 | 112 |
110 // Requests a change to the adapter radio power, setting |powered| to true | 113 // Requests a change to the adapter radio power, setting |powered| to true |
111 // will turn on the radio and false will turn it off. On success, callback | 114 // will turn on the radio and false will turn it off. On success, callback |
112 // will be called. On failure, |error_callback| will be called. | 115 // will be called. On failure, |error_callback| will be called. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 312 |
310 // Object path of adapter for this instance, this is fixed at creation time | 313 // Object path of adapter for this instance, this is fixed at creation time |
311 // unless |track_default_| is true in which case we update it to always | 314 // unless |track_default_| is true in which case we update it to always |
312 // point at the default adapter. | 315 // point at the default adapter. |
313 bool track_default_; | 316 bool track_default_; |
314 dbus::ObjectPath object_path_; | 317 dbus::ObjectPath object_path_; |
315 | 318 |
316 // Address of the adapter. | 319 // Address of the adapter. |
317 std::string address_; | 320 std::string address_; |
318 | 321 |
| 322 // Name of the adapter. |
| 323 std::string name_; |
| 324 |
319 // Tracked adapter state, cached locally so we only send change notifications | 325 // Tracked adapter state, cached locally so we only send change notifications |
320 // to observers on a genuine change. | 326 // to observers on a genuine change. |
321 bool powered_; | 327 bool powered_; |
322 bool discovering_; | 328 bool discovering_; |
323 | 329 |
324 // Devices paired with, connected to, discovered by, or visible to the | 330 // Devices paired with, connected to, discovered by, or visible to the |
325 // adapter. The key is the Bluetooth address of the device and the value | 331 // adapter. The key is the Bluetooth address of the device and the value |
326 // is the BluetoothDevice object whose lifetime is managed by the adapter | 332 // is the BluetoothDevice object whose lifetime is managed by the adapter |
327 // instance. | 333 // instance. |
328 typedef std::map<const std::string, BluetoothDevice*> DevicesMap; | 334 typedef std::map<const std::string, BluetoothDevice*> DevicesMap; |
329 DevicesMap devices_; | 335 DevicesMap devices_; |
330 | 336 |
331 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapter); | 337 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapter); |
332 }; | 338 }; |
333 | 339 |
334 } // namespace chromeos | 340 } // namespace chromeos |
335 | 341 |
336 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 342 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |