OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 dbus::Property<dbus::ObjectPath> adapter; | 69 dbus::Property<dbus::ObjectPath> adapter; |
70 | 70 |
71 // Indicates whether the device is likely to only support pre-2.1 | 71 // Indicates whether the device is likely to only support pre-2.1 |
72 // PIN Code pairing rather than 2.1 Secure Simple Pairing, this can | 72 // PIN Code pairing rather than 2.1 Secure Simple Pairing, this can |
73 // give false positives. Read-only. | 73 // give false positives. Read-only. |
74 dbus::Property<bool> legacy_pairing; | 74 dbus::Property<bool> legacy_pairing; |
75 | 75 |
76 // Remote Device ID information in Linux kernel modalias format. Read-only. | 76 // Remote Device ID information in Linux kernel modalias format. Read-only. |
77 dbus::Property<std::string> modalias; | 77 dbus::Property<std::string> modalias; |
78 | 78 |
79 // Received signal strength indicator. Read-only. | 79 // Received signal strength indicator that is set when the device is |
80 dbus::Property<int16> rssi; | 80 // discovered during inquiry. Read-only. |
81 dbus::Property<int16> inquiry_rssi; | |
keybuk
2014/05/09 00:35:25
Properties must match the D-Bus name, keep this as
Tim Song
2014/05/09 02:55:29
Done.
| |
82 | |
83 // Received signal strength indicator when a connection is open to the | |
84 // device. This property is not set unless connection monitor is enabled. | |
85 // Read-only. | |
86 dbus::Property<int16> connection_rssi; | |
87 | |
88 // The transmit power level of the host when a connection is open | |
89 // to the device. This property is not set unless connection monitor is | |
90 // enabled. Read-only. | |
91 dbus::Property<int16> tx_power; | |
keybuk
2014/05/09 00:35:25
This is called connection_tx_power in your cros_sy
Tim Song
2014/05/09 02:55:29
Done.
| |
92 | |
93 // The maximum transmit power level of the host that can be set | |
94 // when connected to the device. Read-only. | |
95 dbus::Property<int16> tx_power_max; | |
keybuk
2014/05/09 00:35:25
ditto
Tim Song
2014/05/09 02:55:29
Done.
| |
81 | 96 |
82 Properties(dbus::ObjectProxy* object_proxy, | 97 Properties(dbus::ObjectProxy* object_proxy, |
83 const std::string& interface_name, | 98 const std::string& interface_name, |
84 const PropertyChangedCallback& callback); | 99 const PropertyChangedCallback& callback); |
85 virtual ~Properties(); | 100 virtual ~Properties(); |
86 }; | 101 }; |
87 | 102 |
88 // Interface for observing changes from a remote bluetooth device. | 103 // Interface for observing changes from a remote bluetooth device. |
89 class Observer { | 104 class Observer { |
90 public: | 105 public: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 virtual void Pair(const dbus::ObjectPath& object_path, | 177 virtual void Pair(const dbus::ObjectPath& object_path, |
163 const base::Closure& callback, | 178 const base::Closure& callback, |
164 const ErrorCallback& error_callback) = 0; | 179 const ErrorCallback& error_callback) = 0; |
165 | 180 |
166 // Cancels an in-progress pairing with the device with object path | 181 // Cancels an in-progress pairing with the device with object path |
167 // |object_path| initiated by Pair(). | 182 // |object_path| initiated by Pair(). |
168 virtual void CancelPairing(const dbus::ObjectPath& object_path, | 183 virtual void CancelPairing(const dbus::ObjectPath& object_path, |
169 const base::Closure& callback, | 184 const base::Closure& callback, |
170 const ErrorCallback& error_callback) = 0; | 185 const ErrorCallback& error_callback) = 0; |
171 | 186 |
187 // Starts connection monitor for the device with object path | |
188 // |object_path|. Connection monitor is a mode the connection properties, | |
189 // RSSI and TX power are tracked and updated when they change. | |
190 virtual void StartConnectionMonitor(const dbus::ObjectPath& object_path, | |
191 const base::Closure& callback, | |
192 const ErrorCallback& error_callback) = 0; | |
193 | |
194 // Stops connection monitor for the device with object path | |
195 // |object_path|. | |
196 virtual void StopConnectionMonitor(const dbus::ObjectPath& object_path, | |
197 const base::Closure& callback, | |
198 const ErrorCallback& error_callback) = 0; | |
199 | |
172 // Creates the instance. | 200 // Creates the instance. |
173 static BluetoothDeviceClient* Create(); | 201 static BluetoothDeviceClient* Create(); |
174 | 202 |
175 // Constants used to indicate exceptional error conditions. | 203 // Constants used to indicate exceptional error conditions. |
176 static const char kNoResponseError[]; | 204 static const char kNoResponseError[]; |
177 static const char kUnknownDeviceError[]; | 205 static const char kUnknownDeviceError[]; |
178 | 206 |
179 protected: | 207 protected: |
180 BluetoothDeviceClient(); | 208 BluetoothDeviceClient(); |
181 | 209 |
182 private: | 210 private: |
183 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClient); | 211 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClient); |
184 }; | 212 }; |
185 | 213 |
186 } // namespace chromeos | 214 } // namespace chromeos |
187 | 215 |
188 #endif // CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ | 216 #endif // CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ |
OLD | NEW |