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

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: Fix mac 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
Index: device/bluetooth/bluetooth_device.h
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index d7dc0300e7f967e3ee3b8dc22b1a437e6734bf43..d7a54af34b8da5fdce748f81d76ba95353bebd55 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -290,9 +290,16 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
// 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;
+ // For non-connected Low Energy Devices this returns the latest advertised
scheib 2016/08/05 18:49:31 optional: * Use some bullets. * There are a few ca
ortuno 2016/08/05 23:00:17 Done.
+ // UUIDs. For Low Energy connected devices for which services have been
+ // discovered we return the UUIDs of the device's services. If the services
+ // have not been discovered yet we return an empty list.
+ // 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 +499,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);
@@ -565,6 +573,8 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
GattServiceMap gatt_services_;
bool gatt_services_discovery_complete_;
+ std::unordered_set<BluetoothUUID, BluetoothUUIDHash> advertised_uuids_;
scheib 2016/08/05 18:49:31 optional... we already have the code to gather all
ortuno 2016/08/08 22:56:39 Done. Forgot to mark this done the first time.
+
// Mapping from service UUID represented as a std::string of a bluetooth
// service to
// the specific data. The data is stored as BinaryValue.

Powered by Google App Engine
This is Rietveld 408576698