Convert VLOG -> DVLOG in device/bluetooth/bluez
The Chromium C++ style guide recommends that DVLOG is used as it "avoids bloating the release executable and in debug can be selectively enabled at runtime". Bug: 519010 Change-Id: I1d896ea332426b8d3ec281a4b313221e8b8fb19d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2024251 Reviewed-by: Ovidio de Jesús Ruiz-Henríquez <odejesush@chromium.org> Commit-Queue: Md. Hasanur Rashid <hasanur.r@samsung.com> Cr-Commit-Position: refs/heads/master@{#735940}
This commit is contained in:

committed by
Commit Bot

parent
eaac25c228
commit
fe5cb8b0c4
device/bluetooth/bluez
bluetooth_adapter_profile_bluez.ccbluetooth_device_bluez.ccbluetooth_gatt_connection_bluez.ccbluetooth_local_gatt_characteristic_bluez.ccbluetooth_local_gatt_descriptor_bluez.ccbluetooth_local_gatt_service_bluez.ccbluetooth_pairing_bluez.ccbluetooth_remote_gatt_characteristic_bluez.ccbluetooth_remote_gatt_descriptor_bluez.ccbluetooth_remote_gatt_service_bluez.ccbluetooth_socket_bluez.cc
@ -29,7 +29,7 @@ void BluetoothAdapterProfileBlueZ::Register(
|
||||
std::unique_ptr<BluetoothAdapterProfileBlueZ> profile(
|
||||
new BluetoothAdapterProfileBlueZ(uuid));
|
||||
|
||||
VLOG(1) << "Registering profile: " << profile->object_path().value();
|
||||
DVLOG(1) << "Registering profile: " << profile->object_path().value();
|
||||
const dbus::ObjectPath& object_path = profile->object_path();
|
||||
bluez::BluezDBusManager::Get()
|
||||
->GetBluetoothProfileManagerClient()
|
||||
@ -58,8 +58,8 @@ bool BluetoothAdapterProfileBlueZ::SetDelegate(
|
||||
const dbus::ObjectPath& device_path,
|
||||
bluez::BluetoothProfileServiceProvider::Delegate* delegate) {
|
||||
DCHECK(delegate);
|
||||
VLOG(1) << "SetDelegate: " << object_path_.value() << " dev "
|
||||
<< device_path.value();
|
||||
DVLOG(1) << "SetDelegate: " << object_path_.value() << " dev "
|
||||
<< device_path.value();
|
||||
|
||||
if (delegates_.find(device_path.value()) != delegates_.end()) {
|
||||
return false;
|
||||
@ -72,8 +72,8 @@ bool BluetoothAdapterProfileBlueZ::SetDelegate(
|
||||
void BluetoothAdapterProfileBlueZ::RemoveDelegate(
|
||||
const dbus::ObjectPath& device_path,
|
||||
const base::Closure& unregistered_callback) {
|
||||
VLOG(1) << object_path_.value() << " dev " << device_path.value()
|
||||
<< ": RemoveDelegate";
|
||||
DVLOG(1) << object_path_.value() << " dev " << device_path.value()
|
||||
<< ": RemoveDelegate";
|
||||
|
||||
if (delegates_.find(device_path.value()) == delegates_.end())
|
||||
return;
|
||||
@ -83,7 +83,7 @@ void BluetoothAdapterProfileBlueZ::RemoveDelegate(
|
||||
if (delegates_.size() != 0)
|
||||
return;
|
||||
|
||||
VLOG(1) << device_path.value() << " No delegates left, unregistering.";
|
||||
DVLOG(1) << device_path.value() << " No delegates left, unregistering.";
|
||||
|
||||
// No users left, release the profile.
|
||||
bluez::BluezDBusManager::Get()
|
||||
@ -107,7 +107,7 @@ void BluetoothAdapterProfileBlueZ::OnUnregisterProfileError(
|
||||
|
||||
// bluez::BluetoothProfileServiceProvider::Delegate:
|
||||
void BluetoothAdapterProfileBlueZ::Released() {
|
||||
VLOG(1) << object_path_.value() << ": Release";
|
||||
DVLOG(1) << object_path_.value() << ": Release";
|
||||
}
|
||||
|
||||
void BluetoothAdapterProfileBlueZ::NewConnection(
|
||||
@ -121,8 +121,8 @@ void BluetoothAdapterProfileBlueZ::NewConnection(
|
||||
delegate_path = dbus::ObjectPath("");
|
||||
|
||||
if (delegates_.find(delegate_path.value()) == delegates_.end()) {
|
||||
VLOG(1) << object_path_.value() << ": New connection for device "
|
||||
<< device_path.value() << " which has no delegates!";
|
||||
DVLOG(1) << object_path_.value() << ": New connection for device "
|
||||
<< device_path.value() << " which has no delegates!";
|
||||
std::move(callback).Run(REJECTED);
|
||||
return;
|
||||
}
|
||||
@ -140,8 +140,8 @@ void BluetoothAdapterProfileBlueZ::RequestDisconnection(
|
||||
delegate_path = dbus::ObjectPath("");
|
||||
|
||||
if (delegates_.find(delegate_path.value()) == delegates_.end()) {
|
||||
VLOG(1) << object_path_.value() << ": RequestDisconnection for device "
|
||||
<< device_path.value() << " which has no delegates!";
|
||||
DVLOG(1) << object_path_.value() << ": RequestDisconnection for device "
|
||||
<< device_path.value() << " which has no delegates!";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ void BluetoothAdapterProfileBlueZ::RequestDisconnection(
|
||||
void BluetoothAdapterProfileBlueZ::Cancel() {
|
||||
// Cancel() should only go to a delegate accepting connections.
|
||||
if (delegates_.find("") == delegates_.end()) {
|
||||
VLOG(1) << object_path_.value() << ": Cancel with no delegate!";
|
||||
DVLOG(1) << object_path_.value() << ": Cancel with no delegate!";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -812,7 +812,7 @@ void BluetoothDeviceBlueZ::GattServiceRemoved(
|
||||
const dbus::ObjectPath& object_path) {
|
||||
auto iter = gatt_services_.find(object_path.value());
|
||||
if (iter == gatt_services_.end()) {
|
||||
VLOG(3) << "Unknown GATT service removed: " << object_path.value();
|
||||
DVLOG(3) << "Unknown GATT service removed: " << object_path.value();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -842,8 +842,8 @@ void BluetoothDeviceBlueZ::UpdateGattServices(
|
||||
|
||||
DCHECK(IsGattServicesDiscoveryComplete());
|
||||
|
||||
VLOG(3) << "Updating the list of GATT services associated with device "
|
||||
<< object_path_.value();
|
||||
DVLOG(3) << "Updating the list of GATT services associated with device "
|
||||
<< object_path_.value();
|
||||
|
||||
const std::vector<dbus::ObjectPath> service_paths =
|
||||
bluez::BluezDBusManager::Get()
|
||||
|
@ -52,7 +52,7 @@ bool BluetoothGattConnectionBlueZ::IsConnected() {
|
||||
|
||||
void BluetoothGattConnectionBlueZ::Disconnect() {
|
||||
if (!connected_) {
|
||||
VLOG(1) << "Connection already inactive.";
|
||||
DVLOG(1) << "Connection already inactive.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ BluetoothLocalGattCharacteristic::Create(
|
||||
return characteristic->weak_ptr_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
} // device
|
||||
} // namespace device
|
||||
|
||||
namespace bluez {
|
||||
|
||||
@ -48,8 +48,8 @@ BluetoothLocalGattCharacteristicBlueZ::BluetoothLocalGattCharacteristicBlueZ(
|
||||
properties_(properties),
|
||||
permissions_(permissions),
|
||||
service_(service) {
|
||||
VLOG(1) << "Creating local GATT characteristic with identifier: "
|
||||
<< GetIdentifier();
|
||||
DVLOG(1) << "Creating local GATT characteristic with identifier: "
|
||||
<< GetIdentifier();
|
||||
service->AddCharacteristic(base::WrapUnique(this));
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ BluetoothLocalGattDescriptor::Create(
|
||||
return descriptor->weak_ptr_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
} // device
|
||||
} // namespace device
|
||||
|
||||
namespace bluez {
|
||||
|
||||
@ -44,8 +44,8 @@ BluetoothLocalGattDescriptorBlueZ::BluetoothLocalGattDescriptorBlueZ(
|
||||
permissions_(permissions),
|
||||
characteristic_(characteristic) {
|
||||
DCHECK(characteristic->GetService());
|
||||
VLOG(1) << "Creating local GATT descriptor with identifier: "
|
||||
<< GetIdentifier();
|
||||
DVLOG(1) << "Creating local GATT descriptor with identifier: "
|
||||
<< GetIdentifier();
|
||||
characteristic->AddDescriptor(base::WrapUnique(this));
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,8 @@ BluetoothLocalGattServiceBlueZ::BluetoothLocalGattServiceBlueZ(
|
||||
uuid_(uuid),
|
||||
is_primary_(is_primary),
|
||||
delegate_(delegate) {
|
||||
VLOG(1) << "Creating local GATT service with identifier: " << GetIdentifier();
|
||||
DVLOG(1) << "Creating local GATT service with identifier: "
|
||||
<< GetIdentifier();
|
||||
adapter->AddLocalGattService(base::WrapUnique(this));
|
||||
}
|
||||
|
||||
|
@ -40,11 +40,11 @@ BluetoothPairingBlueZ::BluetoothPairingBlueZ(
|
||||
: device_(device),
|
||||
pairing_delegate_(pairing_delegate),
|
||||
pairing_delegate_used_(false) {
|
||||
VLOG(1) << "Created BluetoothPairingBlueZ for " << device_->GetAddress();
|
||||
DVLOG(1) << "Created BluetoothPairingBlueZ for " << device_->GetAddress();
|
||||
}
|
||||
|
||||
BluetoothPairingBlueZ::~BluetoothPairingBlueZ() {
|
||||
VLOG(1) << "Destroying BluetoothPairingBlueZ for " << device_->GetAddress();
|
||||
DVLOG(1) << "Destroying BluetoothPairingBlueZ for " << device_->GetAddress();
|
||||
|
||||
if (!pairing_delegate_used_) {
|
||||
UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
|
||||
|
@ -48,8 +48,8 @@ BluetoothRemoteGattCharacteristicBlueZ::BluetoothRemoteGattCharacteristicBlueZ(
|
||||
has_notify_session_(false),
|
||||
service_(service),
|
||||
num_of_characteristic_value_read_in_progress_(0) {
|
||||
VLOG(1) << "Creating remote GATT characteristic with identifier: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Creating remote GATT characteristic with identifier: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
bluez::BluezDBusManager::Get()
|
||||
->GetBluetoothGattDescriptorClient()
|
||||
->AddObserver(this);
|
||||
@ -155,9 +155,9 @@ bool BluetoothRemoteGattCharacteristicBlueZ::IsNotifying() const {
|
||||
void BluetoothRemoteGattCharacteristicBlueZ::ReadRemoteCharacteristic(
|
||||
ValueCallback callback,
|
||||
ErrorCallback error_callback) {
|
||||
VLOG(1) << "Sending GATT characteristic read request to characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value()
|
||||
<< ".";
|
||||
DVLOG(1) << "Sending GATT characteristic read request to characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value()
|
||||
<< ".";
|
||||
|
||||
DCHECK_GE(num_of_characteristic_value_read_in_progress_, 0);
|
||||
++num_of_characteristic_value_read_in_progress_;
|
||||
@ -175,9 +175,9 @@ void BluetoothRemoteGattCharacteristicBlueZ::WriteRemoteCharacteristic(
|
||||
const std::vector<uint8_t>& value,
|
||||
base::OnceClosure callback,
|
||||
ErrorCallback error_callback) {
|
||||
VLOG(1) << "Sending GATT characteristic write request to characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value()
|
||||
<< ", with value: " << value << ".";
|
||||
DVLOG(1) << "Sending GATT characteristic write request to characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value()
|
||||
<< ", with value: " << value << ".";
|
||||
|
||||
bluez::BluezDBusManager::Get()
|
||||
->GetBluetoothGattCharacteristicClient()
|
||||
@ -193,10 +193,10 @@ void BluetoothRemoteGattCharacteristicBlueZ::PrepareWriteRemoteCharacteristic(
|
||||
const std::vector<uint8_t>& value,
|
||||
base::OnceClosure callback,
|
||||
ErrorCallback error_callback) {
|
||||
VLOG(1) << "Sending GATT characteristic prepare write request to "
|
||||
<< "characteristic: " << GetIdentifier()
|
||||
<< ", UUID: " << GetUUID().canonical_value()
|
||||
<< ", with value: " << value << ".";
|
||||
DVLOG(1) << "Sending GATT characteristic prepare write request to "
|
||||
<< "characteristic: " << GetIdentifier()
|
||||
<< ", UUID: " << GetUUID().canonical_value()
|
||||
<< ", with value: " << value << ".";
|
||||
|
||||
bluez::BluezDBusManager::Get()
|
||||
->GetBluetoothGattCharacteristicClient()
|
||||
@ -251,8 +251,8 @@ void BluetoothRemoteGattCharacteristicBlueZ::UnsubscribeFromNotifications(
|
||||
void BluetoothRemoteGattCharacteristicBlueZ::GattDescriptorAdded(
|
||||
const dbus::ObjectPath& object_path) {
|
||||
if (descriptors_.find(object_path.value()) != descriptors_.end()) {
|
||||
VLOG(1) << "Remote GATT characteristic descriptor already exists: "
|
||||
<< object_path.value();
|
||||
DVLOG(1) << "Remote GATT characteristic descriptor already exists: "
|
||||
<< object_path.value();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -262,12 +262,13 @@ void BluetoothRemoteGattCharacteristicBlueZ::GattDescriptorAdded(
|
||||
->GetProperties(object_path);
|
||||
DCHECK(properties);
|
||||
if (properties->characteristic.value() != this->object_path()) {
|
||||
VLOG(3) << "Remote GATT descriptor does not belong to this characteristic.";
|
||||
DVLOG(3)
|
||||
<< "Remote GATT descriptor does not belong to this characteristic.";
|
||||
return;
|
||||
}
|
||||
|
||||
VLOG(1) << "Adding new remote GATT descriptor for GATT characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Adding new remote GATT descriptor for GATT characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
|
||||
// NOTE: Can't use std::make_unique due to private constructor.
|
||||
BluetoothRemoteGattDescriptorBlueZ* descriptor =
|
||||
@ -285,12 +286,12 @@ void BluetoothRemoteGattCharacteristicBlueZ::GattDescriptorRemoved(
|
||||
const dbus::ObjectPath& object_path) {
|
||||
auto iter = descriptors_.find(object_path.value());
|
||||
if (iter == descriptors_.end()) {
|
||||
VLOG(2) << "Unknown descriptor removed: " << object_path.value();
|
||||
DVLOG(2) << "Unknown descriptor removed: " << object_path.value();
|
||||
return;
|
||||
}
|
||||
|
||||
VLOG(1) << "Removing remote GATT descriptor from characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Removing remote GATT descriptor from characteristic: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
|
||||
auto descriptor = std::move(iter->second);
|
||||
auto* descriptor_bluez =
|
||||
@ -309,7 +310,7 @@ void BluetoothRemoteGattCharacteristicBlueZ::GattDescriptorPropertyChanged(
|
||||
const std::string& property_name) {
|
||||
auto iter = descriptors_.find(object_path.value());
|
||||
if (iter == descriptors_.end()) {
|
||||
VLOG(2) << "Unknown descriptor removed: " << object_path.value();
|
||||
DVLOG(2) << "Unknown descriptor removed: " << object_path.value();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -333,8 +334,8 @@ void BluetoothRemoteGattCharacteristicBlueZ::GattDescriptorPropertyChanged(
|
||||
|
||||
void BluetoothRemoteGattCharacteristicBlueZ::OnStartNotifySuccess(
|
||||
base::OnceClosure callback) {
|
||||
VLOG(1) << "Started notifications from characteristic: "
|
||||
<< object_path().value();
|
||||
DVLOG(1) << "Started notifications from characteristic: "
|
||||
<< object_path().value();
|
||||
has_notify_session_ = true;
|
||||
std::move(callback).Run();
|
||||
}
|
||||
@ -343,9 +344,9 @@ void BluetoothRemoteGattCharacteristicBlueZ::OnStartNotifyError(
|
||||
ErrorCallback error_callback,
|
||||
const std::string& error_name,
|
||||
const std::string& error_message) {
|
||||
VLOG(1) << "Failed to start notifications from characteristic: "
|
||||
<< object_path().value() << ": " << error_name << ", "
|
||||
<< error_message;
|
||||
DVLOG(1) << "Failed to start notifications from characteristic: "
|
||||
<< object_path().value() << ": " << error_name << ", "
|
||||
<< error_message;
|
||||
std::move(error_callback)
|
||||
.Run(
|
||||
BluetoothRemoteGattServiceBlueZ::DBusErrorToServiceError(error_name));
|
||||
@ -361,9 +362,9 @@ void BluetoothRemoteGattCharacteristicBlueZ::OnStopNotifyError(
|
||||
base::OnceClosure callback,
|
||||
const std::string& error_name,
|
||||
const std::string& error_message) {
|
||||
VLOG(1) << "Call to stop notifications failed for characteristic: "
|
||||
<< object_path().value() << ": " << error_name << ", "
|
||||
<< error_message;
|
||||
DVLOG(1) << "Call to stop notifications failed for characteristic: "
|
||||
<< object_path().value() << ": " << error_name << ", "
|
||||
<< error_message;
|
||||
|
||||
// Since this is a best effort operation, treat this as success.
|
||||
OnStopNotifySuccess(std::move(callback));
|
||||
@ -373,8 +374,8 @@ void BluetoothRemoteGattCharacteristicBlueZ::OnReadError(
|
||||
ErrorCallback error_callback,
|
||||
const std::string& error_name,
|
||||
const std::string& error_message) {
|
||||
VLOG(1) << "Operation failed: " << error_name
|
||||
<< ", message: " << error_message;
|
||||
DVLOG(1) << "Operation failed: " << error_name
|
||||
<< ", message: " << error_message;
|
||||
--num_of_characteristic_value_read_in_progress_;
|
||||
DCHECK_GE(num_of_characteristic_value_read_in_progress_, 0);
|
||||
std::move(error_callback)
|
||||
@ -385,8 +386,8 @@ void BluetoothRemoteGattCharacteristicBlueZ::OnWriteError(
|
||||
ErrorCallback error_callback,
|
||||
const std::string& error_name,
|
||||
const std::string& error_message) {
|
||||
VLOG(1) << "Operation failed: " << error_name
|
||||
<< ", message: " << error_message;
|
||||
DVLOG(1) << "Operation failed: " << error_name
|
||||
<< ", message: " << error_message;
|
||||
std::move(error_callback)
|
||||
.Run(BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name));
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ BluetoothRemoteGattDescriptorBlueZ::BluetoothRemoteGattDescriptorBlueZ(
|
||||
const dbus::ObjectPath& object_path)
|
||||
: BluetoothGattDescriptorBlueZ(object_path),
|
||||
characteristic_(characteristic) {
|
||||
VLOG(1) << "Creating remote GATT descriptor with identifier: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Creating remote GATT descriptor with identifier: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
}
|
||||
|
||||
BluetoothRemoteGattDescriptorBlueZ::~BluetoothRemoteGattDescriptorBlueZ() =
|
||||
@ -83,9 +83,9 @@ BluetoothRemoteGattDescriptorBlueZ::GetPermissions() const {
|
||||
void BluetoothRemoteGattDescriptorBlueZ::ReadRemoteDescriptor(
|
||||
ValueCallback callback,
|
||||
ErrorCallback error_callback) {
|
||||
VLOG(1) << "Sending GATT characteristic descriptor read request to "
|
||||
<< "descriptor: " << GetIdentifier()
|
||||
<< ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Sending GATT characteristic descriptor read request to "
|
||||
<< "descriptor: " << GetIdentifier()
|
||||
<< ", UUID: " << GetUUID().canonical_value();
|
||||
|
||||
bluez::BluezDBusManager::Get()->GetBluetoothGattDescriptorClient()->ReadValue(
|
||||
object_path(), std::move(callback),
|
||||
@ -98,10 +98,10 @@ void BluetoothRemoteGattDescriptorBlueZ::WriteRemoteDescriptor(
|
||||
const std::vector<uint8_t>& new_value,
|
||||
base::OnceClosure callback,
|
||||
ErrorCallback error_callback) {
|
||||
VLOG(1) << "Sending GATT characteristic descriptor write request to "
|
||||
<< "characteristic: " << GetIdentifier()
|
||||
<< ", UUID: " << GetUUID().canonical_value()
|
||||
<< ", with value: " << new_value << ".";
|
||||
DVLOG(1) << "Sending GATT characteristic descriptor write request to "
|
||||
<< "characteristic: " << GetIdentifier()
|
||||
<< ", UUID: " << GetUUID().canonical_value()
|
||||
<< ", with value: " << new_value << ".";
|
||||
|
||||
bluez::BluezDBusManager::Get()
|
||||
->GetBluetoothGattDescriptorClient()
|
||||
@ -115,8 +115,8 @@ void BluetoothRemoteGattDescriptorBlueZ::OnError(
|
||||
ErrorCallback error_callback,
|
||||
const std::string& error_name,
|
||||
const std::string& error_message) {
|
||||
VLOG(1) << "Operation failed: " << error_name
|
||||
<< ", message: " << error_message;
|
||||
DVLOG(1) << "Operation failed: " << error_name
|
||||
<< ", message: " << error_message;
|
||||
|
||||
std::move(error_callback)
|
||||
.Run(BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name));
|
||||
|
@ -23,8 +23,8 @@ BluetoothRemoteGattServiceBlueZ::BluetoothRemoteGattServiceBlueZ(
|
||||
BluetoothDeviceBlueZ* device,
|
||||
const dbus::ObjectPath& object_path)
|
||||
: BluetoothGattServiceBlueZ(adapter, object_path), device_(device) {
|
||||
VLOG(1) << "Creating remote GATT service with identifier: "
|
||||
<< object_path.value();
|
||||
DVLOG(1) << "Creating remote GATT service with identifier: "
|
||||
<< object_path.value();
|
||||
DCHECK(GetAdapter());
|
||||
|
||||
bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()->AddObserver(
|
||||
@ -133,8 +133,8 @@ void BluetoothRemoteGattServiceBlueZ::GattServicePropertyChanged(
|
||||
if (object_path != this->object_path())
|
||||
return;
|
||||
|
||||
VLOG(1) << "Service property changed: \"" << property_name << "\", "
|
||||
<< object_path.value();
|
||||
DVLOG(1) << "Service property changed: \"" << property_name << "\", "
|
||||
<< object_path.value();
|
||||
bluez::BluetoothGattServiceClient::Properties* properties =
|
||||
bluez::BluezDBusManager::Get()
|
||||
->GetBluetoothGattServiceClient()
|
||||
@ -147,8 +147,8 @@ void BluetoothRemoteGattServiceBlueZ::GattServicePropertyChanged(
|
||||
void BluetoothRemoteGattServiceBlueZ::GattCharacteristicAdded(
|
||||
const dbus::ObjectPath& object_path) {
|
||||
if (characteristics_.find(object_path.value()) != characteristics_.end()) {
|
||||
VLOG(1) << "Remote GATT characteristic already exists: "
|
||||
<< object_path.value();
|
||||
DVLOG(1) << "Remote GATT characteristic already exists: "
|
||||
<< object_path.value();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -158,12 +158,12 @@ void BluetoothRemoteGattServiceBlueZ::GattCharacteristicAdded(
|
||||
->GetProperties(object_path);
|
||||
DCHECK(properties);
|
||||
if (properties->service.value() != this->object_path()) {
|
||||
VLOG(2) << "Remote GATT characteristic does not belong to this service.";
|
||||
DVLOG(2) << "Remote GATT characteristic does not belong to this service.";
|
||||
return;
|
||||
}
|
||||
|
||||
VLOG(1) << "Adding new remote GATT characteristic for GATT service: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Adding new remote GATT characteristic for GATT service: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
|
||||
// NOTE: Can't use std::make_unique due to private constructor.
|
||||
BluetoothRemoteGattCharacteristicBlueZ* characteristic =
|
||||
@ -180,12 +180,12 @@ void BluetoothRemoteGattServiceBlueZ::GattCharacteristicRemoved(
|
||||
const dbus::ObjectPath& object_path) {
|
||||
auto iter = characteristics_.find(object_path.value());
|
||||
if (iter == characteristics_.end()) {
|
||||
VLOG(2) << "Unknown GATT characteristic removed: " << object_path.value();
|
||||
DVLOG(2) << "Unknown GATT characteristic removed: " << object_path.value();
|
||||
return;
|
||||
}
|
||||
|
||||
VLOG(1) << "Removing remote GATT characteristic from service: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
DVLOG(1) << "Removing remote GATT characteristic from service: "
|
||||
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
|
||||
|
||||
auto characteristic = std::move(iter->second);
|
||||
DCHECK(
|
||||
@ -205,7 +205,7 @@ void BluetoothRemoteGattServiceBlueZ::GattCharacteristicPropertyChanged(
|
||||
GetCharacteristic(object_path.value()));
|
||||
|
||||
if (!characteristic_bluez) {
|
||||
VLOG(3) << "Properties of unknown characteristic changed";
|
||||
DVLOG(3) << "Properties of unknown characteristic changed";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -227,14 +227,14 @@ void BluetoothSocketBlueZ::RegisterProfile(
|
||||
// adapter isn't running yet. Report success and carry on;
|
||||
// the profile will be registered when the daemon becomes available.
|
||||
if (!adapter->IsPresent()) {
|
||||
VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
|
||||
<< ": Delaying profile registration.";
|
||||
DVLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
|
||||
<< ": Delaying profile registration.";
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, success_callback);
|
||||
return;
|
||||
}
|
||||
|
||||
VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
|
||||
<< ": Acquiring profile.";
|
||||
DVLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
|
||||
<< ": Acquiring profile.";
|
||||
|
||||
adapter->UseProfile(uuid_, device_path_, *options_, this,
|
||||
base::Bind(&BluetoothSocketBlueZ::OnRegisterProfile, this,
|
||||
@ -253,13 +253,13 @@ void BluetoothSocketBlueZ::OnRegisterProfile(
|
||||
profile_ = profile;
|
||||
|
||||
if (device_path_.value().empty()) {
|
||||
VLOG(1) << uuid_.canonical_value() << ": Profile registered.";
|
||||
DVLOG(1) << uuid_.canonical_value() << ": Profile registered.";
|
||||
success_callback.Run();
|
||||
return;
|
||||
}
|
||||
|
||||
VLOG(1) << uuid_.canonical_value() << ": Got profile, connecting to "
|
||||
<< device_path_.value();
|
||||
DVLOG(1) << uuid_.canonical_value() << ": Got profile, connecting to "
|
||||
<< device_path_.value();
|
||||
|
||||
bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ConnectProfile(
|
||||
device_path_, uuid_.canonical_value(),
|
||||
@ -284,7 +284,7 @@ void BluetoothSocketBlueZ::OnConnectProfile(
|
||||
DCHECK(ui_task_runner()->RunsTasksInCurrentSequence());
|
||||
DCHECK(profile_);
|
||||
|
||||
VLOG(1) << profile_->object_path().value() << ": Profile connected.";
|
||||
DVLOG(1) << profile_->object_path().value() << ": Profile connected.";
|
||||
UnregisterProfile();
|
||||
success_callback.Run();
|
||||
}
|
||||
@ -315,8 +315,8 @@ void BluetoothSocketBlueZ::AdapterPresentChanged(BluetoothAdapter* adapter,
|
||||
|
||||
DCHECK(!profile_);
|
||||
|
||||
VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
|
||||
<< ": Acquiring profile.";
|
||||
DVLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
|
||||
<< ": Acquiring profile.";
|
||||
|
||||
static_cast<BluetoothAdapterBlueZ*>(adapter)->UseProfile(
|
||||
uuid_, device_path_, *options_, this,
|
||||
@ -331,7 +331,7 @@ void BluetoothSocketBlueZ::OnInternalRegisterProfile(
|
||||
|
||||
profile_ = profile;
|
||||
|
||||
VLOG(1) << uuid_.canonical_value() << ": Profile re-registered";
|
||||
DVLOG(1) << uuid_.canonical_value() << ": Profile re-registered";
|
||||
}
|
||||
|
||||
void BluetoothSocketBlueZ::OnInternalRegisterProfileError(
|
||||
@ -345,7 +345,7 @@ void BluetoothSocketBlueZ::Released() {
|
||||
DCHECK(ui_task_runner()->RunsTasksInCurrentSequence());
|
||||
DCHECK(profile_);
|
||||
|
||||
VLOG(1) << profile_->object_path().value() << ": Release";
|
||||
DVLOG(1) << profile_->object_path().value() << ": Release";
|
||||
}
|
||||
|
||||
void BluetoothSocketBlueZ::NewConnection(
|
||||
@ -355,8 +355,8 @@ void BluetoothSocketBlueZ::NewConnection(
|
||||
ConfirmationCallback callback) {
|
||||
DCHECK(ui_task_runner()->RunsTasksInCurrentSequence());
|
||||
|
||||
VLOG(1) << uuid_.canonical_value()
|
||||
<< ": New connection from device: " << device_path.value();
|
||||
DVLOG(1) << uuid_.canonical_value()
|
||||
<< ": New connection from device: " << device_path.value();
|
||||
|
||||
if (!device_path_.value().empty()) {
|
||||
DCHECK(device_path_ == device_path);
|
||||
@ -373,7 +373,7 @@ void BluetoothSocketBlueZ::NewConnection(
|
||||
request->callback = std::move(callback);
|
||||
|
||||
connection_request_queue_.push(std::move(request));
|
||||
VLOG(1) << uuid_.canonical_value() << ": Connection is now pending.";
|
||||
DVLOG(1) << uuid_.canonical_value() << ": Connection is now pending.";
|
||||
if (accept_request_) {
|
||||
AcceptConnectionRequest();
|
||||
}
|
||||
@ -386,7 +386,7 @@ void BluetoothSocketBlueZ::RequestDisconnection(
|
||||
DCHECK(ui_task_runner()->RunsTasksInCurrentSequence());
|
||||
DCHECK(profile_);
|
||||
|
||||
VLOG(1) << profile_->object_path().value() << ": Request disconnection";
|
||||
DVLOG(1) << profile_->object_path().value() << ": Request disconnection";
|
||||
std::move(callback).Run(SUCCESS);
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ void BluetoothSocketBlueZ::Cancel() {
|
||||
DCHECK(ui_task_runner()->RunsTasksInCurrentSequence());
|
||||
DCHECK(profile_);
|
||||
|
||||
VLOG(1) << profile_->object_path().value() << ": Cancel";
|
||||
DVLOG(1) << profile_->object_path().value() << ": Cancel";
|
||||
|
||||
if (connection_request_queue_.empty())
|
||||
return;
|
||||
@ -415,8 +415,8 @@ void BluetoothSocketBlueZ::AcceptConnectionRequest() {
|
||||
DCHECK(connection_request_queue_.size() >= 1);
|
||||
DCHECK(profile_);
|
||||
|
||||
VLOG(1) << profile_->object_path().value()
|
||||
<< ": Accepting pending connection.";
|
||||
DVLOG(1) << profile_->object_path().value()
|
||||
<< ": Accepting pending connection.";
|
||||
|
||||
ConnectionRequest* request = connection_request_queue_.front().get();
|
||||
request->accepting = true;
|
||||
@ -530,7 +530,7 @@ void BluetoothSocketBlueZ::UnregisterProfile() {
|
||||
DCHECK(ui_task_runner()->RunsTasksInCurrentSequence());
|
||||
DCHECK(profile_);
|
||||
|
||||
VLOG(1) << profile_->object_path().value() << ": Release profile";
|
||||
DVLOG(1) << profile_->object_path().value() << ": Release profile";
|
||||
|
||||
static_cast<BluetoothAdapterBlueZ*>(adapter_.get())
|
||||
->ReleaseProfile(device_path_, profile_);
|
||||
|
Reference in New Issue
Block a user