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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 that is set when the device is | 79 // Received signal strength indicator that is set when the device is |
80 // discovered during inquiry. Read-only. | 80 // discovered during inquiry. Read-only. |
81 dbus::Property<int16> rssi; | 81 dbus::Property<int16> rssi; |
82 | 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> connection_tx_power; | |
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> connection_tx_power_max; | |
96 | |
97 Properties(dbus::ObjectProxy* object_proxy, | 83 Properties(dbus::ObjectProxy* object_proxy, |
98 const std::string& interface_name, | 84 const std::string& interface_name, |
99 const PropertyChangedCallback& callback); | 85 const PropertyChangedCallback& callback); |
100 virtual ~Properties(); | 86 virtual ~Properties(); |
101 }; | 87 }; |
102 | 88 |
103 // Interface for observing changes from a remote bluetooth device. | 89 // Interface for observing changes from a remote bluetooth device. |
104 class Observer { | 90 class Observer { |
105 public: | 91 public: |
106 virtual ~Observer() {} | 92 virtual ~Observer() {} |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 virtual void Pair(const dbus::ObjectPath& object_path, | 163 virtual void Pair(const dbus::ObjectPath& object_path, |
178 const base::Closure& callback, | 164 const base::Closure& callback, |
179 const ErrorCallback& error_callback) = 0; | 165 const ErrorCallback& error_callback) = 0; |
180 | 166 |
181 // Cancels an in-progress pairing with the device with object path | 167 // Cancels an in-progress pairing with the device with object path |
182 // |object_path| initiated by Pair(). | 168 // |object_path| initiated by Pair(). |
183 virtual void CancelPairing(const dbus::ObjectPath& object_path, | 169 virtual void CancelPairing(const dbus::ObjectPath& object_path, |
184 const base::Closure& callback, | 170 const base::Closure& callback, |
185 const ErrorCallback& error_callback) = 0; | 171 const ErrorCallback& error_callback) = 0; |
186 | 172 |
187 // Starts connection monitor for the device with object path | 173 // The callback invoked for as successful GetConnInfo API call with the |
armansito
2015/01/06 20:36:07
nit: s/for as/for a/
Tim Song
2015/01/06 22:30:50
Done.
| |
188 // |object_path|. Connection monitor is a mode the connection properties, | 174 // RSSI, TX power, and maximum TX power of the current connection. |
189 // RSSI and TX power are tracked and updated when they change. | 175 typedef base::Callback<void(int16 rssi, |
190 virtual void StartConnectionMonitor(const dbus::ObjectPath& object_path, | 176 int16 transmit_power, |
191 const base::Closure& callback, | 177 int16 max_transmit_power)> ConnInfoCallback; |
192 const ErrorCallback& error_callback) = 0; | |
193 | 178 |
194 // Stops connection monitor for the device with object path | 179 // Returns the RSSI, TX power, and maximum TX power of a connection to the |
195 // |object_path|. | 180 // device with object path |object_path|. If the device is not connected, then |
196 virtual void StopConnectionMonitor(const dbus::ObjectPath& object_path, | 181 // an error will be returned. |
197 const base::Closure& callback, | 182 virtual void GetConnInfo(const dbus::ObjectPath& object_path, |
198 const ErrorCallback& error_callback) = 0; | 183 const ConnInfoCallback& callback, |
184 const ErrorCallback& error_callback) = 0; | |
199 | 185 |
200 // Creates the instance. | 186 // Creates the instance. |
201 static BluetoothDeviceClient* Create(); | 187 static BluetoothDeviceClient* Create(); |
202 | 188 |
203 // Constants used to indicate exceptional error conditions. | 189 // Constants used to indicate exceptional error conditions. |
204 static const char kNoResponseError[]; | 190 static const char kNoResponseError[]; |
205 static const char kUnknownDeviceError[]; | 191 static const char kUnknownDeviceError[]; |
206 | 192 |
207 protected: | 193 protected: |
208 BluetoothDeviceClient(); | 194 BluetoothDeviceClient(); |
209 | 195 |
210 private: | 196 private: |
211 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClient); | 197 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClient); |
212 }; | 198 }; |
213 | 199 |
214 } // namespace chromeos | 200 } // namespace chromeos |
215 | 201 |
216 #endif // CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ | 202 #endif // CHROMEOS_DBUS_BLUETOOTH_DEVICE_CLIENT_H_ |
OLD | NEW |