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

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

Issue 1984723006: Add implementation for parsing device info in read/write attribute calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@devices_dbus_readwrite
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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_IMPL_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_IMPL_H_
6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_IMPL_H_ 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Called by dbus:: when the Bluetooth daemon sets a single property of the 51 // Called by dbus:: when the Bluetooth daemon sets a single property of the
52 // descriptor. 52 // descriptor.
53 void Set(dbus::MethodCall* method_call, 53 void Set(dbus::MethodCall* method_call,
54 dbus::ExportedObject::ResponseSender response_sender); 54 dbus::ExportedObject::ResponseSender response_sender);
55 55
56 // Called by dbus:: when the Bluetooth daemon fetches all properties of the 56 // Called by dbus:: when the Bluetooth daemon fetches all properties of the
57 // descriptor. 57 // descriptor.
58 void GetAll(dbus::MethodCall* method_call, 58 void GetAll(dbus::MethodCall* method_call,
59 dbus::ExportedObject::ResponseSender response_sender); 59 dbus::ExportedObject::ResponseSender response_sender);
60 60
61 // Called by BlueZ when a remote central is requesting to read the value of
62 // this descriptor.
63 void ReadValue(dbus::MethodCall* method_call,
64 dbus::ExportedObject::ResponseSender response_sender);
65
66 // Called by BlueZ when a remote central is requesting to write the value of
67 // this descriptor.
68 void WriteValue(dbus::MethodCall* method_call,
69 dbus::ExportedObject::ResponseSender response_sender);
70
61 // Called by dbus:: when a method is exported. 71 // Called by dbus:: when a method is exported.
62 void OnExported(const std::string& interface_name, 72 void OnExported(const std::string& interface_name,
63 const std::string& method_name, 73 const std::string& method_name,
64 bool success); 74 bool success);
65 75
66 // Writes the characteristics's properties into the provided writer. If 76 // Writes the descriptor's properties into the provided writer.
67 // value is not null, it is written also, otherwise no value property is
68 // written.
69 void WriteProperties(dbus::MessageWriter* writer) override; 77 void WriteProperties(dbus::MessageWriter* writer) override;
70 78
79 // Called by the Delegate in response to a method to call to read the value
80 // of this descriptor.
81 void OnReadValue(dbus::MethodCall* method_call,
82 dbus::ExportedObject::ResponseSender response_sender,
83 const std::vector<uint8_t>& value);
84
85 // Called by the Delegate in response to a method to call to write the value
86 // of this descriptor.
87 void OnWriteValue(dbus::MethodCall* method_call,
88 dbus::ExportedObject::ResponseSender response_sender);
89
71 // Called by the Delegate in response to a failed method call to get or set 90 // Called by the Delegate in response to a failed method call to get or set
72 // the descriptor value. 91 // the descriptor value.
73 void OnFailure(dbus::MethodCall* method_call, 92 void OnFailure(dbus::MethodCall* method_call,
74 dbus::ExportedObject::ResponseSender response_sender); 93 dbus::ExportedObject::ResponseSender response_sender);
75 94
76 const dbus::ObjectPath& object_path() const override; 95 const dbus::ObjectPath& object_path() const override;
77 96
78 // Origin thread (i.e. the UI thread in production). 97 // Origin thread (i.e. the UI thread in production).
79 base::PlatformThreadId origin_thread_id_; 98 base::PlatformThreadId origin_thread_id_;
80 99
(...skipping 29 matching lines...) Expand all
110 // invalidate its weak pointers before any other members are destroyed. 129 // invalidate its weak pointers before any other members are destroyed.
111 base::WeakPtrFactory<BluetoothGattDescriptorServiceProviderImpl> 130 base::WeakPtrFactory<BluetoothGattDescriptorServiceProviderImpl>
112 weak_ptr_factory_; 131 weak_ptr_factory_;
113 132
114 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorServiceProviderImpl); 133 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorServiceProviderImpl);
115 }; 134 };
116 135
117 } // namespace bluez 136 } // namespace bluez
118 137
119 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_IMPL _H_ 138 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_IMPL _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698