pub struct Stack<'stack, C, P: PacketPool> { /* private fields */ }Expand description
Contains the host stack
Implementations§
Source§impl<'stack, C: Controller, P: PacketPool> Stack<'stack, C, P>
impl<'stack, C: Controller, P: PacketPool> Stack<'stack, C, P>
Sourcepub fn runner(&self) -> Runner<'_, C, P>
pub fn runner(&self) -> Runner<'_, C, P>
Obtain a Runner to drive the BLE host.
The runner must be polled (e.g. via Runner::run()) to drive the BLE host.
Sourcepub fn central(&self) -> Central<'_, C, P>
pub fn central(&self) -> Central<'_, C, P>
Obtain a Central handle for the central BLE role.
This is a lightweight handle that can be created multiple times. Concurrent connect operations are serialized internally.
Sourcepub fn peripheral(&self) -> Peripheral<'_, C, P>
pub fn peripheral(&self) -> Peripheral<'_, C, P>
Obtain a Peripheral handle for the peripheral BLE role.
This is a lightweight handle that can be created multiple times. Concurrent advertise operations are serialized internally.
Sourcepub async fn command<T>(
&self,
cmd: T,
) -> Result<T::Return, BleHostError<C::Error>>where
T: SyncCmd,
C: ControllerCmdSync<T>,
pub async fn command<T>(
&self,
cmd: T,
) -> Result<T::Return, BleHostError<C::Error>>where
T: SyncCmd,
C: ControllerCmdSync<T>,
Run a HCI command and return the response.
Sourcepub async fn async_command<T>(
&self,
cmd: T,
) -> Result<(), BleHostError<C::Error>>where
T: AsyncCmd,
C: ControllerCmdAsync<T>,
pub async fn async_command<T>(
&self,
cmd: T,
) -> Result<(), BleHostError<C::Error>>where
T: AsyncCmd,
C: ControllerCmdAsync<T>,
Run an async HCI command where the response will generate an event later.
Sourcepub async fn read_minimum_supported_connection_interval(
&self,
) -> Result<<LeReadMinimumSupportedConnectionInterval as SyncCmd>::Return, BleHostError<C::Error>>
pub async fn read_minimum_supported_connection_interval( &self, ) -> Result<<LeReadMinimumSupportedConnectionInterval as SyncCmd>::Return, BleHostError<C::Error>>
Read the minimum supported connection interval from the controller.
Sourcepub fn metrics<F: FnOnce(&HostMetrics) -> R, R>(&self, f: F) -> R
pub fn metrics<F: FnOnce(&HostMetrics) -> R, R>(&self, f: F) -> R
Read current host metrics
Sourcepub fn log_status(&self, verbose: bool)
pub fn log_status(&self, verbose: bool)
Log status information of the host
Sourcepub fn get_connection_by_peer_address(
&self,
peer_address: Address,
) -> Option<Connection<'_, P>>
pub fn get_connection_by_peer_address( &self, peer_address: Address, ) -> Option<Connection<'_, P>>
Get a connection by its peer address
Sourcepub fn get_connected_handle(
&self,
handle: ConnHandle,
) -> Option<Connection<'_, P>>
pub fn get_connected_handle( &self, handle: ConnHandle, ) -> Option<Connection<'_, P>>
Get a connection by its handle
Sourcepub fn connections(&self) -> ConnectedIter<'_, P>
pub fn connections(&self) -> ConnectedIter<'_, P>
Iterate over all currently connected connections.