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

Side by Side Diff: device/bluetooth/bluetooth_device_chromeos.h

Issue 273953002: Hook up RSSI and host transmit power Bluetooth device properties for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Start connection monitor when connected through chrome.bluetooth API Created 6 years, 7 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
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 DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const device::BluetoothUUID& uuid, 75 const device::BluetoothUUID& uuid,
76 const ConnectToServiceCallback& callback, 76 const ConnectToServiceCallback& callback,
77 const ConnectToServiceErrorCallback& error_callback) OVERRIDE; 77 const ConnectToServiceErrorCallback& error_callback) OVERRIDE;
78 virtual void SetOutOfBandPairingData( 78 virtual void SetOutOfBandPairingData(
79 const device::BluetoothOutOfBandPairingData& data, 79 const device::BluetoothOutOfBandPairingData& data,
80 const base::Closure& callback, 80 const base::Closure& callback,
81 const ErrorCallback& error_callback) OVERRIDE; 81 const ErrorCallback& error_callback) OVERRIDE;
82 virtual void ClearOutOfBandPairingData( 82 virtual void ClearOutOfBandPairingData(
83 const base::Closure& callback, 83 const base::Closure& callback,
84 const ErrorCallback& error_callback) OVERRIDE; 84 const ErrorCallback& error_callback) OVERRIDE;
85 virtual void StartConnectionMonitor(
86 const base::Closure& callback,
87 const ErrorCallback& error_callback) OVERRIDE;
88 virtual void StopConnectionMonitor(
89 const base::Closure& callback,
90 const ErrorCallback& error_callback) OVERRIDE;
85 91
86 // Creates a pairing object with the given delegate |pairing_delegate| and 92 // Creates a pairing object with the given delegate |pairing_delegate| and
87 // establishes it as the pairing context for this device. All pairing-related 93 // establishes it as the pairing context for this device. All pairing-related
88 // method calls will be forwarded to this object until it is released. 94 // method calls will be forwarded to this object until it is released.
89 BluetoothPairingChromeOS* BeginPairing( 95 BluetoothPairingChromeOS* BeginPairing(
90 BluetoothDevice::PairingDelegate* pairing_delegate); 96 BluetoothDevice::PairingDelegate* pairing_delegate);
91 97
92 // Releases the current pairing object, any pairing-related method calls will 98 // Releases the current pairing object, any pairing-related method calls will
93 // be ignored. 99 // be ignored.
94 void EndPairing(); 100 void EndPairing();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // Called by dbus:: on completion of the D-Bus method call to 169 // Called by dbus:: on completion of the D-Bus method call to
164 // connect a peofile. 170 // connect a peofile.
165 void OnConnectProfile(device::BluetoothProfile* profile, 171 void OnConnectProfile(device::BluetoothProfile* profile,
166 const base::Closure& callback); 172 const base::Closure& callback);
167 void OnConnectProfileError( 173 void OnConnectProfileError(
168 device::BluetoothProfile* profile, 174 device::BluetoothProfile* profile,
169 const ConnectToProfileErrorCallback& error_callback, 175 const ConnectToProfileErrorCallback& error_callback,
170 const std::string& error_name, 176 const std::string& error_name,
171 const std::string& error_message); 177 const std::string& error_message);
172 178
179 // Called by dbus:: on completion of the D-Bus method call to start the
180 // connection monitor.
181 void OnStartConnectionMonitor(const base::Closure& callback);
182 void OnStartConnectionMonitorError(const ErrorCallback& error_callback,
183 const std::string& error_name,
184 const std::string& error_message);
185
173 // Returns the object path of the device; used by BluetoothAdapterChromeOS 186 // Returns the object path of the device; used by BluetoothAdapterChromeOS
174 const dbus::ObjectPath& object_path() const { return object_path_; } 187 const dbus::ObjectPath& object_path() const { return object_path_; }
175 188
176 // The adapter that owns this device instance. 189 // The adapter that owns this device instance.
177 BluetoothAdapterChromeOS* adapter_; 190 BluetoothAdapterChromeOS* adapter_;
178 191
179 // The dbus object path of the device object. 192 // The dbus object path of the device object.
180 dbus::ObjectPath object_path_; 193 dbus::ObjectPath object_path_;
181 194
182 // List of observers interested in event notifications from us. 195 // List of observers interested in event notifications from us.
183 ObserverList<device::BluetoothDevice::Observer> observers_; 196 ObserverList<device::BluetoothDevice::Observer> observers_;
184 197
185 // Number of ongoing calls to Connect(). 198 // Number of ongoing calls to Connect().
186 int num_connecting_calls_; 199 int num_connecting_calls_;
187 200
201 // True if the connection monitor has been started, tracking the connection
202 // RSSI and TX power.
203 bool connection_monitor_started_;
204
188 // UI thread task runner and socket thread object used to create sockets. 205 // UI thread task runner and socket thread object used to create sockets.
189 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; 206 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
190 scoped_refptr<device::BluetoothSocketThread> socket_thread_; 207 scoped_refptr<device::BluetoothSocketThread> socket_thread_;
191 208
192 // During pairing this is set to an object that we don't own, but on which 209 // During pairing this is set to an object that we don't own, but on which
193 // we can make method calls to request, display or confirm PIN Codes and 210 // we can make method calls to request, display or confirm PIN Codes and
194 // Passkeys. Generally it is the object that owns this one. 211 // Passkeys. Generally it is the object that owns this one.
195 scoped_ptr<BluetoothPairingChromeOS> pairing_; 212 scoped_ptr<BluetoothPairingChromeOS> pairing_;
196 213
197 // Note: This should remain the last member so it'll be destroyed and 214 // Note: This should remain the last member so it'll be destroyed and
198 // invalidate its weak pointers before any other members are destroyed. 215 // invalidate its weak pointers before any other members are destroyed.
199 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; 216 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_;
200 217
201 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); 218 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS);
202 }; 219 };
203 220
204 } // namespace chromeos 221 } // namespace chromeos
205 222
206 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 223 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698