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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.h

Issue 1979163002: Add DBus plumbing and tests for sending devices with ATT read/writes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@devices
Patch Set: gyp fix 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
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 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_
6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 22 matching lines...) Expand all
33 const dbus::ObjectPath& characteristic_path); 33 const dbus::ObjectPath& characteristic_path);
34 ~FakeBluetoothGattDescriptorServiceProvider() override; 34 ~FakeBluetoothGattDescriptorServiceProvider() override;
35 35
36 // BluetoothGattDescriptorServiceProvider override. 36 // BluetoothGattDescriptorServiceProvider override.
37 void SendValueChanged(const std::vector<uint8_t>& value) override; 37 void SendValueChanged(const std::vector<uint8_t>& value) override;
38 38
39 // Methods to simulate value get/set requests issued from a remote device. The 39 // Methods to simulate value get/set requests issued from a remote device. The
40 // methods do nothing, if the associated service was not registered with the 40 // methods do nothing, if the associated service was not registered with the
41 // GATT manager. 41 // GATT manager.
42 void GetValue( 42 void GetValue(
43 const dbus::ObjectPath& device_path,
43 const device::BluetoothLocalGattService::Delegate::ValueCallback& 44 const device::BluetoothLocalGattService::Delegate::ValueCallback&
44 callback, 45 callback,
45 const device::BluetoothLocalGattService::Delegate::ErrorCallback& 46 const device::BluetoothLocalGattService::Delegate::ErrorCallback&
46 error_callback); 47 error_callback);
47 void SetValue( 48 void SetValue(
49 const dbus::ObjectPath& device_path,
48 const std::vector<uint8_t>& value, 50 const std::vector<uint8_t>& value,
49 const base::Closure& callback, 51 const base::Closure& callback,
50 const device::BluetoothLocalGattService::Delegate::ErrorCallback& 52 const device::BluetoothLocalGattService::Delegate::ErrorCallback&
51 error_callback); 53 error_callback);
52 54
53 const dbus::ObjectPath& object_path() const override; 55 const dbus::ObjectPath& object_path() const override;
54 const std::string& uuid() const { return uuid_; } 56 const std::string& uuid() const { return uuid_; }
55 const dbus::ObjectPath& characteristic_path() const { 57 const dbus::ObjectPath& characteristic_path() const {
56 return characteristic_path_; 58 return characteristic_path_;
57 } 59 }
(...skipping 13 matching lines...) Expand all
71 73
72 // The delegate that method calls are passed on to. 74 // The delegate that method calls are passed on to.
73 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate_; 75 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate_;
74 76
75 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorServiceProvider); 77 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorServiceProvider);
76 }; 78 };
77 79
78 } // namespace bluez 80 } // namespace bluez
79 81
80 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER _H_ 82 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698