[][src]Struct mech1_gpsreader::DataGPS

pub struct DataGPS { /* fields omitted */ }

Implementations

impl DataGPS[src]

pub fn new(baud: Bauds) -> Self[src]

Initializes a new uart communication using the specified settings (baud rate) and the default ones (Parity, data_bits, stop_bits). After opening the connection, the Struct holding the receivable values is also initialized.

Examples

let mut connection = DataGPS::new(Bauds::Baud9600);
let reading = connection.read_all_data();

assert_ne!("", reading);

pub fn read_all_data(&mut self)[src]

Reads all the data at once from the uart, splits it in single information and puts it in the corresponding Struct fields.

Examples

let mut connection = DataGPS::new(Bauds::Baud9600);
let reading = connection.read_all_data();

assert_ne!("", reading);

pub fn get_altitude(&mut self) -> String[src]

Returns altitude

pub fn get_latitude(&mut self) -> String[src]

Returns latitude

pub fn get_time(&mut self) -> String[src]

Returns time

pub fn get_longitude(&mut self) -> String[src]

Returns longitude

pub fn get_baud_rate(&self) -> u32[src]

Returns baud rate

pub fn get_uart_status(&self) -> Status[src]

Returns uart status

pub fn set_baud_rate(&mut self, baud_rate: &Bauds)[src]

Sets the new baud rate if modified during execution

Auto Trait Implementations

impl !RefUnwindSafe for DataGPS

impl Send for DataGPS

impl Sync for DataGPS

impl Unpin for DataGPS

impl !UnwindSafe for DataGPS

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.