pub struct Advertiser<'d, C, P: PacketPool> { /* private fields */ }Expand description
Handle to an active advertiser which can accept connections.
Implementations§
Source§impl<'d, C: Controller, P: PacketPool> Advertiser<'d, C, P>
impl<'d, C: Controller, P: PacketPool> Advertiser<'d, C, P>
Sourcepub async fn accept(self) -> Result<Connection<'d, P>, Error>
pub async fn accept(self) -> Result<Connection<'d, P>, Error>
Accept the next peripheral connection for this advertiser.
Returns Error::Timeout if advertiser stopped.
For a legacy advertiser, a returned connection is what stops the advertising: the runner
disables legacy advertising in the controller before the state is idle again. This also
covers a connection that an earlier (replaced) advertising made: the controller stops that
advertising itself and reports the connection to this advertiser, and its own advertising
would otherwise stay enabled. Disabling legacy advertising that is already disabled has no
effect (Bluetooth Core v6.2, Vol 4, Part E, §7.8.9), so this is safe when the controller
already stopped the advertising. If the future is dropped before it completes, the
advertising is disabled as when an Advertiser is dropped.
For an extended advertiser, the controller stops the advertising set that made the connection itself, and no disable command is sent. Other advertising sets are not affected.