| 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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "device/bluetooth/bluetooth_export.h" | |
| 17 #include "device/bluetooth/bluetooth_uuid.h" | 16 #include "device/bluetooth/bluetooth_uuid.h" |
| 18 #include "net/base/net_log.h" | 17 #include "net/base/net_log.h" |
| 19 | 18 |
| 20 namespace device { | 19 namespace device { |
| 21 | 20 |
| 22 class BluetoothGattConnection; | 21 class BluetoothGattConnection; |
| 23 class BluetoothGattService; | 22 class BluetoothGattService; |
| 24 class BluetoothSocket; | 23 class BluetoothSocket; |
| 25 class BluetoothUUID; | 24 class BluetoothUUID; |
| 26 | 25 |
| 27 // BluetoothDevice represents a remote Bluetooth device, both its properties and | 26 // BluetoothDevice represents a remote Bluetooth device, both its properties and |
| 28 // capabilities as discovered by a local adapter and actions that may be | 27 // capabilities as discovered by a local adapter and actions that may be |
| 29 // performed on the remove device such as pairing, connection and disconnection. | 28 // performed on the remove device such as pairing, connection and disconnection. |
| 30 // | 29 // |
| 31 // The class is instantiated and managed by the BluetoothAdapter class | 30 // The class is instantiated and managed by the BluetoothAdapter class |
| 32 // and pointers should only be obtained from that class and not cached, | 31 // and pointers should only be obtained from that class and not cached, |
| 33 // instead use the GetAddress() method as a unique key for a device. | 32 // instead use the GetAddress() method as a unique key for a device. |
| 34 // | 33 // |
| 35 // Since the lifecycle of BluetoothDevice instances is managed by | 34 // Since the lifecycle of BluetoothDevice instances is managed by |
| 36 // BluetoothAdapter, that class rather than this provides observer methods | 35 // BluetoothAdapter, that class rather than this provides observer methods |
| 37 // for devices coming and going, as well as properties being updated. | 36 // for devices coming and going, as well as properties being updated. |
| 38 class DEVICE_BLUETOOTH_EXPORT BluetoothDevice { | 37 class BluetoothDevice { |
| 39 public: | 38 public: |
| 40 // Possible values that may be returned by GetVendorIDSource(), | 39 // Possible values that may be returned by GetVendorIDSource(), |
| 41 // indicating different organisations that allocate the identifiers returned | 40 // indicating different organisations that allocate the identifiers returned |
| 42 // by GetVendorID(). | 41 // by GetVendorID(). |
| 43 enum VendorIDSource { | 42 enum VendorIDSource { |
| 44 VENDOR_ID_UNKNOWN, | 43 VENDOR_ID_UNKNOWN, |
| 45 VENDOR_ID_BLUETOOTH, | 44 VENDOR_ID_BLUETOOTH, |
| 46 VENDOR_ID_USB | 45 VENDOR_ID_USB |
| 47 }; | 46 }; |
| 48 | 47 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 416 |
| 418 private: | 417 private: |
| 419 // Returns a localized string containing the device's bluetooth address and | 418 // Returns a localized string containing the device's bluetooth address and |
| 420 // a device type for display when |name_| is empty. | 419 // a device type for display when |name_| is empty. |
| 421 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 420 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 422 }; | 421 }; |
| 423 | 422 |
| 424 } // namespace device | 423 } // namespace device |
| 425 | 424 |
| 426 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 425 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |