diff --git a/Cargo.toml b/Cargo.toml index dcf1744..7feb943 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,10 +4,13 @@ version = "0.1.0" authors = ["Lars Næsbye Christensen "] edition = "2021" description = "Converts SBF to RINEX" +rust-version = "1.71.0" +categories = ["science::geo", "parsing"] [dependencies] -binread = "2.2.0" + bstr = "1.9" clap = { version = "4.4", features = [] } +nom = "7.1" rinex = "0.15" thiserror = "1.0" \ No newline at end of file diff --git a/README.md b/README.md index 78c5360..24cbaaf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# sbf2rnx-dev +# sbf2rnx A fun little project to see if I can convert SBF (Septentrio) binary files to RINEX using Rust. diff --git a/src/main.rs b/src/main.rs index e8073a1..dc86a24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,7 @@ pub fn main() -> Result<(), Error> { .get_matches(); let filepath: String = matches.get_one::("i").unwrap().to_string(); let rinexrec = sbf2rnxrec(filepath); - //write_rnx_file(rinexrec); + write_rnx_file(rinexrec); Ok(()) } diff --git a/src/sbf.rs b/src/sbf.rs index 2f1d44e..d75e46d 100644 --- a/src/sbf.rs +++ b/src/sbf.rs @@ -342,16 +342,18 @@ fn decode_galalm(galalmdata: u8) -> u8 { } pub(crate) fn process_sbfdata(bytes: Vec) -> Rinex { + let mut rinexstruct = Rinex::default(); + rinexstruct.header.program = env!("CARGO_PKG_NAME").parse().unwrap(); // let's find SBF blocks by using their sync bytes - let pattern: [u8; 2] = [SBF_SYNC1, SBF_SYNC2]; let result: Vec> = bytes.split_str(&pattern).map(|x| x.to_vec()).collect(); - // now we have a collection of SBF blocks + + // now we have a collection of SBF blocks to iterate through for block in result { eprintln!("Read block {:?}", block); // let crc = ((block[1] as u16) << 8) | block[2] as u16; // eprintln!("CRC: {}", crc); } - Rinex::default() // Placeholder to output right type for now + rinexstruct // Placeholder to output right type for now }