Skip to content

Commit 5db91e6

Browse files
committed
Merge pull request 'USLP reader getter functions' (#203) from additional-uslp-getter-functions into main
Reviewed-on: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/203
2 parents 66201a6 + 369b03f commit 5db91e6

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2525
- Added `SequenceCounterOnFile` which persists the sequence counter by writing it to a file.
2626
- Added `SequenceCounter::set` method which allows manually setting an initial value.
2727
- Added `CcsdsPacketReader::raw_data` full data getter.
28+
- `UslpFrameCreator` constructor
29+
- Additional reader methods on `UslpFrameReader`
2830

2931
## Removed
3032

src/uslp/mod.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub struct PrimaryHeader {
9999
pub source_or_dest_field: SourceOrDestField,
100100
/// Virtual channel ID.
101101
pub vc_id: u6,
102-
/// MAP ID.
102+
/// Multiplexer Access Point (MAP) ID.
103103
pub map_id: u4,
104104
frame_len_field: u16,
105105
/// Bypass sequence control flag.
@@ -642,6 +642,29 @@ impl<'buf> TransferFrameReader<'buf> {
642642
self.primary_header.len_frame()
643643
}
644644

645+
/// Virtual channel ID.
646+
#[inline]
647+
pub fn vc_id(&self) -> u6 {
648+
self.primary_header.vc_id
649+
}
650+
/// Multiplexer Access Point (MAP) ID.
651+
#[inline]
652+
pub fn map_id(&self) -> u4 {
653+
self.primary_header.map_id
654+
}
655+
656+
/// Spacecraft ID.
657+
#[inline]
658+
pub fn spacecraft_id(&self) -> u16 {
659+
self.primary_header.spacecraft_id
660+
}
661+
662+
/// Source or destination field.
663+
#[inline]
664+
pub fn source_or_dest_field(&self) -> SourceOrDestField {
665+
self.primary_header.source_or_dest_field
666+
}
667+
645668
/// Primary header.
646669
#[inline]
647670
pub fn primary_header(&self) -> &PrimaryHeader {

0 commit comments

Comments
 (0)