pub trait DeviceInterface {
type InterfaceError;
// Required methods
fn fill(&mut self) -> usize;
fn read(&mut self) -> Result<u8, Self::InterfaceError>;
fn read_many(
&mut self,
buffer: &mut [u8],
) -> Result<usize, Self::InterfaceError>;
}
Expand description
A method of communicating with the device
Required Associated Types§
Sourcetype InterfaceError
type InterfaceError
Interface associated error type
Required Methods§
Sourcefn fill(&mut self) -> usize
fn fill(&mut self) -> usize
Fill up our buffer with unsolicited / periodic UBX messages. This function should be called before attempting to read. Returns the number of available bytes.
Sourcefn read(&mut self) -> Result<u8, Self::InterfaceError>
fn read(&mut self) -> Result<u8, Self::InterfaceError>
Read a single buffered byte.
Call fill
before calling this.