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

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

Issue 1974633002: Implement DBus changes needed for notifications. (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
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const device::BluetoothLocalGattService::Delegate::ValueCallback& 43 const device::BluetoothLocalGattService::Delegate::ValueCallback&
44 callback, 44 callback,
45 const device::BluetoothLocalGattService::Delegate::ErrorCallback& 45 const device::BluetoothLocalGattService::Delegate::ErrorCallback&
46 error_callback); 46 error_callback);
47 void SetValue( 47 void SetValue(
48 const std::vector<uint8_t>& value, 48 const std::vector<uint8_t>& value,
49 const base::Closure& callback, 49 const base::Closure& callback,
50 const device::BluetoothLocalGattService::Delegate::ErrorCallback& 50 const device::BluetoothLocalGattService::Delegate::ErrorCallback&
51 error_callback); 51 error_callback);
52 52
53 // Method to simulate starting and stopping notifications.
54 bool NotificationsChange(bool start);
55
53 const dbus::ObjectPath& object_path() const override; 56 const dbus::ObjectPath& object_path() const override;
54 const std::string& uuid() const { return uuid_; } 57 const std::string& uuid() const { return uuid_; }
55 const dbus::ObjectPath& service_path() const { return service_path_; } 58 const dbus::ObjectPath& service_path() const { return service_path_; }
59 const std::vector<uint8_t>& sent_value() const { return sent_value_; }
56 60
57 private: 61 private:
58 // D-Bus object path of the fake GATT characteristic. 62 // D-Bus object path of the fake GATT characteristic.
59 dbus::ObjectPath object_path_; 63 dbus::ObjectPath object_path_;
60 64
61 // 128-bit GATT characteristic UUID. 65 // 128-bit GATT characteristic UUID.
62 const std::string uuid_; 66 const std::string uuid_;
63 67
64 // Properties for this characteristic. 68 // Properties for this characteristic.
65 const std::vector<std::string> flags_; 69 const std::vector<std::string> flags_;
66 70
67 // Object path of the service that this characteristic belongs to. 71 // Object path of the service that this characteristic belongs to.
68 const dbus::ObjectPath service_path_; 72 const dbus::ObjectPath service_path_;
69 73
74 // Value that was sent to the fake remote device.
75 std::vector<uint8_t> sent_value_;
76
70 // The delegate that method calls are passed on to. 77 // The delegate that method calls are passed on to.
71 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate_; 78 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate_;
72 79
73 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattCharacteristicServiceProvider); 80 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattCharacteristicServiceProvider);
74 }; 81 };
75 82
76 } // namespace bluez 83 } // namespace bluez
77 84
78 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROV IDER_H_ 85 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROV IDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698