Chromium Code Reviews| Index: device/bluetooth/bluetooth_local_gatt_characteristic_bluez.h |
| diff --git a/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.h b/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..64cf438beb80172203a36f35de3749ab388e2bb1 |
| --- /dev/null |
| +++ b/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
ortuno
2016/04/14 17:42:36
It's 2016!
rkc
2016/04/14 19:27:27
..and, 2016 is the year that comes after 2015.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ |
| +#define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ |
| + |
| +#include <stddef.h> |
|
ortuno
2016/04/14 17:42:36
I don't think you need this one.
rkc
2016/04/14 19:27:27
Done.
|
| +#include <stdint.h> |
| + |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "dbus/object_path.h" |
| +#include "device/bluetooth/bluetooth_gatt_characteristic_bluez.h" |
| +#include "device/bluetooth/bluetooth_uuid.h" |
| + |
| +namespace device { |
| + |
| +class BluetoothGattDescriptor; |
| +class BluetoothGattService; |
| + |
| +} // namespace device |
| + |
| +namespace bluez { |
| + |
| +class BluetoothLocalGattDescriptorBlueZ; |
| +class BluetoothLocalGattServiceBlueZ; |
| + |
| +// The BluetoothLocalGattCharacteristicBlueZ class implements |
| +// BluetoothGattCharacteristic for remote GATT characteristics for platforms |
|
ortuno
2016/04/14 17:42:35
Fix description.
rkc
2016/04/14 19:27:28
Done.
|
| +// that use BlueZ. |
| +class BluetoothLocalGattCharacteristicBlueZ |
| + : public BluetoothGattCharacteristicBlueZ { |
| + public: |
| + // device::BluetoothGattCharacteristic overrides. |
| + device::BluetoothUUID GetUUID() const override; |
| + bool IsLocal() const override; |
| + const std::vector<uint8_t>& GetValue() const override; |
| + Properties GetProperties() const override; |
| + bool IsNotifying() const override; |
| + bool AddDescriptor(device::BluetoothGattDescriptor* descriptor) override; |
|
ortuno
2016/04/14 17:42:36
I'm guessing this will be removed base on the desi
rkc
2016/04/14 19:27:28
Yes, it will.
|
| + bool UpdateValue(const std::vector<uint8_t>& value) override; |
| + void StartNotifySession(const NotifySessionCallback& callback, |
| + const ErrorCallback& error_callback) override; |
| + void ReadRemoteCharacteristic(const ValueCallback& callback, |
| + const ErrorCallback& error_callback) override; |
| + void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, |
| + const base::Closure& callback, |
| + const ErrorCallback& error_callback) override; |
| + |
| + private: |
| + friend class BluetoothLocalGattServiceBlueZ; |
| + |
| + BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service, |
| + const dbus::ObjectPath& object_path); |
| + ~BluetoothLocalGattCharacteristicBlueZ() override; |
| + |
| + // Note: This should remain the last member so it'll be destroyed and |
| + // invalidate its weak pointers before any other members are destroyed. |
| + base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_; |
|
ortuno
2016/04/14 17:42:36
You don't seem to use this.
rkc
2016/04/14 19:27:28
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ); |
| +}; |
| + |
| +} // namespace bluez |
| + |
| +#endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ |