Chromium Code Reviews| 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 DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 const BluetoothOutOfBandPairingData& data, | 397 const BluetoothOutOfBandPairingData& data, |
| 398 const base::Closure& callback, | 398 const base::Closure& callback, |
| 399 const ErrorCallback& error_callback) = 0; | 399 const ErrorCallback& error_callback) = 0; |
| 400 | 400 |
| 401 // Clears the Out Of Band pairing data for this device. Exactly one of | 401 // Clears the Out Of Band pairing data for this device. Exactly one of |
| 402 // |callback| or |error_callback| will be run. | 402 // |callback| or |error_callback| will be run. |
| 403 virtual void ClearOutOfBandPairingData( | 403 virtual void ClearOutOfBandPairingData( |
| 404 const base::Closure& callback, | 404 const base::Closure& callback, |
| 405 const ErrorCallback& error_callback) = 0; | 405 const ErrorCallback& error_callback) = 0; |
| 406 | 406 |
| 407 // Starts monitoring the connection properties, RSSI and TX power. These | |
| 408 // properties will be tracked, and updated when their values change. Exactly | |
| 409 // one of |callback| or |error_callback| will be run. | |
| 410 virtual void StartConnectionMonitor(const base::Closure& callback, | |
| 411 const ErrorCallback& error_callback) = 0; | |
| 412 | |
| 413 // Stops monitoring the connection properties. Exactly one of |callback| or | |
| 414 // |error_callback| will be run. | |
| 415 virtual void StopConnectionMonitor(const base::Closure& callback, | |
| 416 const ErrorCallback& error_callback) = 0; | |
| 417 | |
|
keybuk
2014/05/09 22:37:21
NAK... we've been burned by these Start/Stop APIs
Tim Song
2014/05/09 23:10:43
Can I just have StartConnectionMonitor for now (no
| |
| 407 // Returns the list of discovered GATT services. | 418 // Returns the list of discovered GATT services. |
| 408 virtual std::vector<BluetoothGattService*> GetGattServices() const; | 419 virtual std::vector<BluetoothGattService*> GetGattServices() const; |
| 409 | 420 |
| 410 // Returns the GATT service with device-specific identifier |identifier|. | 421 // Returns the GATT service with device-specific identifier |identifier|. |
| 411 // Returns NULL, if no such service exists. | 422 // Returns NULL, if no such service exists. |
| 412 virtual BluetoothGattService* GetGattService( | 423 virtual BluetoothGattService* GetGattService( |
| 413 const std::string& identifier) const; | 424 const std::string& identifier) const; |
| 414 | 425 |
| 415 protected: | 426 protected: |
| 416 BluetoothDevice(); | 427 BluetoothDevice(); |
| 417 | 428 |
| 418 // Returns the internal name of the Bluetooth device, used by GetName(). | 429 // Returns the internal name of the Bluetooth device, used by GetName(). |
| 419 virtual std::string GetDeviceName() const = 0; | 430 virtual std::string GetDeviceName() const = 0; |
| 420 | 431 |
| 421 // Mapping from the platform-specific GATT service identifiers to | 432 // Mapping from the platform-specific GATT service identifiers to |
| 422 // BluetoothGattService objects. | 433 // BluetoothGattService objects. |
| 423 typedef std::map<std::string, BluetoothGattService*> GattServiceMap; | 434 typedef std::map<std::string, BluetoothGattService*> GattServiceMap; |
| 424 GattServiceMap gatt_services_; | 435 GattServiceMap gatt_services_; |
| 425 | 436 |
| 426 private: | 437 private: |
| 427 // Returns a localized string containing the device's bluetooth address and | 438 // Returns a localized string containing the device's bluetooth address and |
| 428 // a device type for display when |name_| is empty. | 439 // a device type for display when |name_| is empty. |
| 429 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 440 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 430 }; | 441 }; |
| 431 | 442 |
| 432 } // namespace device | 443 } // namespace device |
| 433 | 444 |
| 434 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 445 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |