forked from ublox-rs/ublox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make usage of serialport and crc optional (ublox-rs#4)
* refactoring: use workspace and override for ublox_derive Use common workspace for two crates, to speedup build, plus it is possible to use override section in workspace's Cargo.toml, so it is possible to publish real crates (not workspace) without any modification in Cargo.toml * refactoring: cargo fmt --all * fix build: disable ublox_derive/tests/test.rs at now there is problem with generated code, it for reason generate trait implementation with wrong method names * refactoring: cleanups deps now we don't build syn different versions (outdated num_derive dependencies) * enable tests that possible to build and remove dead code * make usage of serialport and crc optional * missed dpes
- Loading branch information
Showing
12 changed files
with
217 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
[package] | ||
name = "ublox" | ||
version = "0.1.0" | ||
authors = ["Lane Kolbly <lane@rscheme.org>"] | ||
edition = "2018" | ||
license = "MIT" | ||
description = "A crate to communicate with u-blox GPS devices using the UBX protocol" | ||
[workspace] | ||
members = ["ublox", "ublox_derive"] | ||
|
||
[patch.'crates-io'] | ||
ublox_derive = { path = "ublox_derive" } | ||
ublox = { path = "ublox" } | ||
|
||
[dependencies] | ||
serde = "1.0" | ||
serde_derive = "1.0" | ||
serialport = "3.3.0" | ||
bincode = "1.2.1" | ||
chrono = "0.4" | ||
crc = "1.8.1" | ||
syn = "1.0.14" | ||
ublox_derive = { path = "ublox_derive/" } | ||
num-traits = "0.2" | ||
num-derive = "0.2" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "ublox" | ||
version = "0.1.0" | ||
authors = ["Lane Kolbly <lane@rscheme.org>"] | ||
edition = "2018" | ||
license = "MIT" | ||
description = "A crate to communicate with u-blox GPS devices using the UBX protocol" | ||
|
||
[features] | ||
default = [] | ||
serial = ["serialport", "crc"] | ||
|
||
[dependencies] | ||
serde = "1.0" | ||
serde_derive = "1.0" | ||
bincode = "1.2.1" | ||
chrono = "0.4" | ||
ublox_derive = "0.0.0" | ||
serialport = { version = "3.3.0", optional = true } | ||
crc = { version = "1.8.1", optional = true } | ||
num-derive = "0.3.0" | ||
num-traits = "0.2.11" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#[cfg(feature = "serial")] | ||
mod serial { | ||
use chrono::prelude::*; | ||
use std::time::Duration; | ||
use ublox::{Device, Position}; | ||
|
||
pub fn main() { | ||
let mut dev = Device::new("/dev/ttyUSB0").unwrap(); | ||
|
||
let pos = Position { | ||
lon: -97.5, | ||
lat: 30.2, | ||
alt: 200.0, | ||
}; | ||
println!("Setting AID data..."); | ||
match dev.load_aid_data(Some(pos), Some(Utc::now())) { | ||
Err(e) => { | ||
println!("Got error setting AID data: {:?}", e); | ||
} | ||
_ => {} | ||
} | ||
|
||
loop { | ||
dev.poll_for(Duration::from_millis(500)).unwrap(); | ||
println!("{:?}", dev.get_solution()); | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
#[cfg(feature = "serial")] | ||
serial::main() | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! # ublox | ||
//! | ||
//! `ublox` is a library to talk to u-blox GPS devices using the UBX protocol. | ||
//! At time of writing this library is developed for a device which behaves like | ||
//! a NEO-6M device. | ||
pub use crate::segmenter::Segmenter; | ||
#[cfg(feature = "serial")] | ||
pub use crate::serialport::{Device, ResetType}; | ||
pub use crate::ubx_packets::*; | ||
|
||
mod error; | ||
mod segmenter; | ||
#[cfg(feature = "serial")] | ||
mod serialport; | ||
mod ubx_packets; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.