pub struct ExternalController<T, const SLOTS: usize> { /* private fields */ }
Expand description
An external Bluetooth controller with communication via Transport
type T
.
The controller state holds a number of command slots that can be used to issue commands and await responses from an underlying controller.
The contract is that before sending a command, a slot is reserved, which returns a signal handle that can be used to await a response.
Implementations§
Source§impl<T, const SLOTS: usize> ExternalController<T, SLOTS>
impl<T, const SLOTS: usize> ExternalController<T, SLOTS>
Sourcepub fn new(transport: T) -> ExternalController<T, SLOTS>
pub fn new(transport: T) -> ExternalController<T, SLOTS>
Create a new instance.
Trait Implementations§
Source§impl<T, const SLOTS: usize> Controller for ExternalController<T, SLOTS>where
T: Transport,
impl<T, const SLOTS: usize> Controller for ExternalController<T, SLOTS>where
T: Transport,
Source§async fn write_acl_data(
&self,
packet: &AclPacket<'_>,
) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
async fn write_acl_data( &self, packet: &AclPacket<'_>, ) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
Write ACL data to the controller.
Source§async fn write_sync_data(
&self,
packet: &SyncPacket<'_>,
) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
async fn write_sync_data( &self, packet: &SyncPacket<'_>, ) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
Write Sync data to the controller.
Source§async fn write_iso_data(
&self,
packet: &IsoPacket<'_>,
) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
async fn write_iso_data( &self, packet: &IsoPacket<'_>, ) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
Write Iso data to the controller.
Source§async fn read<'a>(
&self,
buf: &'a mut [u8],
) -> Result<ControllerToHostPacket<'a>, <ExternalController<T, SLOTS> as ErrorType>::Error>
async fn read<'a>( &self, buf: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, <ExternalController<T, SLOTS> as ErrorType>::Error>
Read a valid HCI packet from the controller.
Source§impl<T, const SLOTS: usize> Controller for ExternalController<T, SLOTS>where
T: Transport,
impl<T, const SLOTS: usize> Controller for ExternalController<T, SLOTS>where
T: Transport,
Source§fn write_acl_data(
&self,
packet: &AclPacket<'_>,
) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
fn write_acl_data( &self, packet: &AclPacket<'_>, ) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
Write ACL data to the controller. Blocks until done.
Source§fn write_sync_data(
&self,
packet: &SyncPacket<'_>,
) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
fn write_sync_data( &self, packet: &SyncPacket<'_>, ) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
Write Sync data to the controller. Blocks until done.
Source§fn write_iso_data(
&self,
packet: &IsoPacket<'_>,
) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
fn write_iso_data( &self, packet: &IsoPacket<'_>, ) -> Result<(), <ExternalController<T, SLOTS> as ErrorType>::Error>
Write Iso data to the controller. Blocks until done.
Source§fn read<'a>(
&self,
buf: &'a mut [u8],
) -> Result<ControllerToHostPacket<'a>, <ExternalController<T, SLOTS> as ErrorType>::Error>
fn read<'a>( &self, buf: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, <ExternalController<T, SLOTS> as ErrorType>::Error>
Read a valid HCI packet from the controller. Blocks until done.
Source§fn try_write_acl_data(
&self,
packet: &AclPacket<'_>,
) -> Result<(), TryError<<ExternalController<T, SLOTS> as ErrorType>::Error>>
fn try_write_acl_data( &self, packet: &AclPacket<'_>, ) -> Result<(), TryError<<ExternalController<T, SLOTS> as ErrorType>::Error>>
Attempt to write ACL data to the controller. Read more
Source§fn try_write_sync_data(
&self,
packet: &SyncPacket<'_>,
) -> Result<(), TryError<<ExternalController<T, SLOTS> as ErrorType>::Error>>
fn try_write_sync_data( &self, packet: &SyncPacket<'_>, ) -> Result<(), TryError<<ExternalController<T, SLOTS> as ErrorType>::Error>>
Attempt to write Sync data to the controller. Read more
Source§impl<T, C, const SLOTS: usize> ControllerCmdAsync<C> for ExternalController<T, SLOTS>
impl<T, C, const SLOTS: usize> ControllerCmdAsync<C> for ExternalController<T, SLOTS>
Source§impl<T, C, const SLOTS: usize> ControllerCmdSync<C> for ExternalController<T, SLOTS>
impl<T, C, const SLOTS: usize> ControllerCmdSync<C> for ExternalController<T, SLOTS>
Auto Trait Implementations§
impl<T, const SLOTS: usize> !Freeze for ExternalController<T, SLOTS>
impl<T, const SLOTS: usize> !RefUnwindSafe for ExternalController<T, SLOTS>
impl<T, const SLOTS: usize> !Send for ExternalController<T, SLOTS>
impl<T, const SLOTS: usize> !Sync for ExternalController<T, SLOTS>
impl<T, const SLOTS: usize> Unpin for ExternalController<T, SLOTS>where
T: Unpin,
impl<T, const SLOTS: usize> UnwindSafe for ExternalController<T, SLOTS>where
T: UnwindSafe,
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