Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3168)

Unified Diff: device/bluetooth/bluetooth_device.h

Issue 2205693003: bluetooth: Replace old advertised uuids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Improve comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_adapter_unittest.cc ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.h
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index d7dc0300e7f967e3ee3b8dc22b1a437e6734bf43..8b4c5b0018f11595db363041b4df3fb9814c5371 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -288,11 +288,21 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
// such as vendor and product id.
bool IsTrustable() const;
- // Returns the set of UUIDs that this device supports. For classic Bluetooth
- // devices this data is collected from both the EIR data and SDP tables,
- // for Low Energy devices this data is collected from AD and GATT primary
- // services, for dual mode devices this may be collected from both./
- virtual UUIDList GetUUIDs() const = 0;
+ // Returns the set of UUIDs that this device supports.
+ // * For classic Bluetooth devices this data is collected from both the EIR
+ // data and SDP tables.
+ // * For non-connected Low Energy Devices this returns the latest advertised
+ // UUIDs.
+ // * For connected Low Energy Devices for which services have not been
+ // discovered returns an empty list.
+ // * For connected Low Energy Devices for which services have been discovered
+ // returns the UUIDs of the device's services.
+ // * For dual mode devices this may be collected from both.
+ //
+ // Note: On ChromeOS and Linux, Bluez persists all services meaning if
+ // a device stops advertising a service this function will still return
+ // its UUID.
+ virtual UUIDList GetUUIDs() const;
// The received signal strength, in dBm. This field is avaliable and valid
// only during discovery. If not during discovery, or RSSI wasn't reported,
@@ -492,6 +502,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
protected:
// BluetoothGattConnection is a friend to call Add/RemoveGattConnection.
friend BluetoothGattConnection;
+ FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetUUIDs);
FRIEND_TEST_ALL_PREFIXES(
BluetoothTest,
BluetoothGattConnection_DisconnectGatt_SimulateConnect);
@@ -536,6 +547,8 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
void AddGattConnection(BluetoothGattConnection*);
void RemoveGattConnection(BluetoothGattConnection*);
+ void UpdateServiceUUIDs();
+
// Clears the list of service data.
void ClearServiceData();
@@ -565,6 +578,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
GattServiceMap gatt_services_;
bool gatt_services_discovery_complete_;
+ // Last advertised service UUIDs. Should be empty if the device is connected.
+ UUIDList advertised_uuids_;
+ // UUIDs of the device's services. Should be empty if the device is not
+ // connected or it's services have not been discovered yet.
+ UUIDList service_uuids_;
+
// Mapping from service UUID represented as a std::string of a bluetooth
// service to
// the specific data. The data is stored as BinaryValue.
« no previous file with comments | « device/bluetooth/bluetooth_adapter_unittest.cc ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698