Chromium Code Reviews| Index: device/bluetooth/bluetooth_local_gatt_service_bluez.h |
| diff --git a/device/bluetooth/bluetooth_local_gatt_service_bluez.h b/device/bluetooth/bluetooth_local_gatt_service_bluez.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..749e37ea852749a4c8aa8b659bcee6e3f9893f0c |
| --- /dev/null |
| +++ b/device/bluetooth/bluetooth_local_gatt_service_bluez.h |
| @@ -0,0 +1,71 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
ortuno
2016/04/14 17:42:36
It's 2016!
rkc
2016/04/14 19:27:28
..and next year it will be 2017!
|
| +// 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_SERVICE_BLUEZ_H_ |
| +#define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_SERVICE_BLUEZ_H_ |
| + |
| +#include <stdint.h> |
|
ortuno
2016/04/14 17:42:36
I don't see any ints.
rkc
2016/04/14 19:27:28
Done.
|
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "dbus/object_path.h" |
| +#include "device/bluetooth/bluetooth_gatt_service_bluez.h" |
| +#include "device/bluetooth/bluetooth_uuid.h" |
| + |
| +namespace device { |
| + |
| +class BluetoothAdapter; |
| +class BluetoothGattCharacteristic; |
| + |
| +} // namespace device |
| + |
| +namespace bluez { |
| + |
| +class BluetoothAdapterBlueZ; |
| +class BluetoothDeviceBlueZ; |
| +class BluetoothLocalGattCharacteristicBlueZ; |
|
ortuno
2016/04/14 17:42:36
I don't think you are using this anywhere?
rkc
2016/04/14 19:27:28
Done.
|
| +class BluetoothLocalGattDescriptorBlueZ; |
|
ortuno
2016/04/14 17:42:36
Same here.
rkc
2016/04/14 19:27:28
Done.
|
| + |
| +// The BluetoothLocalGattServiceBlueZ class implements BluetootGattService |
| +// for local GATT services for platforms that use BlueZ. |
| +class BluetoothLocalGattServiceBlueZ : public BluetoothGattServiceBlueZ { |
| + public: |
| + // device::BluetoothGattService overrides. |
| + device::BluetoothUUID GetUUID() const override; |
| + bool IsLocal() const override; |
| + bool IsPrimary() const override; |
| + device::BluetoothDevice* GetDevice() const override; |
| + bool AddCharacteristic( |
| + device::BluetoothGattCharacteristic* characteristic) override; |
| + bool AddIncludedService(device::BluetoothGattService* service) override; |
| + void Register(const base::Closure& callback, |
| + const ErrorCallback& error_callback) override; |
| + void Unregister(const base::Closure& callback, |
| + const ErrorCallback& error_callback) override; |
| + |
| + private: |
| + friend class BluetoothDeviceBlueZ; |
| + |
| + BluetoothLocalGattServiceBlueZ(BluetoothAdapterBlueZ* adapter, |
| + const dbus::ObjectPath& object_path); |
| + ~BluetoothLocalGattServiceBlueZ() override; |
| + |
| + // Called by dbus:: on unsuccessful completion of a request to register a |
| + // local service. |
| + void OnRegistrationError(const ErrorCallback& error_callback, |
| + const std::string& error_name, |
| + const std::string& error_message); |
| + |
| + // 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<BluetoothLocalGattServiceBlueZ> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattServiceBlueZ); |
| +}; |
| + |
| +} // namespace bluez |
| + |
| +#endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_SERVICE_BLUEZ_H_ |