this is useable

This commit is contained in:
Robin Müller 2023-09-11 19:23:48 +02:00
parent 33d503aef9
commit 6fe4c71cee
Signed by: muellerr
GPG Key ID: FCE0B2BD2195142F
9 changed files with 47 additions and 11 deletions

View File

@ -134,7 +134,7 @@ using gpio::Levels;
ResetArgs RESET_ARGS_GNSS; ResetArgs RESET_ARGS_GNSS;
std::atomic_bool LINK_STATE = CcsdsIpCoreHandler::LINK_DOWN; std::atomic_bool LINK_STATE = CcsdsIpCoreHandler::LINK_DOWN;
std::atomic_bool PTME_LOCKED = false; std::atomic_bool PTME_LOCKED = false;
std::atomic_uint16_t I2C_FATAL_ERRORS = 0; std::atomic_uint16_t signals::I2C_FATAL_ERRORS = 0;
uint8_t core::FW_VERSION_MAJOR = 0; uint8_t core::FW_VERSION_MAJOR = 0;
uint8_t core::FW_VERSION_MINOR = 0; uint8_t core::FW_VERSION_MINOR = 0;
uint8_t core::FW_VERSION_REVISION = 0; uint8_t core::FW_VERSION_REVISION = 0;
@ -953,7 +953,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher, bool enable
auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY); auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY);
imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
new ImtqPollingTask(objects::IMTQ_POLLING, I2C_FATAL_ERRORS); new ImtqPollingTask(objects::IMTQ_POLLING, signals::I2C_FATAL_ERRORS);
I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, imtq::MAX_REPLY_SIZE, i2cDev); I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, imtq::MAX_REPLY_SIZE, i2cDev);
auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::IMTQ_POLLING, imtqI2cCookie, auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::IMTQ_POLLING, imtqI2cCookie,
power::Switches::PDU1_CH3_MGT_5V, enableHkSets); power::Switches::PDU1_CH3_MGT_5V, enableHkSets);

View File

@ -9,8 +9,13 @@
#include <atomic> #include <atomic>
#include <cstring> #include <cstring>
namespace signals {
extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL;
extern std::atomic_uint16_t I2C_FATAL_ERRORS; extern std::atomic_uint16_t I2C_FATAL_ERRORS;
} // namespace signals
namespace satsystem { namespace satsystem {
enum Mode : Mode_t { enum Mode : Mode_t {

View File

@ -10,6 +10,7 @@
#include "eive/objects.h" #include "eive/objects.h"
#include "mission/com/defs.h" #include "mission/com/defs.h"
#include "mission/sysDefs.h"
#include "mission/system/acs/acsModeTree.h" #include "mission/system/acs/acsModeTree.h"
#include "mission/system/tcs/tcsModeTree.h" #include "mission/system/tcs/tcsModeTree.h"
#include "mission/system/tree/payloadModeTree.h" #include "mission/system/tree/payloadModeTree.h"
@ -51,7 +52,8 @@ void satsystem::init(bool commandPlPcdu1) {
EIVE_SYSTEM.setInitialMode(satsystem::Mode::BOOT, 0); EIVE_SYSTEM.setInitialMode(satsystem::Mode::BOOT, 0);
} }
EiveSystem satsystem::EIVE_SYSTEM = EiveSystem(objects::EIVE_SYSTEM, 12, 24, I2C_FATAL_ERRORS); EiveSystem satsystem::EIVE_SYSTEM =
EiveSystem(objects::EIVE_SYSTEM, 12, 24, signals::I2C_FATAL_ERRORS);
auto EIVE_SEQUENCE_BOOT = std::make_pair(satsystem::Mode::BOOT, FixedArrayList<ModeListEntry, 5>()); auto EIVE_SEQUENCE_BOOT = std::make_pair(satsystem::Mode::BOOT, FixedArrayList<ModeListEntry, 5>());
auto EIVE_TABLE_BOOT_TGT = auto EIVE_TABLE_BOOT_TGT =

View File

@ -3,6 +3,7 @@
#include "fsfw/ipc/QueueFactory.h" #include "fsfw/ipc/QueueFactory.h"
#include "fsfw/tmtcpacket/ccsds/SpacePacketCreator.h" #include "fsfw/tmtcpacket/ccsds/SpacePacketCreator.h"
#include "fsfw/tmtcservices/TmTcMessage.h" #include "fsfw/tmtcservices/TmTcMessage.h"
#include "mission/sysDefs.h"
CfdpTmFunnel::CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, CfdpTmFunnel::CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg,
std::optional<MessageQueueId_t> fileStoreDest, std::optional<MessageQueueId_t> fileStoreDest,
@ -109,3 +110,8 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) {
} }
return demultiplexLivePackets(origStoreId, newPacketData, packetLen); return demultiplexLivePackets(origStoreId, newPacketData, packetLen);
} }
void CfdpTmFunnel::addLiveDestination(const char* name,
const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid) {
uint32_t listIndex = TmFunnelBase::addLiveDestination(name, downlinkDestination, vcid);
}

