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

@ -8,10 +8,9 @@ use log::{info, warn};
use ops_sat_rs::config::tasks::STOP_CHECK_FREQUENCY;
use satrs::{
hal::std::tcp_server::{HandledConnectionHandler, ServerConfig, TcpSpacepacketsServer},
pus::PacketAsVec,
queue::GenericSendError,
spacepackets::PacketId,
tmtc::PacketSource,
tmtc::{PacketAsVec, PacketSource},
};
#[derive(Default, Clone)]

View File

@ -8,8 +8,8 @@ use mio::{Events, Interest, Poll, Token};
use ops_sat_rs::config::tasks::STOP_CHECK_FREQUENCY;
use ops_sat_rs::config::{EXPERIMENT_PACKET_ID, TCP_SPP_SERVER_PORT};
use satrs::encoding::ccsds::parse_buffer_for_ccsds_space_packets;
use satrs::pus::PacketAsVec;
use satrs::queue::GenericSendError;
use satrs::tmtc::PacketAsVec;
use satrs::ComponentId;
use thiserror::Error;

View File

@ -3,8 +3,8 @@ use std::sync::mpsc;
use log::{info, warn};
use satrs::hal::std::udp_server::{ReceiveResult, UdpTcServer};
use satrs::pus::PacketAsVec;
use satrs::queue::GenericSendError;
use satrs::tmtc::PacketAsVec;
use crate::pus::HandlingStatus;

View File

@ -12,12 +12,13 @@ use satrs::pus::verification::{
};
use satrs::pus::{
ActiveRequestProvider, EcssTcAndToken, EcssTcInVecConverter, EcssTmSender, EcssTmtcError,
GenericConversionError, PacketAsVec, PusPacketHandlerResult, PusReplyHandler, PusServiceHelper,
GenericConversionError, PusPacketHandlerResult, PusReplyHandler, PusServiceHelper,
PusTcToRequestConverter,
};
use satrs::request::{GenericMessage, UniqueApidTargetId};
use satrs::spacepackets::ecss::tc::PusTcReader;
use satrs::spacepackets::ecss::{EcssEnumU16, PusPacket};
use satrs::tmtc::PacketAsVec;
use std::sync::mpsc;
use std::time::Duration;

View File

@ -468,8 +468,9 @@ pub(crate) mod tests {
use std::time::Duration;
use satrs::pus::test_util::TEST_COMPONENT_ID_0;
use satrs::pus::{MpscTmAsVecSender, PacketAsVec, PusTmVariant};
use satrs::pus::{MpscTmAsVecSender, PusTmVariant};
use satrs::request::RequestId;
use satrs::tmtc::PacketAsVec;
use satrs::{
pus::{
verification::test_util::TestVerificationReporter, ActivePusRequestStd,

View File

@ -7,12 +7,13 @@ use satrs::pus::test::PusService17TestHandler;
use satrs::pus::verification::{FailParams, VerificationReporter, VerificationReportingProvider};
use satrs::pus::{
EcssTcAndToken, EcssTcInMemConverter, EcssTcInVecConverter, MpscTcReceiver, MpscTmAsVecSender,
PacketAsVec, PusPacketHandlerResult, PusServiceHelper,
PusPacketHandlerResult, PusServiceHelper,
};
use satrs::spacepackets::ecss::tc::PusTcReader;
use satrs::spacepackets::ecss::PusPacket;
use satrs::spacepackets::time::cds::CdsTime;
use satrs::spacepackets::time::TimeWriter;
use satrs::tmtc::PacketAsVec;
use std::sync::mpsc;
use super::HandlingStatus;

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::{