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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.cc

Issue 1915803002: Bluetooth class changes for implementing local GATT attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/dbus/fake_bluetooth_gatt_descriptor_client.h" 5 #include "device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.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 "device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h" 9 #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h"
10 #include "device/bluetooth/dbus/bluez_dbus_manager.h" 10 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const std::vector<uint8_t>& value, 123 const std::vector<uint8_t>& value,
124 const base::Closure& callback, 124 const base::Closure& callback,
125 const ErrorCallback& error_callback) { 125 const ErrorCallback& error_callback) {
126 if (properties_.find(object_path) == properties_.end()) { 126 if (properties_.find(object_path) == properties_.end()) {
127 error_callback.Run(kUnknownDescriptorError, ""); 127 error_callback.Run(kUnknownDescriptorError, "");
128 return; 128 return;
129 } 129 }
130 130
131 // Since the only fake descriptor is "Client Characteristic Configuration" 131 // Since the only fake descriptor is "Client Characteristic Configuration"
132 // and BlueZ doesn't allow writing to it, return failure. 132 // and BlueZ doesn't allow writing to it, return failure.
133 error_callback.Run("org.bluez.Error.NotPermitted", 133 error_callback.Run(bluetooth_gatt_service::kErrorWriteNotPermitted,
134 "Writing to the Client Characteristic Configuration " 134 "Writing to the Client Characteristic Configuration "
135 "descriptor not allowed"); 135 "descriptor not allowed");
136 } 136 }
137 137
138 dbus::ObjectPath FakeBluetoothGattDescriptorClient::ExposeDescriptor( 138 dbus::ObjectPath FakeBluetoothGattDescriptorClient::ExposeDescriptor(
139 const dbus::ObjectPath& characteristic_path, 139 const dbus::ObjectPath& characteristic_path,
140 const std::string& uuid) { 140 const std::string& uuid) {
141 if (uuid != kClientCharacteristicConfigurationUUID) { 141 if (uuid != kClientCharacteristicConfigurationUUID) {
142 VLOG(2) << "Unsupported UUID: " << uuid; 142 VLOG(2) << "Unsupported UUID: " << uuid;
143 return dbus::ObjectPath(); 143 return dbus::ObjectPath();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 GattDescriptorAdded(object_path)); 200 GattDescriptorAdded(object_path));
201 } 201 }
202 202
203 void FakeBluetoothGattDescriptorClient::NotifyDescriptorRemoved( 203 void FakeBluetoothGattDescriptorClient::NotifyDescriptorRemoved(
204 const dbus::ObjectPath& object_path) { 204 const dbus::ObjectPath& object_path) {
205 FOR_EACH_OBSERVER(BluetoothGattDescriptorClient::Observer, observers_, 205 FOR_EACH_OBSERVER(BluetoothGattDescriptorClient::Observer, observers_,
206 GattDescriptorRemoved(object_path)); 206 GattDescriptorRemoved(object_path));
207 } 207 }
208 208
209 } // namespace bluez 209 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698