Skip to main content

BleBackend

Trait BleBackend 

Source
pub trait BleBackend<const MAX_PEERS: usize> {
    type Error: Debug;
    type Link: BleLink<Error = Self::Error>;

    // Required methods
    async fn set_advertising(
        &mut self,
        mode: AdvertisingMode,
    ) -> Result<(), Self::Error>;
    async fn next_event(&mut self) -> BleEvent<Self::Link>;
    async fn dial(&mut self, address: BleAddress) -> DialOutcome;

    // Provided methods
    fn blocked(&self) -> Option<&'static str> { ... }
    async fn set_scanning(
        &mut self,
        _mode: ScanningMode,
    ) -> Result<(), Self::Error> { ... }
    async fn set_radio_mode(
        &mut self,
        _mode: RadioMode,
    ) -> Result<(), Self::Error> { ... }
    async fn local_capabilities(
        &mut self,
        configured: LinkCapabilities,
    ) -> Result<LinkCapabilities, Self::Error> { ... }
    async fn on_link_closed(&mut self, _address: BleAddress) { ... }
}

Required Associated Types§

Source

type Error: Debug

Required Methods§

Source

async fn set_advertising( &mut self, mode: AdvertisingMode, ) -> Result<(), Self::Error>

Source

async fn next_event(&mut self) -> BleEvent<Self::Link>

Source

async fn dial(&mut self, address: BleAddress) -> DialOutcome

Provided Methods§

Source

fn blocked(&self) -> Option<&'static str>

A blocked backend is reported as a failed interface without bringing up the radio.

Source

async fn set_scanning(&mut self, _mode: ScanningMode) -> Result<(), Self::Error>

Source

async fn set_radio_mode(&mut self, _mode: RadioMode) -> Result<(), Self::Error>

Source

async fn local_capabilities( &mut self, configured: LinkCapabilities, ) -> Result<LinkCapabilities, Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§