| OLD | NEW |
| (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_ |
| OLD | NEW |