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