OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_remote_gatt_descriptor_chromeos.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | 10 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 device::BluetoothGattCharacteristic* | 66 device::BluetoothGattCharacteristic* |
67 BluetoothRemoteGattDescriptorChromeOS::GetCharacteristic() const { | 67 BluetoothRemoteGattDescriptorChromeOS::GetCharacteristic() const { |
68 return characteristic_; | 68 return characteristic_; |
69 } | 69 } |
70 | 70 |
71 device::BluetoothGattCharacteristic::Permissions | 71 device::BluetoothGattCharacteristic::Permissions |
72 BluetoothRemoteGattDescriptorChromeOS::GetPermissions() const { | 72 BluetoothRemoteGattDescriptorChromeOS::GetPermissions() const { |
73 // TODO(armansito): Once BlueZ defines the permissions, return the correct | 73 // TODO(armansito): Once BlueZ defines the permissions, return the correct |
74 // values here. | 74 // values here. |
75 return device::BluetoothGattCharacteristic::kPermissionNone; | 75 return device::BluetoothGattCharacteristic::PERMISSION_NONE; |
76 } | 76 } |
77 | 77 |
78 void BluetoothRemoteGattDescriptorChromeOS::ReadRemoteDescriptor( | 78 void BluetoothRemoteGattDescriptorChromeOS::ReadRemoteDescriptor( |
79 const ValueCallback& callback, | 79 const ValueCallback& callback, |
80 const ErrorCallback& error_callback) { | 80 const ErrorCallback& error_callback) { |
81 VLOG(1) << "Sending GATT characteristic descriptor read request to " | 81 VLOG(1) << "Sending GATT characteristic descriptor read request to " |
82 << "descriptor: " << GetIdentifier() << ", UUID: " | 82 << "descriptor: " << GetIdentifier() << ", UUID: " |
83 << GetUUID().canonical_value(); | 83 << GetUUID().canonical_value(); |
84 | 84 |
85 DBusThreadManager::Get()->GetBluetoothGattDescriptorClient()->ReadValue( | 85 DBusThreadManager::Get()->GetBluetoothGattDescriptorClient()->ReadValue( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 const std::string& error_name, | 130 const std::string& error_name, |
131 const std::string& error_message) { | 131 const std::string& error_message) { |
132 VLOG(1) << "Operation failed: " << error_name | 132 VLOG(1) << "Operation failed: " << error_name |
133 << ", message: " << error_message; | 133 << ", message: " << error_message; |
134 | 134 |
135 error_callback.Run( | 135 error_callback.Run( |
136 BluetoothRemoteGattServiceChromeOS::DBusErrorToServiceError(error_name)); | 136 BluetoothRemoteGattServiceChromeOS::DBusErrorToServiceError(error_name)); |
137 } | 137 } |
138 | 138 |
139 } // namespace chromeos | 139 } // namespace chromeos |
OLD | NEW |