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

Unified Diff: device/bluetooth/device.h

Issue 2627243002: bluetooth: Add control for reading/writing of characteristics to internals page. (Closed)
Patch Set: Merge upstream, add comment detail for type converter Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/BUILD.gn ('k') | device/bluetooth/device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/device.h
diff --git a/device/bluetooth/device.h b/device/bluetooth/device.h
index 24bb6fd267752d49238889e60fe1116b11ae6113..953b80bfb38a4075c9d75a11d3924fa5d1024bcc 100644
--- a/device/bluetooth/device.h
+++ b/device/bluetooth/device.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_gatt_connection.h"
@@ -54,6 +55,15 @@ class Device : public mojom::Device, public device::BluetoothAdapter::Observer {
void GetServices(const GetServicesCallback& callback) override;
void GetCharacteristics(const std::string& service_id,
const GetCharacteristicsCallback& callback) override;
+ void ReadValueForCharacteristic(
+ const std::string& service_id,
+ const std::string& characteristic_id,
+ const ReadValueForCharacteristicCallback& callback) override;
+ void WriteValueForCharacteristic(
+ const std::string& service_id,
+ const std::string& characteristic_id,
+ const std::vector<uint8_t>& value,
+ const WriteValueForCharacteristicCallback& callback) override;
void GetDescriptors(const std::string& service_id,
const std::string& characteristic_id,
const GetDescriptorsCallback& callback) override;
@@ -67,6 +77,21 @@ class Device : public mojom::Device, public device::BluetoothAdapter::Observer {
mojom::ServiceInfoPtr ConstructServiceInfoStruct(
const device::BluetoothRemoteGattService& service);
+ void OnReadRemoteCharacteristic(
+ const ReadValueForCharacteristicCallback& callback,
+ const std::vector<uint8_t>& value);
+
+ void OnReadRemoteCharacteristicError(
+ const ReadValueForCharacteristicCallback& callback,
+ device::BluetoothGattService::GattErrorCode error_code);
+
+ void OnWriteRemoteCharacteristic(
+ const WriteValueForCharacteristicCallback& callback);
+
+ void OnWriteRemoteCharacteristicError(
+ const WriteValueForCharacteristicCallback& callback,
+ device::BluetoothGattService::GattErrorCode error_code);
+
const std::string& GetAddress();
// The current BluetoothAdapter.
@@ -81,6 +106,8 @@ class Device : public mojom::Device, public device::BluetoothAdapter::Observer {
// services to be discovered for this device.
std::vector<base::Closure> pending_services_requests_;
+ base::WeakPtrFactory<Device> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Device);
};
« no previous file with comments | « device/bluetooth/BUILD.gn ('k') | device/bluetooth/device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698