fix: correct CCSDS packet length calculation

Signed-off-by: 0rlych1kk4 <orlychikka@gmail.com>
This commit is contained in:
0rlych1kk4
2026-08-31 14:28:24 +08:00
parent 12824b2906
commit 1649306802
2 changed files with 51 additions and 2 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ impl CcsdsTcPacketOwned {
pub fn len_written(&self) -> usize {
ccsds_packet_len_for_user_data_len_with_checksum(
postcard::experimental::serialized_size(&self.tc_header).unwrap() as usize
+ postcard::experimental::serialized_size(&self.payload).unwrap() as usize,
+ self.payload.len(),
)
.unwrap()
}
@@ -116,7 +116,7 @@ impl CcsdsTmPacketOwned {
pub fn len_written(&self) -> usize {
ccsds_packet_len_for_user_data_len_with_checksum(
postcard::experimental::serialized_size(&self.tm_header).unwrap() as usize
+ postcard::experimental::serialized_size(&self.payload).unwrap() as usize,
+ self.payload.len(),
)
.unwrap()
}