[][src]Struct Data_GPS::DataGPS

pub struct DataGPS { /* fields omitted */ }

Implementations

impl DataGPS[src]

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

Create a new DataGPS.

Examples

let baud = Bauds::Baud9600;
let data_gps = DataGPS::new(baud);
assert_eq!(baud.get_value(),data_gps.get_baud_rate());

pub fn read_all_data(&mut self)[src]

Read all data. It gets time, latitude, longitude and altitude.

pub fn print_all_value(&mut self)[src]

Print time, latitude, longitude and altitude.

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

Return Altitude value. If it is not set yet, it returns "No value".

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

Return Latitude value. If it is not set yet, it returns "No value".

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

Return Time value. If it is not set yet, it returns "No value".

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

Return Longitude value. If it is not set yet, it returns "No value".

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

Return BaudRate value. It refers to the BaudRate of our DataGPS's UART.

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

Return UART Statis value. It refers to the Status of our DataGPS's UART.

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

Set a baud rate on already existing DataGPS.

Examples

let data_gps = DataGPS::new(Bauds::Baud57600);
let new_baud = Bauds::Baud9600;
data_gps.set_baud_rate(&new_baud);
assert_eq!(new_baud.get_value(),data_gps.get_baud_rate());

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.