add packet_len direct method for SpHeader #152
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Added
|
||||
|
||||
- `SpHeader::packet_len` direct method.
|
||||
- `AckFlags` which is implemented with `bitbybit::bitfield`
|
||||
- `ApidOutOfRangeError` and `SequenceCountOutOfRangeError`
|
||||
- Added PUS A legacy support for telecommands inside the `ecss.tc_pus_a` module
|
||||
|
||||
@@ -302,6 +302,7 @@ pub trait CcsdsPacket {
|
||||
|
||||
/// Retrieve data length field
|
||||
fn data_len(&self) -> u16;
|
||||
|
||||
/// Retrieve the total packet size based on the data length field
|
||||
#[inline]
|
||||
fn packet_len(&self) -> usize {
|
||||
@@ -504,6 +505,12 @@ impl SpHeader {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retrieve the total packet size based on the data length field
|
||||
#[inline]
|
||||
fn packet_len(&self) -> usize {
|
||||
usize::from(self.data_len()) + CCSDS_HEADER_LEN + 1
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_seq_count(&mut self, seq_count: u14) {
|
||||
self.psc.seq_count = seq_count;
|
||||
|
||||
Reference in New Issue
Block a user