Trait Controller

Source
pub trait Controller: ErrorType {
    // Required methods
    fn write_acl_data(&self, packet: &AclPacket<'_>) -> Result<(), Self::Error>;
    fn write_sync_data(
        &self,
        packet: &SyncPacket<'_>,
    ) -> Result<(), Self::Error>;
    fn write_iso_data(&self, packet: &IsoPacket<'_>) -> Result<(), Self::Error>;
    fn try_write_acl_data(
        &self,
        packet: &AclPacket<'_>,
    ) -> Result<(), TryError<Self::Error>>;
    fn try_write_sync_data(
        &self,
        packet: &SyncPacket<'_>,
    ) -> Result<(), TryError<Self::Error>>;
    fn try_write_iso_data(
        &self,
        packet: &IsoPacket<'_>,
    ) -> Result<(), TryError<Self::Error>>;
    fn read<'a>(
        &self,
        buf: &'a mut [u8],
    ) -> Result<ControllerToHostPacket<'a>, Self::Error>;
    fn try_read<'a>(
        &self,
        buf: &'a mut [u8],
    ) -> Result<ControllerToHostPacket<'a>, TryError<Self::Error>>;
}
Expand description

Trait representing a HCI controller which supports blocking and non-blocking operations.

Required Methods§

Source

fn write_acl_data(&self, packet: &AclPacket<'_>) -> Result<(), Self::Error>

Write ACL data to the controller. Blocks until done.

Source

fn write_sync_data(&self, packet: &SyncPacket<'_>) -> Result<(), Self::Error>

Write Sync data to the controller. Blocks until done.

Source

fn write_iso_data(&self, packet: &IsoPacket<'_>) -> Result<(), Self::Error>

Write Iso data to the controller. Blocks until done.

Source

fn try_write_acl_data( &self, packet: &AclPacket<'_>, ) -> Result<(), TryError<Self::Error>>

Attempt to write ACL data to the controller.

Returns a TryError if the operation would block.

Source

fn try_write_sync_data( &self, packet: &SyncPacket<'_>, ) -> Result<(), TryError<Self::Error>>

Attempt to write Sync data to the controller.

Returns a TryError if the operation would block.

Source

fn try_write_iso_data( &self, packet: &IsoPacket<'_>, ) -> Result<(), TryError<Self::Error>>

Attempt to write Iso data to the controller.

Returns a TryError if the operation would block.

Source

fn read<'a>( &self, buf: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, Self::Error>

Read a valid HCI packet from the controller. Blocks until done.

Source

fn try_read<'a>( &self, buf: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, TryError<Self::Error>>

Read a valid HCI packet from the controller.

Returns a TryError if the operation would block.

Implementors§

Source§

impl<T, const SLOTS: usize> Controller for ExternalController<T, SLOTS>
where T: Transport,