| Index: components/proximity_auth/ble/bluetooth_low_energy_weave_channel.h
|
| diff --git a/components/proximity_auth/ble/bluetooth_low_energy_weave_channel.h b/components/proximity_auth/ble/bluetooth_low_energy_weave_channel.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f15f3a7efe74f997abd397c21354d8eee21fa6b3
|
| --- /dev/null
|
| +++ b/components/proximity_auth/ble/bluetooth_low_energy_weave_channel.h
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2016 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_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CHANNEL_H_
|
| +#define COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CHANNEL_H_
|
| +
|
| +#include <stddef.h>
|
| +#include <stdint.h>
|
| +
|
| +#include <memory>
|
| +#include <vector>
|
| +
|
| +#include "base/memory/ref_counted.h"
|
| +#include "components/proximity_auth/ble/bluetooth_low_energy_weave_defines.h"
|
| +#include "components/proximity_auth/ble/bluetooth_low_energy_weave_server_connection.h"
|
| +#include "device/bluetooth/bluetooth_device.h"
|
| +
|
| +namespace proximity_auth {
|
| +namespace weave {
|
| +
|
| +class BluetoothLowEnergyWeaveChannel {
|
| + public:
|
| + class Observer {
|
| + public:
|
| + virtual void OnChannelAuthenticated(
|
| + std::string device_id,
|
| + const device::BluetoothDevice* bluetooth_device) = 0;
|
| +
|
| + virtual void OnChannelDisconnected(
|
| + std::string device_id,
|
| + const device::BluetoothDevice* bluetooth_device) = 0;
|
| + };
|
| +
|
| + BluetoothLowEnergyWeaveChannel(
|
| + const device::BluetoothDevice* bluetooth_device,
|
| + base::WeakPtr<BluetoothLocalGattCharacteristic> rx_characteristic);
|
| +
|
| + ~BluetoothLowEnergyWeaveChannel();
|
| +
|
| + void RegisterObserver(std::shared_ptr<Observer> observer);
|
| +
|
| + std::shared_ptr<BluetoothLowEnergyWeaveServerConnection>
|
| + GetServerConnection();
|
| +
|
| + void ReceivePacket(Packet packet) {}
|
| +
|
| + private:
|
| + std::vector<std::shared_ptr<Observer>> observers_;
|
| +};
|
| +
|
| +} // namespace weave
|
| +
|
| +} // namespace proximity_auth
|
| +
|
| +#endif // COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CHANNEL_H_
|
|
|