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 eb330ee637f3812f7ec475d8fd28596caaf88853..552f4f03e01d27e7926ced3c683da1a0d4299131 100644 |
--- a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc |
+++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc |
@@ -150,6 +150,17 @@ void SetIntervalErrorCallbackConnector( |
error_callback.Run(code); |
} |
+void ResetAdvertisingErrorCallbackConnector( |
+ const device::BluetoothAdapter::AdvertisementErrorCallback& error_callback, |
+ const std::string& error_name, |
+ const std::string& error_message) { |
+ BLUETOOTH_LOG(ERROR) << "Error while resetting advertising. error_name = " |
+ << error_name << ", error_message = " << error_message; |
+ |
+ error_callback.Run( |
+ device::BluetoothAdvertisement::ErrorCode::ERROR_RESET_ADVERTISING); |
+} |
+ |
} // namespace |
// static |
@@ -522,6 +533,17 @@ void BluetoothAdapterBlueZ::SetAdvertisingInterval( |
base::Bind(&SetIntervalErrorCallbackConnector, error_callback)); |
} |
+void BluetoothAdapterBlueZ::ResetAdvertising( |
+ const base::Closure& callback, |
+ const AdvertisementErrorCallback& error_callback) { |
+ DCHECK(bluez::BluezDBusManager::Get()); |
+ bluez::BluezDBusManager::Get() |
+ ->GetBluetoothLEAdvertisingManagerClient() |
+ ->ResetAdvertising( |
+ object_path_, callback, |
+ base::Bind(&ResetAdvertisingErrorCallbackConnector, error_callback)); |
+} |
+ |
device::BluetoothLocalGattService* BluetoothAdapterBlueZ::GetGattService( |
const std::string& identifier) const { |
const auto& service = owned_gatt_services_.find(dbus::ObjectPath(identifier)); |