Refactor bluetooth code to use shared pointers instead of references.

This commit is contained in:
Vibhav Pant
2023-09-05 19:45:10 +05:30
parent e8236aad62
commit ad7401616b
11 changed files with 85 additions and 94 deletions
@@ -31,7 +31,7 @@ namespace nearby {
namespace linux {
class BluetoothPairing final : public api::BluetoothPairing {
public:
BluetoothPairing(BluetoothAdapter &adapter, BluetoothDevice &remote_device);
BluetoothPairing(BluetoothAdapter &adapter, std::shared_ptr<BluetoothDevice> remote_device);
bool InitiatePairing(api::BluetoothPairingCallback pairing_cb) override;
bool FinishPairing(std::optional<absl::string_view> pin_code) override;
@@ -44,7 +44,7 @@ class BluetoothPairing final : public api::BluetoothPairing {
sdbus::PendingAsyncCall pair_async_call_;
BluetoothDevice &device_;
std::shared_ptr<BluetoothDevice> device_;
linux::BluetoothAdapter &adapter_;
api::BluetoothPairingCallback pairing_cb_;