Compare commits

..

1 Commits

Author SHA1 Message Date
ce9ca14b8f
Update ECSS code
Some checks failed
Rust/spacepackets/pipeline/pr-main There was a failure building this commit
Rust/spacepackets/pipeline/head There was a failure building this commit
2024-03-29 14:03:09 +01:00
2 changed files with 10 additions and 11 deletions

View File

@ -237,7 +237,7 @@ impl<'raw_data> PusTcCreator<'raw_data> {
/// and subservice type
/// * `app_data` - Custom application data
/// * `set_ccsds_len` - Can be used to automatically update the CCSDS space packet data length
/// field. If this is not set to true, [PusTc::update_ccsds_data_len] can be called to set
/// field. If this is not set to true, [Self::update_ccsds_data_len] can be called to set
/// the correct value to this field manually
pub fn new(
sp_header: &mut SpHeader,
@ -258,7 +258,7 @@ impl<'raw_data> PusTcCreator<'raw_data> {
pus_tc
}
/// Simplified version of the [PusTcCreator::new] function which allows to only specify service
/// Simplified version of the [Self::new] function which allows to only specify service
/// and subservice instead of the full PUS TC secondary header.
pub fn new_simple(
sph: &mut SpHeader,
@ -302,7 +302,7 @@ impl<'raw_data> PusTcCreator<'raw_data> {
sp_header_impls!();
/// Calculate the CCSDS space packet data length field and sets it
/// This is called automatically if the `set_ccsds_len` argument in the [PusTc::new] call was
/// This is called automatically if the `set_ccsds_len` argument in the [Self::new] call was
/// used.
/// If this was not done or the application data is set or changed after construction,
/// this function needs to be called to ensure that the data length field of the CCSDS header
@ -312,8 +312,7 @@ impl<'raw_data> PusTcCreator<'raw_data> {
self.len_written() as u16 - size_of::<crate::zc::SpHeader>() as u16 - 1;
}
/// This function should be called before the TC packet is serialized if
/// [PusTc::calc_crc_on_serialization] is set to False. It will calculate and cache the CRC16.
/// This function calculates and returns the CRC16 for the current packet.
pub fn calc_own_crc16(&self) -> u16 {
let mut digest = CRC_CCITT_FALSE.digest();
let sph_zc = crate::zc::SpHeader::from(self.sp_header);

View File

@ -215,8 +215,8 @@ pub struct PusTmCreator<'time, 'raw_data> {
#[cfg_attr(feature="serde", serde(borrow))]
pub sec_header: PusTmSecondaryHeader<'time>,
source_data: &'raw_data [u8],
/// If this is set to false, a manual call to [PusTm::calc_own_crc16] or
/// [PusTm::update_packet_fields] is necessary for the serialized or cached CRC16 to be valid.
/// If this is set to false, a manual call to [Self::calc_own_crc16] or
/// [Self::update_packet_fields] is necessary for the serialized or cached CRC16 to be valid.
pub calc_crc_on_serialization: bool,
}
@ -231,7 +231,7 @@ impl<'time, 'raw_data> PusTmCreator<'time, 'raw_data> {
/// and subservice type
/// * `source_data` - Custom application data
/// * `set_ccsds_len` - Can be used to automatically update the CCSDS space packet data length
/// field. If this is not set to true, [PusTm::update_ccsds_data_len] can be called to set
/// field. If this is not set to true, [Self::update_ccsds_data_len] can be called to set
/// the correct value to this field manually
pub fn new(
sp_header: &mut SpHeader,
@ -303,7 +303,7 @@ impl<'time, 'raw_data> PusTmCreator<'time, 'raw_data> {
sp_header_impls!();
/// This is called automatically if the `set_ccsds_len` argument in the [PusTm::new] call was
/// This is called automatically if the `set_ccsds_len` argument in the [Self::new] call was
/// used.
/// If this was not done or the time stamp or source data is set or changed after construction,
/// this function needs to be called to ensure that the data length field of the CCSDS header
@ -314,7 +314,7 @@ impl<'time, 'raw_data> PusTmCreator<'time, 'raw_data> {
}
/// This function should be called before the TM packet is serialized if
/// [PusTm.calc_crc_on_serialization] is set to False. It will calculate and cache the CRC16.
/// [Self::calc_crc_on_serialization] is set to False. It will calculate and cache the CRC16.
pub fn calc_own_crc16(&self) -> u16 {
let mut digest = CRC_CCITT_FALSE.digest();
let sph_zc = crate::zc::SpHeader::from(self.sp_header);
@ -326,7 +326,7 @@ impl<'time, 'raw_data> PusTmCreator<'time, 'raw_data> {
digest.finalize()
}
/// This helper function calls both [PusTm.update_ccsds_data_len] and [PusTm.calc_own_crc16]
/// This helper function calls both [Self::update_ccsds_data_len] and [Self::calc_own_crc16]
pub fn update_packet_fields(&mut self) {
self.update_ccsds_data_len();
}