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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_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_CHARACTERISTIC_SERVICE_PROVIDE R_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDE R_H_
6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDE R_H_ 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDE R_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& service_path); 33 const dbus::ObjectPath& service_path);
34 ~FakeBluetoothGattCharacteristicServiceProvider() override; 34 ~FakeBluetoothGattCharacteristicServiceProvider() override;
35 35
36 // BluetoothGattCharacteristicServiceProvider override. 36 // BluetoothGattCharacteristicServiceProvider 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 // Method to simulate starting and stopping notifications. 55 // Method to simulate starting and stopping notifications.
54 bool NotificationsChange(bool start); 56 bool NotificationsChange(bool start);
55 57
56 const dbus::ObjectPath& object_path() const override; 58 const dbus::ObjectPath& object_path() const override;
57 const std::string& uuid() const { return uuid_; } 59 const std::string& uuid() const { return uuid_; }
(...skipping 18 matching lines...) Expand all
76 78
77 // The delegate that method calls are passed on to. 79 // The delegate that method calls are passed on to.
78 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate_; 80 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate_;
79 81
80 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattCharacteristicServiceProvider); 82 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattCharacteristicServiceProvider);
81 }; 83 };
82 84
83 } // namespace bluez 85 } // namespace bluez
84 86
85 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROV IDER_H_ 87 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROV IDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698