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