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

Unified Diff: device/bluetooth/bluetooth_local_gatt_characteristic_bluez.h

Issue 1872943002: Add support for local services/characteristics/descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
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..386200d3b13ac87dbb86678838c76d1282befbc5
--- /dev/null
+++ b/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.h
@@ -0,0 +1,68 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// 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 <stdint.h>
+#include <vector>
+
+#include "base/callback_forward.h"
+#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
+// 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;
+ 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_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ);
+};
+
+} // namespace bluez
+
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
« no previous file with comments | « device/bluetooth/bluetooth_gatt_service_bluez.cc ('k') | device/bluetooth/bluetooth_local_gatt_characteristic_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698