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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_BLUETOOTH_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_BLUETOOTH_UTIL_H_
10 #include "base/callback_forward.h"
11 #include "device/bluetooth/bluetooth_device.h"
17 namespace extensions {
19 namespace easy_unlock {
21 struct SeekDeviceResult {
22 // Whether the connection to the device succeeded.
25 // If the connection failed, an error message describing the failure.
26 std::string error_message;
28 typedef base::Callback<void(const SeekDeviceResult& result)> SeekDeviceCallback;
30 // Connects to the SDP service on the Bluetooth device with the given
31 // |device_address|, if possible. Calls the |callback| with an indicator of
32 // success or an error message on failure.
33 void SeekBluetoothDeviceByAddress(const std::string& device_address,
34 const SeekDeviceCallback& callback);
36 void ConnectToBluetoothServiceInsecurely(
37 device::BluetoothDevice* device,
38 const device::BluetoothUUID& uuid,
39 const device::BluetoothDevice::ConnectToServiceCallback& callback,
40 const device::BluetoothDevice::ConnectToServiceErrorCallback&
43 } // namespace easy_unlock
45 } // namespace extensions
47 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_BLUETOOTH_UTIL_H_