add packet_len direct method for SpHeader
This commit is contained in:
@@ -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