[][src]Trait ublox_core::DeviceInterface

pub trait DeviceInterface {
    type InterfaceError;
    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>; }

A method of communicating with the device

Associated Types

type InterfaceError

Interface associated error type

Loading content...

Required methods

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.

fn read(&mut self) -> Result<u8, Self::InterfaceError>

Read a single buffered byte. Call fill before calling this.

fn read_many(
    &mut self,
    buffer: &mut [u8]
) -> Result<usize, Self::InterfaceError>

Read multiple buffered bytes. Call fill before calling this.

Loading content...

Implementors

impl<SER, CommE> DeviceInterface for SerialInterface<SER> where
    SER: Read<u8, Error = CommE>, 
[src]

type InterfaceError = Error<CommE>

Loading content...