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

Side by Side Diff: device/bluetooth/bluetooth_device_bluez.cc

Issue 1862093002: bluetooth: replace GattServices D-Bus property with ServicesResolved (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bluetooth: replace GattServices D-Bus property with ServicesResolved 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_device_bluez.h" 5 #include "device/bluetooth/bluetooth_device_bluez.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 return properties->alias.value(); 200 return properties->alias.value();
201 } 201 }
202 202
203 void BluetoothDeviceBlueZ::CreateGattConnectionImpl() { 203 void BluetoothDeviceBlueZ::CreateGattConnectionImpl() {
204 // BlueZ implementation does not use the default CreateGattConnection 204 // BlueZ implementation does not use the default CreateGattConnection
205 // implementation. 205 // implementation.
206 NOTIMPLEMENTED(); 206 NOTIMPLEMENTED();
207 } 207 }
208 208
209 void BluetoothDeviceBlueZ::SetGattServicesDiscoveryComplete(bool complete) {
210 // BlueZ implementation already tracks service discovery state.
211 NOTIMPLEMENTED();
212 }
213
214 bool BluetoothDeviceBlueZ::IsGattServicesDiscoveryComplete() const {
215 bluez::BluetoothDeviceClient::Properties* properties =
216 bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
217 object_path_);
218 DCHECK(properties);
219
220 return properties->services_resolved.value();
221 }
222
209 void BluetoothDeviceBlueZ::DisconnectGatt() { 223 void BluetoothDeviceBlueZ::DisconnectGatt() {
210 Disconnect(base::Bind(&base::DoNothing), base::Bind(&base::DoNothing)); 224 Disconnect(base::Bind(&base::DoNothing), base::Bind(&base::DoNothing));
211 } 225 }
212 226
213 std::string BluetoothDeviceBlueZ::GetAddress() const { 227 std::string BluetoothDeviceBlueZ::GetAddress() const {
214 bluez::BluetoothDeviceClient::Properties* properties = 228 bluez::BluetoothDeviceClient::Properties* properties =
215 bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties( 229 bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
216 object_path_); 230 object_path_);
217 DCHECK(properties); 231 DCHECK(properties);
218 232
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, 789 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback,
776 const std::string& error_name, 790 const std::string& error_name,
777 const std::string& error_message) { 791 const std::string& error_message) {
778 LOG(WARNING) << object_path_.value() 792 LOG(WARNING) << object_path_.value()
779 << ": Failed to remove device: " << error_name << ": " 793 << ": Failed to remove device: " << error_name << ": "
780 << error_message; 794 << error_message;
781 error_callback.Run(); 795 error_callback.Run();
782 } 796 }
783 797
784 } // namespace bluez 798 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698