Skip to content

Commit

Permalink
update to latest main
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume W. Bres <[email protected]>
  • Loading branch information
gwbres committed Nov 5, 2024
2 parents 19ede4c + 11bbc4f commit 203d841
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions binex/src/message/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ pub struct Meta {
}

impl Meta {
// Forward stream +LE +standard
const FWD_SYNC_LE_STANDARD_CRC: u8 = 0xc2;
// Forward stream +BE +standard
const FWD_SYNC_BE_STANDARD_CRC: u8 = 0xe2;
// Forward stream +LE +enhanced
const FWD_SYNC_LE_ENHANCED_CRC: u8 = 0xc8;
// Forward stream +BE +enhanced
const FWD_SYNC_BE_ENHANCED_CRC: u8 = 0xe8;

// Reversed stream +LE +standard
const REV_SYNC_LE_STANDARD_CRC: u8 = 0xd2;
// Reversed stream +BE +standard
const REV_SYNC_BE_STANDARD_CRC: u8 = 0xf2;
// Reversed stream +LE +enhanced
const REV_SYNC_LE_ENHANCED_CRC: u8 = 0xd8;
// Reversed stream +BE +enhanced
const REV_SYNC_BE_ENHANCED_CRC: u8 = 0xf8;
}

Expand Down
8 changes: 5 additions & 3 deletions binex/src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub use record::{
};

pub use meta::Meta;
pub use time::TimeResolution;

pub(crate) use mid::MessageID;

use crate::{stream::Provider, ClosedSourceMeta, Error};
Expand Down Expand Up @@ -104,6 +106,7 @@ impl Message {
// 2. parse MID
let (bnxi, mid_1_4) = Self::decode_bnxi(&buf[ptr..], big_endian);
let mid = MessageID::from(bnxi);

if mid == MessageID::Unknown {
return Err(Error::UnknownMessage);
}
Expand Down Expand Up @@ -425,10 +428,9 @@ impl Message {
mod test {
use super::Message;
use crate::message::{
EphemerisFrame, GPSRaw, MonumentGeoMetadata, MonumentGeoRecord, PositionEcef3d, Record,
SolutionsFrame, Velocity3d,
EphemerisFrame, GALEphemeris, GPSEphemeris, GPSRaw, Meta, MonumentGeoMetadata,
MonumentGeoRecord, PositionEcef3d, Record, Solutions, SolutionsFrame, Velocity3d,
};
use crate::message::{GALEphemeris, GPSEphemeris, Meta, Solutions, TemporalSolution};
use crate::prelude::Epoch;
use crate::Error;

Expand Down

0 comments on commit 203d841

Please sign in to comment.