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

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_weave_channel.h

Issue 2183523006: Chrome OS uWeave Characteristics Server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migration
Patch Set: added channel Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698