use crate::controller::ErrorType;
use crate::{data, ControllerToHostPacket};
pub trait Controller: ErrorType {
type Buffer<'a>;
fn alloc_buf(&self) -> Result<Self::Buffer<'_>, Self::Error>;
fn write_acl_data(&self, packet: &data::AclPacket) -> Result<(), Self::Error>;
fn write_sync_data(&self, packet: &data::SyncPacket) -> Result<(), Self::Error>;
fn write_iso_data(&self, packet: &data::IsoPacket) -> Result<(), Self::Error>;
fn try_write_acl_data(&self, packet: &data::AclPacket) -> Result<(), TryError<Self::Error>>;
fn try_write_sync_data(&self, packet: &data::SyncPacket) -> Result<(), TryError<Self::Error>>;
fn try_write_iso_data(&self, packet: &data::IsoPacket) -> Result<(), TryError<Self::Error>>;
fn read<'a>(&self, buf: &'a mut Self::Buffer<'_>) -> Result<ControllerToHostPacket<'a>, Self::Error>;
fn try_read<'a>(&self, buf: &'a mut Self::Buffer<'_>) -> Result<ControllerToHostPacket<'a>, TryError<Self::Error>>;
}
pub use bt_hci_transport::blocking::TryError;