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

Side by Side Diff: chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h

Issue 206443009: chromeos/dbus: Add fake D-Bus clients for GATT client-mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
7
8 #include "base/observer_list.h"
9 #include "chromeos/chromeos_export.h"
10 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
11
12 namespace chromeos {
13
14 // FakeBluetoothGattDescriptorClient simulates the behavior of the Bluetooth
15 // Daemon GATT characteristic descriptor objects and is used in test cases in
16 // place of a mock and on the Linux desktop.
17 class CHROMEOS_EXPORT FakeBluetoothGattDescriptorClient
18 : public BluetoothGattDescriptorClient {
19 public:
20 struct Properties : public BluetoothGattDescriptorClient::Properties {
21 explicit Properties(const PropertyChangedCallback& callback);
22 virtual ~Properties();
23
24 // dbus::PropertySet override
25 virtual void Get(dbus::PropertyBase* property,
26 dbus::PropertySet::GetCallback callback) OVERRIDE;
27 virtual void GetAll() OVERRIDE;
28 virtual void Set(dbus::PropertyBase* property,
29 dbus::PropertySet::SetCallback callback) OVERRIDE;
30 };
31
32 FakeBluetoothGattDescriptorClient();
33 virtual ~FakeBluetoothGattDescriptorClient();
34
35 // DBusClient override.
36 virtual void Init(dbus::Bus* bus) OVERRIDE;
37
38 // BluetoothGattDescriptorClient overrides.
39 virtual void AddObserver(Observer* observer) OVERRIDE;
40 virtual void RemoveObserver(Observer* observer) OVERRIDE;
41 virtual std::vector<dbus::ObjectPath> GetDescriptors() OVERRIDE;
42 virtual Properties* GetProperties(const dbus::ObjectPath& object_path)
43 OVERRIDE;
44
45 private:
46 // TODO(armansito): Add simulated descriptors, once BlueZ's behavior is
47 // better defined.
48
49 // List of observers interested in event notifications from us.
50 ObserverList<Observer> observers_;
51
52 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient);
53 };
54
55 } // namespace chromeos
56
57 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc ('k') | chromeos/dbus/fake_bluetooth_gatt_descriptor_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698