rust/bt-broadcast-assistant: Fix build error
Commit 183ecc082443d1ac8dad9fe64e784c2743382171 was rebased off of an
older version of the repo before
ea7e38d0a2aa3e2e0a43c3d02a86363e6eb0c9ff was merged into the tree. There
was a change in `add_broadcast_source` method parameters that was missed
because of the untimely rebase.
Fix the build error for debug tool.
Bug: 425444321
Change-Id: I532692e73d6b6076e2d39d0ddd4ab0d6d29ab331
Reviewed-on: https://bluetooth-review.googlesource.com/c/bluetooth/+/2560
Reviewed-by: Marie Janssen <jamuraa@google.com>
diff --git a/rust/bt-broadcast-assistant/src/debug.rs b/rust/bt-broadcast-assistant/src/debug.rs
index 9939810..02d3cb7 100644
--- a/rust/bt-broadcast-assistant/src/debug.rs
+++ b/rust/bt-broadcast-assistant/src/debug.rs
@@ -11,6 +11,7 @@
use bt_common::debug_command::CommandSet;
use bt_common::gen_commandset;
use bt_common::PeerId;
+use bt_gatt::pii::GetPeerAddr;
use futures::stream::FusedStream;
use futures::Future;
@@ -44,14 +45,15 @@
}
}
-pub struct AssistantDebug<T: bt_gatt::GattTypes> {
+pub struct AssistantDebug<T: bt_gatt::GattTypes, R: GetPeerAddr> {
assistant: BroadcastAssistant<T>,
connected_peer: Mutex<Option<Arc<Peer<T>>>>,
started: bool,
+ peer_addr_getter: R,
}
-impl<T: bt_gatt::GattTypes + 'static> AssistantDebug<T> {
- pub fn new(central: T::Central) -> Self
+impl<T: bt_gatt::GattTypes + 'static, R: GetPeerAddr> AssistantDebug<T, R> {
+ pub fn new(central: T::Central, peer_addr_getter: R) -> Self
where
<T as bt_gatt::GattTypes>::NotificationStream: std::marker::Send,
{
@@ -59,6 +61,7 @@
assistant: BroadcastAssistant::<T>::new(central),
connected_peer: Mutex::new(None),
started: false,
+ peer_addr_getter,
}
}
@@ -155,7 +158,7 @@
}).collect()
}
-impl<T: bt_gatt::GattTypes + 'static> CommandRunner for AssistantDebug<T>
+impl<T: bt_gatt::GattTypes + 'static, R: GetPeerAddr> CommandRunner for AssistantDebug<T, R>
where
<T as bt_gatt::GattTypes>::NotificationStream: std::marker::Send,
{
@@ -260,7 +263,7 @@
if args.len() == 3 { parse_bis_sync(&args[2]) } else { HashSet::new() };
self.with_peer(|peer| async move {
- peer.add_broadcast_source(broadcast_source_pid, pa_sync, bis_sync).await
+ peer.add_broadcast_source(broadcast_source_pid, &self.peer_addr_getter, pa_sync, bis_sync).await
})
.await;
}