pub struct BleConnector<'d> { /* private fields */ }unstable only.Expand description
A blocking HCI connector
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl<'d> BleConnector<'d>
impl<'d> BleConnector<'d>
Sourcepub fn new(
_init: &'d Controller<'d>,
device: BT<'d>,
config: Config,
) -> Result<BleConnector<'d>, InvalidConfigError>
pub fn new( _init: &'d Controller<'d>, device: BT<'d>, config: Config, ) -> Result<BleConnector<'d>, InvalidConfigError>
Create and init a new BLE connector.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn next(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
pub fn next(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
Read the next HCI packet from the BLE controller.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn read(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
Read from HCI.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub async fn read_async(
&mut self,
buf: &mut [u8],
) -> Result<usize, BleConnectorError>
pub async fn read_async( &mut self, buf: &mut [u8], ) -> Result<usize, BleConnectorError>
Read from HCI.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn write(&mut self, buf: &[u8]) -> Result<usize, BleConnectorError>
pub fn write(&mut self, buf: &[u8]) -> Result<usize, BleConnectorError>
Write to HCI.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Trait Implementations§
Source§impl Drop for BleConnector<'_>
impl Drop for BleConnector<'_>
Source§impl ErrorType for BleConnector<'_>
impl ErrorType for BleConnector<'_>
Source§type Error = BleConnectorError
type Error = BleConnectorError
Source§impl ErrorType for BleConnector<'_>
impl ErrorType for BleConnector<'_>
Source§type Error = BleConnectorError
type Error = BleConnectorError
Source§impl Read for BleConnector<'_>
impl Read for BleConnector<'_>
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl Read for BleConnector<'_>
impl Read for BleConnector<'_>
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl Read for BleConnector<'_>
impl Read for BleConnector<'_>
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl Read for BleConnector<'_>
impl Read for BleConnector<'_>
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, BleConnectorError>
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl Transport for BleConnector<'_>
impl Transport for BleConnector<'_>
Source§async fn read<'a>(
&self,
rx: &'a mut [u8],
) -> Result<ControllerToHostPacket<'a>, Self::Error>
async fn read<'a>( &self, rx: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, Self::Error>
Read a complete HCI packet into the rx buffer
Source§async fn write<T: HostToControllerPacket>(
&self,
val: &T,
) -> Result<(), Self::Error>
async fn write<T: HostToControllerPacket>( &self, val: &T, ) -> Result<(), Self::Error>
Write a complete HCI packet from the tx buffer