| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 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_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ |
| 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 11 #include <map> |
| 12 #include <queue> |
| 13 #include <string> |
| 14 #include <utility> |
| 15 #include <vector> |
| 16 |
| 17 #include "base/macros.h" |
| 18 #include "base/memory/weak_ptr.h" |
| 19 #include "dbus/object_path.h" |
| 20 #include "device/bluetooth/bluetooth_gatt_characteristic_bluez.h" |
| 21 #include "device/bluetooth/bluetooth_uuid.h" |
| 22 #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_client.h" |
| 23 |
| 24 namespace device { |
| 25 |
| 26 class BluetoothGattDescriptor; |
| 27 class BluetoothGattService; |
| 28 |
| 29 } // namespace device |
| 30 |
| 31 namespace bluez { |
| 32 |
| 33 class BluetoothLocalGattDescriptorBlueZ; |
| 34 class BluetoothLocalGattServiceBlueZ; |
| 35 |
| 36 // The BluetoothLocalGattCharacteristicBlueZ class implements |
| 37 // BluetoothGattCharacteristic for remote GATT characteristics for platforms |
| 38 // that use BlueZ. |
| 39 class BluetoothLocalGattCharacteristicBlueZ |
| 40 : public BluetoothGattCharacteristicBlueZ { |
| 41 public: |
| 42 // device::BluetoothGattCharacteristic overrides. |
| 43 bool IsLocal() const override; |
| 44 bool AddDescriptor(device::BluetoothGattDescriptor* descriptor) override; |
| 45 bool UpdateValue(const std::vector<uint8_t>& value) override; |
| 46 void StartNotifySession(const NotifySessionCallback& callback, |
| 47 const ErrorCallback& error_callback) override; |
| 48 |
| 49 private: |
| 50 friend class BluetoothLocalGattServiceBlueZ; |
| 51 |
| 52 BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service, |
| 53 const dbus::ObjectPath& object_path); |
| 54 ~BluetoothLocalGattCharacteristicBlueZ() override; |
| 55 |
| 56 // Note: This should remain the last member so it'll be destroyed and |
| 57 // invalidate its weak pointers before any other members are destroyed. |
| 58 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ); |
| 61 }; |
| 62 |
| 63 } // namespace bluez |
| 64 |
| 65 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ |
| OLD | NEW |