[−][src]Struct mech1_gpsreader::DataGPS
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,