Trait stm32wb_hci::host::uart::UartHci
source · pub trait UartHci: HostHci {
// Required method
async fn read(
&mut self
) -> Result<Packet<Stm32Wb5xEvent>, Error<Stm32Wb5xError>>;
}Expand description
Trait for reading packets from the controller.
Implementors must also implement crate::host::HostHci, which provides all of the functions to
write commands to the controller. This trait adds the ability to read packets back from the
controller.
Must be specialized for communication errors (E), vendor-specific events (Vendor), and
vendor-specific errors (VE).
Required Methods§
sourceasync fn read(
&mut self
) -> Result<Packet<Stm32Wb5xEvent>, Error<Stm32Wb5xError>>
async fn read( &mut self ) -> Result<Packet<Stm32Wb5xEvent>, Error<Stm32Wb5xError>>
Reads and returns a packet from the controller. Consumes exactly enough bytes to read the next packet including its header.
Errors
- Returns
Error::BadPacketTypeif the next byte is not a valid packet type. - Returns
Error::BLEif there is an error deserializing the packet (such as a mismatch between the packet length and the expected length of the event). Seecrate::event::Errorfor possible values ofe. - Returns [
Error::Comm] if there is an error reading from the controller.