| 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);
|
| };
|
|
|
|
|