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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 const base::Closure& callback, | 362 const base::Closure& callback, |
363 const ErrorCallback& error_callback) = 0; | 363 const ErrorCallback& error_callback) = 0; |
364 | 364 |
365 // Clears the Out Of Band pairing data for this device. Exactly one of | 365 // Clears the Out Of Band pairing data for this device. Exactly one of |
366 // |callback| or |error_callback| will be run. | 366 // |callback| or |error_callback| will be run. |
367 virtual void ClearOutOfBandPairingData( | 367 virtual void ClearOutOfBandPairingData( |
368 const base::Closure& callback, | 368 const base::Closure& callback, |
369 const ErrorCallback& error_callback) = 0; | 369 const ErrorCallback& error_callback) = 0; |
370 | 370 |
371 // Returns the list of discovered GATT services. | 371 // Returns the list of discovered GATT services. |
372 std::vector<BluetoothGattService*> GetGattServices() const; | 372 virtual std::vector<BluetoothGattService*> GetGattServices() const; |
373 | 373 |
374 // Returns the GATT service with device-specific identifier |identifier|. | 374 // Returns the GATT service with device-specific identifier |identifier|. |
375 // Returns NULL, if no such service exists. | 375 // Returns NULL, if no such service exists. |
376 BluetoothGattService* GetGattService(const std::string& identifier) const; | 376 virtual BluetoothGattService* GetGattService( |
| 377 const std::string& identifier) const; |
377 | 378 |
378 protected: | 379 protected: |
379 BluetoothDevice(); | 380 BluetoothDevice(); |
380 | 381 |
381 // Returns the internal name of the Bluetooth device, used by GetName(). | 382 // Returns the internal name of the Bluetooth device, used by GetName(). |
382 virtual std::string GetDeviceName() const = 0; | 383 virtual std::string GetDeviceName() const = 0; |
383 | 384 |
384 // Mapping from the platform-specific GATT service identifiers to | 385 // Mapping from the platform-specific GATT service identifiers to |
385 // BluetoothGattService objects. | 386 // BluetoothGattService objects. |
386 typedef std::map<std::string, BluetoothGattService*> GattServiceMap; | 387 typedef std::map<std::string, BluetoothGattService*> GattServiceMap; |
387 GattServiceMap gatt_services_; | 388 GattServiceMap gatt_services_; |
388 | 389 |
389 private: | 390 private: |
390 // Returns a localized string containing the device's bluetooth address and | 391 // Returns a localized string containing the device's bluetooth address and |
391 // a device type for display when |name_| is empty. | 392 // a device type for display when |name_| is empty. |
392 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 393 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
393 }; | 394 }; |
394 | 395 |
395 } // namespace device | 396 } // namespace device |
396 | 397 |
397 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 398 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
OLD | NEW |