View File

@ -16,6 +16,8 @@ class CfdpTmFunnel : public TmFunnelBase {
CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional<MessageQueueId_t> fileStoreDest, CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional<MessageQueueId_t> fileStoreDest,
StorageManagerIF& ramToFileStore, uint16_t cfdpInCcsdsApid); StorageManagerIF& ramToFileStore, uint16_t cfdpInCcsdsApid);
[[nodiscard]] const char* getName() const override; [[nodiscard]] const char* getName() const override;
void addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
uint8_t vcid = 0) override;
ReturnValue_t performOperation(uint8_t opCode); ReturnValue_t performOperation(uint8_t opCode);
ReturnValue_t initialize() override; ReturnValue_t initialize() override;

View File

@ -13,6 +13,9 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore,
// std::endl; // std::endl;
for (unsigned int idx = 0; idx < destinations.size(); idx++) { for (unsigned int idx = 0; idx < destinations.size(); idx++) {
const auto& dest = destinations[idx]; const auto& dest = destinations[idx];
if (dest.isFull) {
continue;
}
if ((destinations.size() > 1) and (idx < (destinations.size() - 1))) { if ((destinations.size() > 1) and (idx < (destinations.size() - 1))) {
// Create copy of data to ensure each TM recipient has its own copy. That way, we don't need // Create copy of data to ensure each TM recipient has its own copy. That way, we don't need
// to bother with send order and where the data is deleted. // to bother with send order and where the data is deleted.
@ -52,8 +55,21 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore,
return result; return result;
} }
void PusLiveDemux::addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, uint32_t PusLiveDemux::addDestination(const char* name,
uint8_t vcid) { const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid) {
auto queueId = downlinkDestination.getReportReceptionQueue(vcid); auto queueId = downlinkDestination.getReportReceptionQueue(vcid);
destinations.emplace_back(name, queueId, vcid); destinations.emplace_back(name, queueId, vcid);
return destinations.size() - 1;
}
void PusLiveDemux::setDestFull(uint32_t listIndex) {
if (destinations.size() > 0 and listIndex <= destinations.size() - 1) {
destinations[listIndex].isFull = true;
}
}
void PusLiveDemux::setDestAvailable(uint32_t listIndex) {
if (destinations.size() > 0 and listIndex <= destinations.size() - 1) {
destinations[listIndex].isFull = false;
}
} }

View File

@ -14,8 +14,10 @@ class PusLiveDemux {
ReturnValue_t demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId, ReturnValue_t demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId,
const uint8_t* tmData, size_t tmSize); const uint8_t* tmData, size_t tmSize);
void addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, uint32_t addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
uint8_t vcid = 0); uint8_t vcid = 0);
void setDestFull(uint32_t listIndex);
void setDestAvailable(uint32_t listIndex);
private: private:
struct Destination { struct Destination {
@ -24,6 +26,7 @@ class PusLiveDemux {
const char* name; const char* name;
MessageQueueId_t queueId; MessageQueueId_t queueId;
bool isFull = false;
uint8_t virtualChannel = 0; uint8_t virtualChannel = 0;
}; };

View File

@ -30,9 +30,10 @@ MessageQueueId_t TmFunnelBase::getReportReceptionQueue(uint8_t virtualChannel) c
return tmQueue->getId(); return tmQueue->getId();
} }
void TmFunnelBase::addLiveDestination(const char *name, uint32_t TmFunnelBase::addLiveDestination(const char *name,
const AcceptsTelemetryIF &downlinkDestination, uint8_t vcid) { const AcceptsTelemetryIF &downlinkDestination,
liveDemux.addDestination(name, downlinkDestination, vcid); uint8_t vcid) {
return liveDemux.addDestination(name, downlinkDestination, vcid);
} }
ReturnValue_t TmFunnelBase::initialize() { ReturnValue_t TmFunnelBase::initialize() {

View File

@ -37,8 +37,9 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject {
}; };
explicit TmFunnelBase(FunnelCfg cfg); explicit TmFunnelBase(FunnelCfg cfg);
[[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override;
void addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, virtual uint32_t addLiveDestination(const char* name,
uint8_t vcid = 0); const AcceptsTelemetryIF& downlinkDestination,
uint8_t vcid = 0);
ReturnValue_t demultiplexLivePackets(store_address_t origStoreId, const uint8_t* tmData, ReturnValue_t demultiplexLivePackets(store_address_t origStoreId, const uint8_t* tmData,
size_t tmSize); size_t tmSize);
ReturnValue_t initialize() override; ReturnValue_t initialize() override;