Skip to content

Commit

Permalink
this works, need to think about where this is the best solution
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Mar 13, 2024
1 parent 6f5254b commit de1dc16
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 82 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

# [unreleased]

## Fixed

- CUC timestamp was fixed to include leap second corrections because it is based on the TAI
time reference. Changed the `TimeReader` trait to allow specifying leap seconds which might
be necessary for some timestamps to enable other API.

## Added

- `From<$EcssEnum$TY> from $TY` for the ECSS enum type definitions.
Expand Down
4 changes: 2 additions & 2 deletions src/time/cds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,13 +1171,13 @@ impl<ProvidesDaysLen: ProvidesDaysLength> CcsdsTimeProvider for TimeProvider<Pro
}

impl TimeReader for TimeProvider<DaysLen16Bits> {
fn from_bytes(buf: &[u8]) -> Result<Self, TimestampError> {
fn from_bytes_generic(buf: &[u8], _leap_seconds: Option<u32>) -> Result<Self, TimestampError> {
Self::from_bytes_with_u16_days(buf)
}
}

impl TimeReader for TimeProvider<DaysLen24Bits> {
fn from_bytes(buf: &[u8]) -> Result<Self, TimestampError> {
fn from_bytes_generic(buf: &[u8], _leap_seconds: Option<u32>) -> Result<Self, TimestampError> {
Self::from_bytes_with_u24_days(buf)
}
}
Expand Down
Loading

0 comments on commit de1dc16

Please sign in to comment.