another small update

This commit is contained in:
2024-04-15 14:13:10 +02:00
parent df72676c0d
commit 8313a0b26c
9 changed files with 22 additions and 20 deletions

View File

@ -1,8 +1,8 @@
use std::sync::mpsc::{self, TryRecvError};
use satrs::pus::{MpscTmAsVecSender, PacketAsVec};
use satrs::{pus::MpscTmAsVecSender, tmtc::PacketAsVec};
use crate::pus::PusTcDistributor;
use crate::pus::{HandlingStatus, PusTcDistributor};
// TC source components where the heap is the backing memory of the received telecommands.
pub struct TcSourceTaskDynamic {
@ -25,7 +25,7 @@ impl TcSourceTaskDynamic {
self.poll_tc();
}
pub fn poll_tc(&mut self) -> bool {
pub fn poll_tc(&mut self) -> HandlingStatus {
// Right now, we only expect PUS packets. If any other protocols like CFDP are added at
// a later stage, we probably need to check for the APID before routing the packet.
match self.tc_receiver.try_recv() {
@ -33,13 +33,13 @@ impl TcSourceTaskDynamic {
self.pus_distrib
.handle_tc_packet(packet_with_sender.sender_id, packet_with_sender.packet)
.ok();
true
HandlingStatus::HandledOne
}
Err(e) => match e {
TryRecvError::Empty => false,
TryRecvError::Empty => HandlingStatus::Empty,
TryRecvError::Disconnected => {
log::warn!("tmtc thread: sender disconnected");
false
HandlingStatus::Empty
}
},
}

View File

@ -4,7 +4,7 @@ use std::{collections::HashMap, sync::mpsc, time::Duration};
use log::info;
use ops_sat_rs::config::tasks::STOP_CHECK_FREQUENCY;
use satrs::pus::PacketAsVec;
use satrs::tmtc::PacketAsVec;
use satrs::{
seq_count::{CcsdsSimpleSeqCountProvider, SequenceCountProviderCore},
spacepackets::{