| Index: components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h
|
| diff --git a/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0c2d3f31903a729fa87256a1b25a8f02754c1b1a
|
| --- /dev/null
|
| +++ b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H
|
| +#define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/macros.h"
|
| +#include "components/cryptauth/bluetooth_throttler.h"
|
| +#include "components/cryptauth/remote_device.h"
|
| +#include "components/proximity_auth/bluetooth_low_energy_connection_finder.h"
|
| +#include "device/bluetooth/bluetooth_device.h"
|
| +
|
| +namespace proximity_auth {
|
| +
|
| +// This cryptauth::ConnectionFinder implementation is specialized in finding a
|
| +// Bluetooth Low Energy remote device based on the advertised service UUID.
|
| +class BluetoothLowEnergySetupConnectionFinder
|
| + : public BluetoothLowEnergyConnectionFinder {
|
| + public:
|
| + // Finds (and connects) to a Bluetooth low energy device, based on the UUID
|
| + // advertised by the remote device.
|
| + //
|
| + // |remote_service_uuid|: The UUID of the service used to send/receive data in
|
| + // remote device.
|
| + // |bluetooth_throttler|: The reconnection throttler.
|
| + BluetoothLowEnergySetupConnectionFinder(
|
| + const std::string& remote_service_uuid,
|
| + cryptauth::BluetoothThrottler* bluetooth_throttler);
|
| +
|
| + private:
|
| + // Checks if |device| is the right device, that is is adversing tthe right
|
| + // service UUID.
|
| + bool IsRightDevice(device::BluetoothDevice* device) override;
|
| +
|
| + // The UUID of the service advertised by the remote device.
|
| + device::BluetoothUUID remote_service_uuid_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergySetupConnectionFinder);
|
| +};
|
| +
|
| +} // namespace proximity_auth
|
| +
|
| +#endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H
|
|
|