pub async fn scan<'d>(
stack: &Stack<'_, Controller<'d>, DefaultPacketPool>,
duration: Duration,
on_advertisement: impl FnMut(&Advertisement<'_>),
) -> Result<(), HostError>Expand description
Scans for duration, calling on_advertisement for every report
(duplicates included, so signal strength stays current). Active
scanning, 100 ms interval and window, so names usually arrive too.
Runs the host while scanning; nothing else can use stack meanwhile.