| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Returns the Device ID of the device, typically the release or version | 225 // Returns the Device ID of the device, typically the release or version |
| 226 // number in BCD format, where available. | 226 // number in BCD format, where available. |
| 227 virtual uint16_t GetDeviceID() const = 0; | 227 virtual uint16_t GetDeviceID() const = 0; |
| 228 | 228 |
| 229 // Returns the appearance of the device. | 229 // Returns the appearance of the device. |
| 230 virtual uint16_t GetAppearance() const = 0; | 230 virtual uint16_t GetAppearance() const = 0; |
| 231 | 231 |
| 232 // Returns the name of the device suitable for displaying, this may | 232 // Returns the name of the device suitable for displaying, this may |
| 233 // be a synthesized string containing the address and localized type name | 233 // be a synthesized string containing the address and localized type name |
| 234 // if the device has no obtained name. | 234 // if the device has no obtained name. |
| 235 virtual base::string16 GetName() const; | 235 virtual base::string16 GetNameForDisplay() const; |
| 236 | 236 |
| 237 // Returns the type of the device, limited to those we support or are | 237 // Returns the type of the device, limited to those we support or are |
| 238 // aware of, by decoding the bluetooth class information. The returned | 238 // aware of, by decoding the bluetooth class information. The returned |
| 239 // values are unique, and do not overlap, so DEVICE_KEYBOARD is not also | 239 // values are unique, and do not overlap, so DEVICE_KEYBOARD is not also |
| 240 // DEVICE_PERIPHERAL. | 240 // DEVICE_PERIPHERAL. |
| 241 // | 241 // |
| 242 // Returns the type of the device, limited to those we support or are aware | 242 // Returns the type of the device, limited to those we support or are aware |
| 243 // of, by decoding the bluetooth class information for Classic devices or | 243 // of, by decoding the bluetooth class information for Classic devices or |
| 244 // by decoding the device's appearance for LE devices. For example, | 244 // by decoding the device's appearance for LE devices. For example, |
| 245 // Microsoft Universal Foldable Keyboard only advertises the appearance. | 245 // Microsoft Universal Foldable Keyboard only advertises the appearance. |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 BluetoothTest, | 481 BluetoothTest, |
| 482 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect); | 482 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect); |
| 483 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, | 483 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, |
| 484 BluetoothGattConnection_ErrorAfterConnection); | 484 BluetoothGattConnection_ErrorAfterConnection); |
| 485 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, | 485 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, |
| 486 BluetoothGattConnection_DisconnectGatt_Cleanup); | 486 BluetoothGattConnection_DisconnectGatt_Cleanup); |
| 487 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetDeviceName_NullName); | 487 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetDeviceName_NullName); |
| 488 | 488 |
| 489 BluetoothDevice(BluetoothAdapter* adapter); | 489 BluetoothDevice(BluetoothAdapter* adapter); |
| 490 | 490 |
| 491 // Returns the internal name of the Bluetooth device, used by GetName(). | 491 // Returns the internal name of the Bluetooth device, used by |
| 492 // GetNameForDisplay(). |
| 492 virtual std::string GetDeviceName() const = 0; | 493 virtual std::string GetDeviceName() const = 0; |
| 493 | 494 |
| 494 // Implements platform specific operations to initiate a GATT connection. | 495 // Implements platform specific operations to initiate a GATT connection. |
| 495 // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or | 496 // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or |
| 496 // DidDisconnectGatt immediately or asynchronously as the connection state | 497 // DidDisconnectGatt immediately or asynchronously as the connection state |
| 497 // changes. | 498 // changes. |
| 498 virtual void CreateGattConnectionImpl() = 0; | 499 virtual void CreateGattConnectionImpl() = 0; |
| 499 | 500 |
| 500 // Disconnects GATT connection on platforms that maintain a specific GATT | 501 // Disconnects GATT connection on platforms that maintain a specific GATT |
| 501 // connection. | 502 // connection. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 | 553 |
| 553 private: | 554 private: |
| 554 // Returns a localized string containing the device's bluetooth address and | 555 // Returns a localized string containing the device's bluetooth address and |
| 555 // a device type for display when |name_| is empty. | 556 // a device type for display when |name_| is empty. |
| 556 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 557 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 557 }; | 558 }; |
| 558 | 559 |
| 559 } // namespace device | 560 } // namespace device |
| 560 | 561 |
| 561 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 562 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |