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

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

Issue 1974633002: Implement DBus changes needed for notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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_DELEGATE_WRAPPER_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_DELEGATE_WRAPPER_H_
6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_DELEGATE_WRAPPER_H_ 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_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 BluetoothLocalGattCharacteristicBlueZ; 20 class BluetoothLocalGattCharacteristicBlueZ;
21 21
22 // Wrapper class around AttributeValueDelegate to handle characteristics. 22 // Wrapper class around AttributeValueDelegate to handle characteristics.
23 class BluetoothGattCharacteristicDelegateWrapper 23 class BluetoothGattCharacteristicDelegateWrapper
24 : public BluetoothGattAttributeValueDelegate { 24 : public BluetoothGattAttributeValueDelegate {
25 public: 25 public:
26 BluetoothGattCharacteristicDelegateWrapper( 26 BluetoothGattCharacteristicDelegateWrapper(
27 BluetoothLocalGattServiceBlueZ* service, 27 BluetoothLocalGattServiceBlueZ* service,
28 BluetoothLocalGattCharacteristicBlueZ* characteristic); 28 BluetoothLocalGattCharacteristicBlueZ* characteristic);
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 BluetoothLocalGattCharacteristicBlueZ* characteristic_; 46 BluetoothLocalGattCharacteristicBlueZ* characteristic_;
44 47
45 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicDelegateWrapper); 48 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicDelegateWrapper);
46 }; 49 };
47 50
48 } // namespace bluez 51 } // namespace bluez
49 52
50 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_DELEGATE_WRAPPER_ H_ 53 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_DELEGATE_WRAPPER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698