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

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

Issue 1956513002: Export Read/WriteValue from the GATT characteristic service provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome_api_changes_for_properties
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 | « no previous file | device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CHARACTERISTIC_SERVICE_PROVIDER_IMP L_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_IMP L_H_
6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_IMP L_H_ 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_IMP L_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Called by dbus:: when the Bluetooth daemon sets a single property of the 59 // Called by dbus:: when the Bluetooth daemon sets a single property of the
60 // characteristic. 60 // characteristic.
61 void Set(dbus::MethodCall* method_call, 61 void Set(dbus::MethodCall* method_call,
62 dbus::ExportedObject::ResponseSender response_sender); 62 dbus::ExportedObject::ResponseSender response_sender);
63 63
64 // Called by dbus:: when the Bluetooth daemon fetches all properties of the 64 // Called by dbus:: when the Bluetooth daemon fetches all properties of the
65 // characteristic. 65 // characteristic.
66 void GetAll(dbus::MethodCall* method_call, 66 void GetAll(dbus::MethodCall* method_call,
67 dbus::ExportedObject::ResponseSender response_sender); 67 dbus::ExportedObject::ResponseSender response_sender);
68 68
69 // Called by BlueZ when a remote central is requesting to read the value of
70 // this characteristic.
71 void ReadValue(dbus::MethodCall* method_call,
72 dbus::ExportedObject::ResponseSender response_sender);
73
74 // Called by BlueZ when a remote central is requesting to write the value of
75 // this characteristic.
76 void WriteValue(dbus::MethodCall* method_call,
77 dbus::ExportedObject::ResponseSender response_sender);
78
69 // Called by dbus:: when a method is exported. 79 // Called by dbus:: when a method is exported.
70 void OnExported(const std::string& interface_name, 80 void OnExported(const std::string& interface_name,
71 const std::string& method_name, 81 const std::string& method_name,
72 bool success); 82 bool success);
73 83
74 // Called by the Delegate in response to a method to call to get all 84 // Called by the Delegate in response to a method to call to get all
75 // properties, in which the delegate has successfully returned the 85 // properties, in which the delegate has successfully returned the
76 // characteristic value. 86 // characteristic value.
77 void OnGetAll(dbus::MethodCall* method_call, 87 void OnGetAll(dbus::MethodCall* method_call,
78 dbus::ExportedObject::ResponseSender response_sender, 88 dbus::ExportedObject::ResponseSender response_sender,
79 const std::vector<uint8_t>& value); 89 const std::vector<uint8_t>& value);
80 90
81 // Writes an array of the service's properties into the provided writer. 91 // Writes an array of the service's properties into the provided writer.
82 void WriteProperties(dbus::MessageWriter* writer, 92 void WriteProperties(dbus::MessageWriter* writer,
83 const std::vector<uint8_t>* value) override; 93 const std::vector<uint8_t>* value) override;
84 94
85 // Called by the Delegate in response to a successful method call to get the 95 // Called by the Delegate in response to a successful method call to get the
86 // characteristic value. 96 // characteristic value.
87 void OnGet(dbus::MethodCall* method_call, 97 void OnGet(dbus::MethodCall* method_call,
88 dbus::ExportedObject::ResponseSender response_sender, 98 dbus::ExportedObject::ResponseSender response_sender,
89 const std::vector<uint8_t>& value); 99 const std::vector<uint8_t>& value);
90 100
91 // Called by the Delegate in response to a successful method call to set the 101 // Called by the Delegate in response to a successful method call to set the
92 // characteristic value. 102 // characteristic value.
93 void OnSet(dbus::MethodCall* method_call, 103 void OnSet(dbus::MethodCall* method_call,
94 dbus::ExportedObject::ResponseSender response_sender); 104 dbus::ExportedObject::ResponseSender response_sender);
95 105
106 // Called by the Delegate in response to a method to call to read the value
107 // of this characteristic.
108 void OnReadValue(dbus::MethodCall* method_call,
109 dbus::ExportedObject::ResponseSender response_sender,
110 const std::vector<uint8_t>& value);
111
112 // Called by the Delegate in response to a method to call to write the value
113 // of this characteristic.
114 void OnWriteValue(dbus::MethodCall* method_call,
115 dbus::ExportedObject::ResponseSender response_sender);
116
96 // Called by the Delegate in response to a failed method call to get or set 117 // Called by the Delegate in response to a failed method call to get or set
97 // the characteristic value. 118 // the characteristic value.
98 void OnFailure(dbus::MethodCall* method_call, 119 void OnFailure(dbus::MethodCall* method_call,
99 dbus::ExportedObject::ResponseSender response_sender); 120 dbus::ExportedObject::ResponseSender response_sender);
100 121
101 const dbus::ObjectPath& object_path() const override; 122 const dbus::ObjectPath& object_path() const override;
102 123
103 // Origin thread (i.e. the UI thread in production). 124 // Origin thread (i.e. the UI thread in production).
104 base::PlatformThreadId origin_thread_id_; 125 base::PlatformThreadId origin_thread_id_;
105 126
(...skipping 26 matching lines...) Expand all
132 // invalidate its weak pointers before any other members are destroyed. 153 // invalidate its weak pointers before any other members are destroyed.
133 base::WeakPtrFactory<BluetoothGattCharacteristicServiceProviderImpl> 154 base::WeakPtrFactory<BluetoothGattCharacteristicServiceProviderImpl>
134 weak_ptr_factory_; 155 weak_ptr_factory_;
135 156
136 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicServiceProviderImpl); 157 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicServiceProviderImpl);
137 }; 158 };
138 159
139 } // namespace bluez 160 } // namespace bluez
140 161
141 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_ IMPL_H_ 162 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_ IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698