yahboom_gps

Crates.ioyahboom_gps
lib.rsyahboom_gps
version0.1.0
sourcesrc
created_at2024-06-06 15:35:01.017731
updated_at2024-06-06 15:35:01.017731
descriptionA Rust library for initializing and reading GPS data from a Yahboom GPS module via a serial port.
homepagehttps://github.com/YenHarvey/yahboom_gps
repositoryhttps://github.com/YenHarvey/yahboom_gps
max_upload_size
id1263825
size26,210
Summer Lemon (YenHarvey)

documentation

https://docs.rs/yahboom_gps

README

yahboom_gps

githubcrates-iodocs-rs


yahboom_gps is a Rust library for initializing and reading GPS data from a Yahboom GPS module via a serial port.

Installation

Add this to your Cargo.toml:

[dependencies]
yahboom_gps = "0.1.0"

Example

Here is a complete example demonstrating how to use the yahboom_gps library to initialize the GPS module, read GPS messages, and parse GPS data.

use yahboom_gps::{gps_init, read_complete_gps_message, parse_gps_data};
use anyhow::Result;

fn main() -> Result<()> {
    // Initialize the GPS module
    let mut port = gps_init("COM3", 9600)?;

    // Continuously read and parse GPS messages
    while let Ok(Some(message)) = read_complete_gps_message(&mut port) {
        // Parse the GPS data
        let parsed_data = parse_gps_data(&message);

        // Print the parsed GPS data
        println!("Parsed GPS Data: {}", serde_json::to_string_pretty(&parsed_data)?);
        println!("--- End of message ---");
    }

    Ok(())
}

Documentation

For more detailed documentation, please visit docs.rs.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

Contact

If you have any questions or suggestions, please feel free to contact me at [401].

Commit count: 5

cargo fmt