clippy and test fix #213
@ -131,3 +131,8 @@ test_util = []
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
rustdoc-args = ["--generate-link-to-definition"]
|
rustdoc-args = ["--generate-link-to-definition"]
|
||||||
|
|
||||||
|
[[test]]
|
||||||
|
name = "event_test"
|
||||||
|
path = "tests/pus_events.rs"
|
||||||
|
required-features = ["test_util"]
|
||||||
|
@ -17,37 +17,37 @@ impl PusTmWithCdsShortHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub fn create_pus_tm_timestamp_now<'a>(
|
pub fn create_pus_tm_timestamp_now<'data>(
|
||||||
&'a mut self,
|
&mut self,
|
||||||
service: u8,
|
service: u8,
|
||||||
subservice: u8,
|
subservice: u8,
|
||||||
source_data: &'a [u8],
|
source_data: &'data [u8],
|
||||||
seq_count: u16,
|
seq_count: u16,
|
||||||
) -> PusTmCreator {
|
) -> PusTmCreator<'_, 'data> {
|
||||||
let time_stamp = CdsTime::now_with_u16_days().unwrap();
|
let time_stamp = CdsTime::now_with_u16_days().unwrap();
|
||||||
time_stamp.write_to_bytes(&mut self.cds_short_buf).unwrap();
|
time_stamp.write_to_bytes(&mut self.cds_short_buf).unwrap();
|
||||||
self.create_pus_tm_common(service, subservice, source_data, seq_count)
|
self.create_pus_tm_common(service, subservice, source_data, seq_count)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_pus_tm_with_stamper<'a>(
|
pub fn create_pus_tm_with_stamper<'data>(
|
||||||
&'a mut self,
|
&mut self,
|
||||||
service: u8,
|
service: u8,
|
||||||
subservice: u8,
|
subservice: u8,
|
||||||
source_data: &'a [u8],
|
source_data: &'data [u8],
|
||||||
stamper: &CdsTime,
|
stamper: &CdsTime,
|
||||||
seq_count: u16,
|
seq_count: u16,
|
||||||
) -> PusTmCreator {
|
) -> PusTmCreator<'_, 'data> {
|
||||||
stamper.write_to_bytes(&mut self.cds_short_buf).unwrap();
|
stamper.write_to_bytes(&mut self.cds_short_buf).unwrap();
|
||||||
self.create_pus_tm_common(service, subservice, source_data, seq_count)
|
self.create_pus_tm_common(service, subservice, source_data, seq_count)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_pus_tm_common<'a>(
|
fn create_pus_tm_common<'data>(
|
||||||
&'a self,
|
&self,
|
||||||
service: u8,
|
service: u8,
|
||||||
subservice: u8,
|
subservice: u8,
|
||||||
source_data: &'a [u8],
|
source_data: &'data [u8],
|
||||||
seq_count: u16,
|
seq_count: u16,
|
||||||
) -> PusTmCreator {
|
) -> PusTmCreator<'_, 'data> {
|
||||||
let reply_header = SpHeader::new_for_unseg_tm(self.apid, seq_count, 0);
|
let reply_header = SpHeader::new_for_unseg_tm(self.apid, seq_count, 0);
|
||||||
let tc_header = PusTmSecondaryHeader::new_simple(service, subservice, &self.cds_short_buf);
|
let tc_header = PusTmSecondaryHeader::new_simple(service, subservice, &self.cds_short_buf);
|
||||||
PusTmCreator::new(reply_header, tc_header, source_data, true)
|
PusTmCreator::new(reply_header, tc_header, source_data, true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user