Skip to main content

BluetoothDevice

Struct BluetoothDevice 

Source
pub struct BluetoothDevice { /* private fields */ }
Expand description

The upper half of the Bluetooth device. Start its runner on a local task before opening the device. Each successful opening owns the controller until its work has been cancelled and its connection released.

Implementations§

Source§

impl BluetoothDevice

Source

pub async fn run<C: Controller>(&self, controller: C) -> Result<()>

Run the service on a local Xila task. The platform supplies the HCI controller, critical section implementation and Embassy time driver. Cancelling the future stops the service. The platform must reset or discard the controller before restarting after a failure.

Source§

impl BluetoothDevice

Source

pub const fn new() -> Self

Trait Implementations§

Source§

impl BaseOperations for BluetoothDevice

Source§

fn open(&self, context: &mut Context) -> Result<()>

Source§

fn close(&self, context: &mut Context) -> Result<()>

Source§

fn clone_context(&self, _: &Context) -> Result<Context>

Source§

fn read( &self, _: &mut Context, context: &mut TaskContext<'_>, buffer: &mut [u8], _: Size, ) -> Poll<Result<usize>>

Source§

fn cancel_operation(&self, _: &mut Context, operation: Operation)

Detach this opening’s registration after completion, error or cancellation. This hook is idempotent and must not consume data or change the cursor. Wake and drop retired wakers outside device locks.
Source§

fn write( &self, _: &mut Context, _: &mut TaskContext<'_>, _: &[u8], _: Size, ) -> Poll<Result<usize>>

Source§

fn control( &self, _: &mut Context, _: &mut TaskContext<'_>, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Poll<Result<()>>

§

fn flush( &self, _context: &mut Context, _cx: &mut Context<'_>, ) -> Poll<Result<(), Kind>>

§

fn read_until( &self, context: &mut Context, cx: &mut Context<'_>, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Poll<Result<usize, Kind>>

§

fn write_pattern( &self, context: &mut Context, cx: &mut Context<'_>, pattern: &[u8], count: usize, absolute_position: u64, ) -> Poll<Result<usize, Kind>>

§

fn write_vectored( &self, context: &mut Context, cx: &mut Context<'_>, buffers: &[&[u8]], absolute_position: u64, ) -> Poll<Result<usize, Kind>>

§

fn read_sync( &self, context: &mut Context, buffer: &mut [u8], absolute_position: u64, ) -> Result<usize, Kind>

§

fn write_sync( &self, context: &mut Context, buffer: &[u8], absolute_position: u64, ) -> Result<usize, Kind>

§

fn flush_sync(&self, context: &mut Context) -> Result<(), Kind>

§

fn control_sync( &self, context: &mut Context, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Result<(), Kind>

§

fn read_until_sync( &self, context: &mut Context, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Result<usize, Kind>

§

fn write_pattern_sync( &self, context: &mut Context, pattern: &[u8], count: usize, absolute_position: u64, ) -> Result<usize, Kind>

§

fn write_vectored_sync( &self, context: &mut Context, buffers: &[&[u8]], absolute_position: u64, ) -> Result<usize, Kind>

§

fn set_position( &self, _context: &mut Context, current: u64, position: &Position, ) -> Result<u64, Kind>

Source§

impl CharacterDevice for BluetoothDevice

Source§

fn readiness(&self, interests: ReadyEvents) -> Result<Option<ReadyEvents>>

Snapshot device readiness without consuming data. Return None to use the VFS fallback, which reports the requested read/write directions allowed by the opening’s access mode. I/O on such devices may still suspend. Read more
Source§

impl Default for BluetoothDevice

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl MountOperations for BluetoothDevice

§

fn mount(&self) -> Result<(), Kind>

§

fn unmount(&self) -> Result<(), Kind>

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,