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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CHANNEL_H_
6 #define COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CHANNEL_H_
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #include <memory>
12 #include <vector>
13
14 #include "base/memory/ref_counted.h"
15 #include "components/proximity_auth/ble/bluetooth_low_energy_weave_defines.h"
16 #include "components/proximity_auth/ble/bluetooth_low_energy_weave_server_connec tion.h"
17 #include "device/bluetooth/bluetooth_device.h"
18
19 namespace proximity_auth {
20 namespace weave {
21
22 class BluetoothLowEnergyWeaveChannel {
23 public:
24 class Observer {
25 public:
26 virtual void OnChannelAuthenticated(
27 std::string device_id,
28 const device::BluetoothDevice* bluetooth_device) = 0;
29
30 virtual void OnChannelDisconnected(
31 std::string device_id,
32 const device::BluetoothDevice* bluetooth_device) = 0;
33 };
34
35 BluetoothLowEnergyWeaveChannel(
36 const device::BluetoothDevice* bluetooth_device,
37 base::WeakPtr<BluetoothLocalGattCharacteristic> rx_characteristic);
38
39 ~BluetoothLowEnergyWeaveChannel();
40
41 void RegisterObserver(std::shared_ptr<Observer> observer);
42
43 std::shared_ptr<BluetoothLowEnergyWeaveServerConnection>
44 GetServerConnection();
45
46 void ReceivePacket(Packet packet) {}
47
48 private:
49 std::vector<std::shared_ptr<Observer>> observers_;
50 };
51
52 } // namespace weave
53
54 } // namespace proximity_auth
55
56 #endif // COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698