embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

BluetoothHci

Struct BluetoothHci 

Source
pub struct BluetoothHci<'d, D: Driver<'d>> { /* private fields */ }
Expand description

USB Bluetooth HCI class device.

Implementations§

Source§

impl<'d, D: Driver<'d>> BluetoothHci<'d, D>

Source

pub fn new( builder: &mut Builder<'d, D>, state: &'d mut State<'d>, config: Config<'d>, ) -> Self

Create a new Bluetooth HCI device class instance on the USB builder.

Source

pub fn split( self, ) -> (HciCommandReader<'d>, HciEventWriter<'d, D>, AclReader<'d, D>, AclWriter<'d, D>)

Split this driver into separate command, event, and ACL reader/writer handles.

Source

pub async fn wait_connection(&mut self)

Waits for the USB host to enable this interface.

Source

pub async fn read_command( &mut self, buf: &mut [u8], ) -> Result<usize, EndpointError>

Asynchronously await and read the next HCI Command from the host (received on EP0). Returns the number of bytes copied into buf.

Source

pub async fn send_event(&mut self, event: &[u8]) -> Result<(), EndpointError>

Asynchronously send an HCI Event packet to the host on the Interrupt IN endpoint.

Source

pub async fn read_acl(&mut self, buf: &mut [u8]) -> Result<usize, EndpointError>

Asynchronously read an ACL Data packet from the host on the Bulk OUT endpoint. Returns the number of bytes copied into buf.

Source

pub async fn send_acl(&mut self, data: &[u8]) -> Result<(), EndpointError>

Asynchronously send an ACL Data packet to the host on the Bulk IN endpoint.

Auto Trait Implementations§

§

impl<'d, D> !RefUnwindSafe for BluetoothHci<'d, D>

§

impl<'d, D> !UnwindSafe for BluetoothHci<'d, D>

§

impl<'d, D> Forget for BluetoothHci<'d, D>

§

impl<'d, D> Freeze for BluetoothHci<'d, D>
where HciEventWriter<'d, D>: Freeze, AclReader<'d, D>: Freeze, AclWriter<'d, D>: Freeze,

§

impl<'d, D> Move for BluetoothHci<'d, D>

§

impl<'d, D> Send for BluetoothHci<'d, D>
where HciEventWriter<'d, D>: Send, AclReader<'d, D>: Send, AclWriter<'d, D>: Send,

§

impl<'d, D> Sync for BluetoothHci<'d, D>
where HciEventWriter<'d, D>: Sync, AclReader<'d, D>: Sync, AclWriter<'d, D>: Sync,

§

impl<'d, D> Unpin for BluetoothHci<'d, D>
where HciEventWriter<'d, D>: Unpin, AclReader<'d, D>: Unpin, AclWriter<'d, D>: Unpin,

§

impl<'d, D> UnsafeUnpin for BluetoothHci<'d, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.