fake_bluetooth_gatt_application_service_provider.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2016 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_APPLICATION_SERVICE_PROVIDER_H_
  5. #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H_
  6. #include <map>
  7. #include <vector>
  8. #include "dbus/object_path.h"
  9. #include "device/bluetooth/bluetooth_export.h"
  10. #include "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h"
  11. #include "device/bluetooth/dbus/bluetooth_gatt_application_service_provider.h"
  12. #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider.h"
  13. #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_service_provider.h"
  14. #include "device/bluetooth/dbus/bluetooth_gatt_service_service_provider.h"
  15. namespace bluez {
  16. class BluetoothLocalGattServiceBlueZ;
  17. // FakeBluetoothGattApplicationServiceProvider simulates behavior of a local
  18. // GATT service object and is used both in test cases in place of a mock and on
  19. // the Linux desktop.
  20. class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattApplicationServiceProvider
  21. : public BluetoothGattApplicationServiceProvider {
  22. public:
  23. FakeBluetoothGattApplicationServiceProvider(
  24. const dbus::ObjectPath& object_path,
  25. const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>&
  26. services);
  27. FakeBluetoothGattApplicationServiceProvider(
  28. const FakeBluetoothGattApplicationServiceProvider&) = delete;
  29. FakeBluetoothGattApplicationServiceProvider& operator=(
  30. const FakeBluetoothGattApplicationServiceProvider&) = delete;
  31. ~FakeBluetoothGattApplicationServiceProvider() override;
  32. const dbus::ObjectPath& object_path() const { return object_path_; }
  33. private:
  34. // D-Bus object path of the fake GATT service.
  35. dbus::ObjectPath object_path_;
  36. };
  37. } // namespace bluez
  38. #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H_