Larger update #49
@ -79,7 +79,7 @@ impl PusServiceHandler for PusService5EventHandler {
|
||||
.verification_handler
|
||||
.borrow_mut()
|
||||
.start_success(token, Some(&stamp))
|
||||
.map_err(|_| PartialPusHandlingError::VerificationError);
|
||||
.map_err(|_| PartialPusHandlingError::Verification);
|
||||
let partial_error = start_token.clone().err();
|
||||
let mut token: TcStateToken = token.into();
|
||||
if let Ok(start_token) = start_token {
|
||||
|
@ -316,11 +316,11 @@ pub mod std_mod {
|
||||
#[derive(Debug, Clone, Error)]
|
||||
pub enum PartialPusHandlingError {
|
||||
#[error("Generic timestamp generation error")]
|
||||
TimeError(StdTimestampError),
|
||||
Time(StdTimestampError),
|
||||
#[error("Error sending telemetry: {0}")]
|
||||
TmSendError(String),
|
||||
TmSend(String),
|
||||
#[error("Error sending verification message")]
|
||||
VerificationError,
|
||||
Verification,
|
||||
}
|
||||
|
||||
/// Generic result type for handlers which can process PUS packets.
|
||||
@ -386,7 +386,7 @@ pub mod std_mod {
|
||||
) -> [u8; 7] {
|
||||
let mut time_stamp: [u8; 7] = [0; 7];
|
||||
let time_provider =
|
||||
TimeProvider::from_now_with_u16_days().map_err(PartialPusHandlingError::TimeError);
|
||||
TimeProvider::from_now_with_u16_days().map_err(PartialPusHandlingError::Time);
|
||||
if let Ok(time_provider) = time_provider {
|
||||
time_provider.write_to_bytes(&mut time_stamp).unwrap();
|
||||
} else {
|
||||
|
@ -66,7 +66,7 @@ impl PusServiceHandler for PusService17TestHandler {
|
||||
.verification_handler
|
||||
.get_mut()
|
||||
.start_success(token, Some(&time_stamp))
|
||||
.map_err(|_| PartialPusHandlingError::VerificationError);
|
||||
.map_err(|_| PartialPusHandlingError::Verification);
|
||||
let start_token = if let Ok(result) = result {
|
||||
Some(result)
|
||||
} else {
|
||||
@ -82,7 +82,7 @@ impl PusServiceHandler for PusService17TestHandler {
|
||||
.psb
|
||||
.tm_tx
|
||||
.send(addr)
|
||||
.map_err(|e| PartialPusHandlingError::TmSendError(format!("{e}")))
|
||||
.map_err(|e| PartialPusHandlingError::TmSend(format!("{e}")))
|
||||
{
|
||||
partial_error = Some(e);
|
||||
}
|
||||
@ -94,7 +94,7 @@ impl PusServiceHandler for PusService17TestHandler {
|
||||
.completion_success(start_token, Some(&time_stamp))
|
||||
.is_err()
|
||||
{
|
||||
partial_error = Some(PartialPusHandlingError::VerificationError)
|
||||
partial_error = Some(PartialPusHandlingError::Verification)
|
||||
}
|
||||
}
|
||||
if let Some(partial_error) = partial_error {
|
||||
|
@ -204,9 +204,7 @@ fn poll_tc_server(udp_tmtc_server: &mut UdpTmtcServer) -> bool {
|
||||
|
||||
fn core_tm_handling(udp_tmtc_server: &mut UdpTmtcServer, recv_addr: &SocketAddr) {
|
||||
while let Ok(addr) = udp_tmtc_server.tm_rx.try_recv() {
|
||||
let store_lock = udp_tmtc_server
|
||||
.tm_store
|
||||
.write();
|
||||
let store_lock = udp_tmtc_server.tm_store.write();
|
||||
if store_lock.is_err() {
|
||||
warn!("Locking TM store failed");
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user