| OLD | NEW |
| 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_DELEGATE_WRAPPER_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "device/bluetooth/bluetooth_local_gatt_service.h" | 13 #include "device/bluetooth/bluetooth_local_gatt_service.h" |
| 14 #include "device/bluetooth/bluez/bluetooth_gatt_service_bluez.h" | 14 #include "device/bluetooth/bluez/bluetooth_gatt_service_bluez.h" |
| 15 #include "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h" | 15 #include "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h" |
| 16 #include "device/bluetooth/dbus/bluetooth_gatt_attribute_value_delegate.h" | 16 #include "device/bluetooth/dbus/bluetooth_gatt_attribute_value_delegate.h" |
| 17 | 17 |
| 18 namespace bluez { | 18 namespace bluez { |
| 19 | 19 |
| 20 class BluetoothLocalGattDescriptorBlueZ; | 20 class BluetoothLocalGattDescriptorBlueZ; |
| 21 | 21 |
| 22 // Wrapper class around AttributeValueDelegate to handle descriptors. | 22 // Wrapper class around AttributeValueDelegate to handle descriptors. |
| 23 class BluetoothGattDescriptorDelegateWrapper | 23 class BluetoothGattDescriptorDelegateWrapper |
| 24 : public BluetoothGattAttributeValueDelegate { | 24 : public BluetoothGattAttributeValueDelegate { |
| 25 public: | 25 public: |
| 26 BluetoothGattDescriptorDelegateWrapper( | 26 BluetoothGattDescriptorDelegateWrapper( |
| 27 BluetoothLocalGattServiceBlueZ* service, | 27 BluetoothLocalGattServiceBlueZ* service, |
| 28 BluetoothLocalGattDescriptorBlueZ* descriptor); | 28 BluetoothLocalGattDescriptorBlueZ* descriptor); |
| 29 | 29 |
| 30 // BluetoothGattAttributeValueDelegate overrides: |
| 30 void GetValue( | 31 void GetValue( |
| 31 const device::BluetoothLocalGattService::Delegate::ValueCallback& | 32 const device::BluetoothLocalGattService::Delegate::ValueCallback& |
| 32 callback, | 33 callback, |
| 33 const device::BluetoothLocalGattService::Delegate::ErrorCallback& | 34 const device::BluetoothLocalGattService::Delegate::ErrorCallback& |
| 34 error_callback) override; | 35 error_callback) override; |
| 35 void SetValue( | 36 void SetValue( |
| 36 const std::vector<uint8_t>& value, | 37 const std::vector<uint8_t>& value, |
| 37 const base::Closure& callback, | 38 const base::Closure& callback, |
| 38 const device::BluetoothLocalGattService::Delegate::ErrorCallback& | 39 const device::BluetoothLocalGattService::Delegate::ErrorCallback& |
| 39 error_callback) override; | 40 error_callback) override; |
| 41 void StartNotifications() override {} |
| 42 void StopNotifications() override {} |
| 40 | 43 |
| 41 private: | 44 private: |
| 42 BluetoothLocalGattServiceBlueZ* service_; | 45 BluetoothLocalGattServiceBlueZ* service_; |
| 43 BluetoothLocalGattDescriptorBlueZ* descriptor_; | 46 BluetoothLocalGattDescriptorBlueZ* descriptor_; |
| 44 | 47 |
| 45 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorDelegateWrapper); | 48 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorDelegateWrapper); |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 } // namespace bluez | 51 } // namespace bluez |
| 49 | 52 |
| 50 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_ | 53 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_ |
| OLD | NEW |