OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class BluetoothAdapterClient; | 27 class BluetoothAdapterClient; |
28 | 28 |
29 // BluetoothDeviceClient is used to communicate with a bluetooth Device | 29 // BluetoothDeviceClient is used to communicate with a bluetooth Device |
30 // interface. | 30 // interface. |
31 class CHROMEOS_EXPORT BluetoothDeviceClient { | 31 class CHROMEOS_EXPORT BluetoothDeviceClient { |
32 public: | 32 public: |
33 // Structure of properties associated with bluetooth devices. | 33 // Structure of properties associated with bluetooth devices. |
34 struct Properties : public BluetoothPropertySet { | 34 struct Properties : public BluetoothPropertySet { |
35 // The Bluetooth device address of the device. Read-only. | 35 // The Bluetooth device address of the device. Read-only. |
36 BluetoothProperty<std::string> address; | 36 dbus::Property<std::string> address; |
37 | 37 |
38 // The Bluetooth friendly name of the device. Read-only, to give a | 38 // The Bluetooth friendly name of the device. Read-only, to give a |
39 // different local name, use the |alias| property. | 39 // different local name, use the |alias| property. |
40 BluetoothProperty<std::string> name; | 40 dbus::Property<std::string> name; |
41 | 41 |
42 // Unique numeric identifier for the vendor of the device. Read-only. | 42 // Unique numeric identifier for the vendor of the device. Read-only. |
43 BluetoothProperty<uint16> vendor; | 43 dbus::Property<uint16> vendor; |
44 | 44 |
45 // Unique vendor-assigned product identifier for the product of the | 45 // Unique vendor-assigned product identifier for the product of the |
46 // device. Read-only. | 46 // device. Read-only. |
47 BluetoothProperty<uint16> product; | 47 dbus::Property<uint16> product; |
48 | 48 |
49 // Unique vendor-assigned version identifier for the device. Read-only. | 49 // Unique vendor-assigned version identifier for the device. Read-only. |
50 BluetoothProperty<uint16> version; | 50 dbus::Property<uint16> version; |
51 | 51 |
52 // Proposed icon name for the device according to the freedesktop.org | 52 // Proposed icon name for the device according to the freedesktop.org |
53 // icon naming specification. Read-only. | 53 // icon naming specification. Read-only. |
54 BluetoothProperty<std::string> icon; | 54 dbus::Property<std::string> icon; |
55 | 55 |
56 // The Bluetooth class of the device. Read-only. | 56 // The Bluetooth class of the device. Read-only. |
57 BluetoothProperty<uint32> bluetooth_class; | 57 dbus::Property<uint32> bluetooth_class; |
58 | 58 |
59 // List of 128-bit UUIDs that represent the available remote services. | 59 // List of 128-bit UUIDs that represent the available remote services. |
60 // Raed-only. | 60 // Raed-only. |
61 BluetoothProperty<std::vector<std::string> > uuids; | 61 dbus::Property<std::vector<std::string> > uuids; |
62 | 62 |
63 // List of characteristics-based available remote services. Read-only. | 63 // List of characteristics-based available remote services. Read-only. |
64 BluetoothProperty<std::vector<dbus::ObjectPath> > services; | 64 dbus::Property<std::vector<dbus::ObjectPath> > services; |
65 | 65 |
66 // Indicates that the device is currently paired. Read-only. | 66 // Indicates that the device is currently paired. Read-only. |
67 BluetoothProperty<bool> paired; | 67 dbus::Property<bool> paired; |
68 | 68 |
69 // Indicates that the device is currently connected. Read-only. | 69 // Indicates that the device is currently connected. Read-only. |
70 BluetoothProperty<bool> connected; | 70 dbus::Property<bool> connected; |
71 | 71 |
72 // Whether the device is trusted, and connections should be always | 72 // Whether the device is trusted, and connections should be always |
73 // accepted and attempted when the device is visible. | 73 // accepted and attempted when the device is visible. |
74 BluetoothProperty<bool> trusted; | 74 dbus::Property<bool> trusted; |
75 | 75 |
76 // Whether the device is blocked, connections will be always rejected | 76 // Whether the device is blocked, connections will be always rejected |
77 // and the device will not be visible. | 77 // and the device will not be visible. |
78 BluetoothProperty<bool> blocked; | 78 dbus::Property<bool> blocked; |
79 | 79 |
80 // Local alias for the device, if not set, is equal to |name|. | 80 // Local alias for the device, if not set, is equal to |name|. |
81 BluetoothProperty<std::string> alias; | 81 dbus::Property<std::string> alias; |
82 | 82 |
83 // List of object paths of nodes the device provides. Read-only. | 83 // List of object paths of nodes the device provides. Read-only. |
84 BluetoothProperty<std::vector<dbus::ObjectPath> > nodes; | 84 dbus::Property<std::vector<dbus::ObjectPath> > nodes; |
85 | 85 |
86 // Object path of the adapter the device belongs to. Read-only. | 86 // Object path of the adapter the device belongs to. Read-only. |
87 BluetoothProperty<dbus::ObjectPath> adapter; | 87 dbus::Property<dbus::ObjectPath> adapter; |
88 | 88 |
89 // Indicates whether the device is likely to only support pre-2.1 | 89 // Indicates whether the device is likely to only support pre-2.1 |
90 // PIN Code pairing rather than 2.1 Secure Simple Pairing, this can | 90 // PIN Code pairing rather than 2.1 Secure Simple Pairing, this can |
91 // give false positives. Read-only. | 91 // give false positives. Read-only. |
92 BluetoothProperty<bool> legacy_pairing; | 92 dbus::Property<bool> legacy_pairing; |
93 | 93 |
94 Properties(dbus::ObjectProxy* object_proxy, | 94 Properties(dbus::ObjectProxy* object_proxy, |
95 PropertyChangedCallback callback); | 95 PropertyChangedCallback callback); |
96 virtual ~Properties(); | 96 virtual ~Properties(); |
97 }; | 97 }; |
98 | 98 |
99 // Interface for observing changes from a remote bluetooth device. | 99 // Interface for observing changes from a remote bluetooth device. |
100 class Observer { | 100 class Observer { |
101 public: | 101 public: |
102 virtual ~Observer() {} | 102 virtual ~Observer() {} |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 protected: | 203 protected: |
204 BluetoothDeviceClient(); | 204 BluetoothDeviceClient(); |
205 | 205 |
206 private: | 206 private: |
207 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClient); | 207 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClient); |
208 }; | 208 }; |
209 | 209 |
210 } // namespace chromeos | 210 } // namespace chromeos |
211 | 211 |
212 #endif // CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ | 212 #endif // CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ |
OLD | NEW |