USLP reader getter functions #203

Merged
muellerr merged 1 commits from additional-uslp-getter-functions into main 2025-12-10 11:41:27 +01:00
2 changed files with 26 additions and 1 deletions

View File

@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added `SequenceCounterOnFile` which persists the sequence counter by writing it to a file.
- Added `SequenceCounter::set` method which allows manually setting an initial value.
- Added `CcsdsPacketReader::raw_data` full data getter.
- `UslpFrameCreator` constructor
- Additional reader methods on `UslpFrameReader`
## Removed

View File

@@ -99,7 +99,7 @@ pub struct PrimaryHeader {
pub source_or_dest_field: SourceOrDestField,
/// Virtual channel ID.
pub vc_id: u6,
/// MAP ID.
/// Multiplexer Access Point (MAP) ID.
pub map_id: u4,
frame_len_field: u16,
/// Bypass sequence control flag.
@@ -642,6 +642,29 @@ impl<'buf> TransferFrameReader<'buf> {
self.primary_header.len_frame()
}
/// Virtual channel ID.
#[inline]
pub fn vc_id(&self) -> u6 {
self.primary_header.vc_id
}
/// Multiplexer Access Point (MAP) ID.
#[inline]
pub fn map_id(&self) -> u4 {
self.primary_header.map_id
}
/// Spacecraft ID.
#[inline]
pub fn spacecraft_id(&self) -> u16 {
self.primary_header.spacecraft_id
}
/// Source or destination field.
#[inline]
pub fn source_or_dest_field(&self) -> SourceOrDestField {
self.primary_header.source_or_dest_field
}
/// Primary header.
#[inline]
pub fn primary_header(&self) -> &PrimaryHeader {