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

Unified Diff: device/bluetooth/bluez/bluetooth_adapter_bluez.cc

Issue 1920353002: Implement create attribute API functions for BTLE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api_changes
Patch Set: Created 4 years, 8 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/bluez/bluetooth_adapter_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
index 60dc8cc3d4f0189cb417d444d404bcde4208b045..bf483f347b06e2489ba83b7d6139cbe9bd324eb9 100644
--- a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
@@ -423,6 +423,13 @@ void BluetoothAdapterBlueZ::RegisterAdvertisement(
advertisement->Register(base::Bind(callback, advertisement), error_callback);
}
+device::BluetoothLocalGattService* BluetoothAdapterBlueZ::GetGattService(
+ const std::string& identifier) const {
+ const auto& service = owned_gatt_services_.find(dbus::ObjectPath(identifier));
+ return service == owned_gatt_services_.end() ? nullptr
+ : service->second.get();
+}
+
void BluetoothAdapterBlueZ::RemovePairingDelegateInternal(
BluetoothDevice::PairingDelegate* pairing_delegate) {
// Check if any device is using the pairing delegate.
@@ -1061,7 +1068,7 @@ void BluetoothAdapterBlueZ::RemoveProfile(const BluetoothUUID& uuid) {
void BluetoothAdapterBlueZ::AddLocalGattService(
std::unique_ptr<BluetoothLocalGattServiceBlueZ> service) {
- owned_gatt_services_.push_back(std::move(service));
+ owned_gatt_services_[service->object_path()] = std::move(service);
}
void BluetoothAdapterBlueZ::RegisterGattService(

Powered by Google App Engine
This is Rietveld 408576698