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

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: owners Created 4 years, 7 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 465422075c4a87d1c00cb06a9d32f25a437bbd18..073e33f02e550aae541e33749a09fab8e23cd85e 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(
« no previous file with comments | « device/bluetooth/bluez/bluetooth_adapter_bluez.h ('k') | device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698