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§
Sourcefn write_acl_data(&self, packet: &AclPacket<'_>) -> Result<(), Self::Error>
fn write_acl_data(&self, packet: &AclPacket<'_>) -> Result<(), Self::Error>
Write ACL data to the controller. Blocks until done.
Sourcefn write_sync_data(&self, packet: &SyncPacket<'_>) -> Result<(), Self::Error>
fn write_sync_data(&self, packet: &SyncPacket<'_>) -> Result<(), Self::Error>
Write Sync data to the controller. Blocks until done.
Sourcefn write_iso_data(&self, packet: &IsoPacket<'_>) -> Result<(), Self::Error>
fn write_iso_data(&self, packet: &IsoPacket<'_>) -> Result<(), Self::Error>
Write Iso data to the controller. Blocks until done.
Sourcefn try_write_acl_data(
&self,
packet: &AclPacket<'_>,
) -> Result<(), TryError<Self::Error>>
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.
Sourcefn try_write_sync_data(
&self,
packet: &SyncPacket<'_>,
) -> Result<(), TryError<Self::Error>>
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.
Sourcefn try_write_iso_data(
&self,
packet: &IsoPacket<'_>,
) -> Result<(), TryError<Self::Error>>
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.