| 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 |
| 407 // Returns the list of discovered GATT services. | 413 // Returns the list of discovered GATT services. |
| 408 virtual std::vector<BluetoothGattService*> GetGattServices() const; | 414 virtual std::vector<BluetoothGattService*> GetGattServices() const; |
| 409 | 415 |
| 410 // Returns the GATT service with device-specific identifier |identifier|. | 416 // Returns the GATT service with device-specific identifier |identifier|. |
| 411 // Returns NULL, if no such service exists. | 417 // Returns NULL, if no such service exists. |
| 412 virtual BluetoothGattService* GetGattService( | 418 virtual BluetoothGattService* GetGattService( |
| 413 const std::string& identifier) const; | 419 const std::string& identifier) const; |
| 414 | 420 |
| 415 protected: | 421 protected: |
| 416 BluetoothDevice(); | 422 BluetoothDevice(); |
| 417 | 423 |
| 418 // Returns the internal name of the Bluetooth device, used by GetName(). | 424 // Returns the internal name of the Bluetooth device, used by GetName(). |
| 419 virtual std::string GetDeviceName() const = 0; | 425 virtual std::string GetDeviceName() const = 0; |
| 420 | 426 |
| 421 // Mapping from the platform-specific GATT service identifiers to | 427 // Mapping from the platform-specific GATT service identifiers to |
| 422 // BluetoothGattService objects. | 428 // BluetoothGattService objects. |
| 423 typedef std::map<std::string, BluetoothGattService*> GattServiceMap; | 429 typedef std::map<std::string, BluetoothGattService*> GattServiceMap; |
| 424 GattServiceMap gatt_services_; | 430 GattServiceMap gatt_services_; |
| 425 | 431 |
| 426 private: | 432 private: |
| 427 // Returns a localized string containing the device's bluetooth address and | 433 // Returns a localized string containing the device's bluetooth address and |
| 428 // a device type for display when |name_| is empty. | 434 // a device type for display when |name_| is empty. |
| 429 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 435 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 430 }; | 436 }; |
| 431 | 437 |
| 432 } // namespace device | 438 } // namespace device |
| 433 | 439 |
| 434 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 440 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |