fake_bluetooth_gatt_service_service_provider.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_
  5. #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_
  6. #include <string>
  7. #include <vector>
  8. #include "dbus/object_path.h"
  9. #include "device/bluetooth/bluetooth_export.h"
  10. #include "device/bluetooth/dbus/bluetooth_gatt_service_service_provider.h"
  11. namespace bluez {
  12. // FakeBluetoothGattServiceServiceProvider simulates behavior of a local GATT
  13. // service object and is used both in test cases in place of a mock and on the
  14. // Linux desktop.
  15. class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattServiceServiceProvider
  16. : public BluetoothGattServiceServiceProvider {
  17. public:
  18. FakeBluetoothGattServiceServiceProvider(
  19. const dbus::ObjectPath& object_path,
  20. const std::string& uuid,
  21. const std::vector<dbus::ObjectPath>& includes);
  22. FakeBluetoothGattServiceServiceProvider(
  23. const FakeBluetoothGattServiceServiceProvider&) = delete;
  24. FakeBluetoothGattServiceServiceProvider& operator=(
  25. const FakeBluetoothGattServiceServiceProvider&) = delete;
  26. ~FakeBluetoothGattServiceServiceProvider() override;
  27. const dbus::ObjectPath& object_path() const override;
  28. const std::string& uuid() const { return uuid_; }
  29. private:
  30. // D-Bus object path of the fake GATT service.
  31. dbus::ObjectPath object_path_;
  32. // 128-bit GATT service UUID.
  33. std::string uuid_;
  34. // List of included GATT services.
  35. std::vector<dbus::ObjectPath> includes_;
  36. };
  37. } // namespace bluez
  38. #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_