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
impl BluetoothDevice
Sourcepub async fn run<C: Controller>(&self, controller: C) -> Result<()>
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.
Trait Implementations§
Source§impl BaseOperations for BluetoothDevice
impl BaseOperations for BluetoothDevice
fn open(&self, context: &mut Context) -> Result<()>
fn close(&self, context: &mut Context) -> Result<()>
fn clone_context(&self, _: &Context) -> Result<Context>
fn read( &self, _: &mut Context, context: &mut TaskContext<'_>, buffer: &mut [u8], _: Size, ) -> Poll<Result<usize>>
Source§fn cancel_operation(&self, _: &mut Context, operation: Operation)
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.
fn write( &self, _: &mut Context, _: &mut TaskContext<'_>, _: &[u8], _: Size, ) -> Poll<Result<usize>>
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
impl CharacterDevice for BluetoothDevice
Source§fn readiness(&self, interests: ReadyEvents) -> Result<Option<ReadyEvents>>
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 moreSource§impl Default for BluetoothDevice
impl Default for BluetoothDevice
Auto Trait Implementations§
impl !Freeze for BluetoothDevice
impl !RefUnwindSafe for BluetoothDevice
impl Send for BluetoothDevice
impl Sync for BluetoothDevice
impl Unpin for BluetoothDevice
impl UnsafeUnpin for BluetoothDevice
impl UnwindSafe for BluetoothDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more