OLD | NEW |
(Empty) | |
| 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 |
| 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H
_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H
_ |
| 7 |
| 8 #include <map> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "dbus/object_path.h" |
| 13 #include "device/bluetooth/bluetooth_export.h" |
| 14 #include "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h" |
| 15 #include "device/bluetooth/dbus/bluetooth_gatt_application_service_provider.h" |
| 16 #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider.h
" |
| 17 #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_service_provider.h" |
| 18 #include "device/bluetooth/dbus/bluetooth_gatt_service_service_provider.h" |
| 19 |
| 20 namespace bluez { |
| 21 |
| 22 class BluetoothLocalGattCharacteristicBlueZ; |
| 23 class BluetoothLocalGattDescriptorBlueZ; |
| 24 class BluetoothLocalGattServiceBlueZ; |
| 25 |
| 26 // FakeBluetoothGattApplicationServiceProvider simulates behavior of a local |
| 27 // GATT service object and is used both in test cases in place of a mock and on |
| 28 // the Linux desktop. |
| 29 class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattApplicationServiceProvider |
| 30 : public BluetoothGattApplicationServiceProvider { |
| 31 public: |
| 32 FakeBluetoothGattApplicationServiceProvider( |
| 33 const dbus::ObjectPath& object_path, |
| 34 const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>& |
| 35 services); |
| 36 ~FakeBluetoothGattApplicationServiceProvider() override; |
| 37 |
| 38 const dbus::ObjectPath& object_path() const { return object_path_; } |
| 39 |
| 40 private: |
| 41 // D-Bus object path of the fake GATT service. |
| 42 dbus::ObjectPath object_path_; |
| 43 |
| 44 // List of GATT Service service providers managed by this object manager. |
| 45 std::vector<std::unique_ptr<BluetoothGattServiceServiceProvider>> |
| 46 service_providers_; |
| 47 // List of GATT Characteristic service providers managed by this object |
| 48 // manager. |
| 49 std::vector<std::unique_ptr<BluetoothGattCharacteristicServiceProvider>> |
| 50 characteristic_providers_; |
| 51 // List of GATT Descriptor service providers managed by this object manager. |
| 52 std::vector<std::unique_ptr<BluetoothGattDescriptorServiceProvider>> |
| 53 descriptor_providers_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattApplicationServiceProvider); |
| 56 }; |
| 57 |
| 58 } // namespace bluez |
| 59 |
| 60 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDE
R_H_ |
OLD | NEW |