CFDP SOURCE handler #157

Merged
muellerr merged 107 commits from cfdp-source-handler into develop 2023-10-19 10:59:55 +02:00
3 changed files with 7 additions and 18 deletions
Showing only changes of commit c4e18cc2f3 - Show all commits

View File

@ -325,7 +325,7 @@ ReturnValue_t cfdp::SourceHandler::sendGenericPdu(const SerializeIF& pdu) {
if (result != OK) { if (result != OK) {
addError(result); addError(result);
fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY; fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY;
if(result == StorageManagerIF::DATA_STORAGE_FULL) { if (result == StorageManagerIF::DATA_STORAGE_FULL) {
return TM_STORE_FULL; return TM_STORE_FULL;
} }
return result; return result;
@ -339,7 +339,7 @@ ReturnValue_t cfdp::SourceHandler::sendGenericPdu(const SerializeIF& pdu) {
TmTcMessage tmMsg(storeId); TmTcMessage tmMsg(storeId);
result = result =
fsfwParams.msgQueue->sendMessage(fsfwParams.packetDest.getReportReceptionQueue(), &tmMsg); fsfwParams.msgQueue->sendMessage(fsfwParams.packetDest.getReportReceptionQueue(), &tmMsg);
if(result != OK) { if (result != OK) {
fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY; fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY;
} }
if (result == MessageQueueIF::FULL) { if (result == MessageQueueIF::FULL) {

View File

@ -23,18 +23,8 @@ TmTcBridge::TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDes
TmTcBridge::~TmTcBridge() { QueueFactory::instance()->deleteMessageQueue(tmTcReceptionQueue); } TmTcBridge::~TmTcBridge() { QueueFactory::instance()->deleteMessageQueue(tmTcReceptionQueue); }
ReturnValue_t TmTcBridge::setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle) { void TmTcBridge::setNumberOfSentPacketsPerCycle(uint32_t sentPacketsPerCycle_) {
if (sentPacketsPerCycle <= LIMIT_STORED_DATA_SENT_PER_CYCLE) { this->sentPacketsPerCycle = sentPacketsPerCycle_;
this->sentPacketsPerCycle = sentPacketsPerCycle;
return returnvalue::OK;
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "TmTcBridge::setNumberOfSentPacketsPerCycle: Number of "
<< "packets sent per cycle exceeds limits. "
<< "Keeping default value." << std::endl;
#endif
return returnvalue::FAILED;
}
} }
ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(unsigned int maxNumberOfPacketsStored) { ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(unsigned int maxNumberOfPacketsStored) {

View File

@ -15,10 +15,9 @@ class TmTcBridge : public AcceptsTelemetryIF,
public ExecutableObjectIF, public ExecutableObjectIF,
public SystemObject { public SystemObject {
public: public:
static constexpr uint8_t LIMIT_STORED_DATA_SENT_PER_CYCLE = 15;
static constexpr unsigned int LIMIT_DOWNLINK_PACKETS_STORED = 500; static constexpr unsigned int LIMIT_DOWNLINK_PACKETS_STORED = 500;
static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5; static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 20;
static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10; static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10;
TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDestination, TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDestination,
@ -32,7 +31,7 @@ class TmTcBridge : public AcceptsTelemetryIF,
* @return -@c returnvalue::OK if value was set successfully * @return -@c returnvalue::OK if value was set successfully
* -@c returnvalue::FAILED otherwise, stored value stays the same * -@c returnvalue::FAILED otherwise, stored value stays the same
*/ */
ReturnValue_t setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle); void setNumberOfSentPacketsPerCycle(uint32_t sentPacketsPerCycle);
/** /**
* Set number of packets sent per performOperation().Please note that this * Set number of packets sent per performOperation().Please note that this
@ -151,7 +150,7 @@ class TmTcBridge : public AcceptsTelemetryIF,
* This FIFO can be used to store downlink data which can not be sent at the moment. * This FIFO can be used to store downlink data which can not be sent at the moment.
*/ */
DynamicFIFO<store_address_t>* tmFifo = nullptr; DynamicFIFO<store_address_t>* tmFifo = nullptr;
uint8_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE; uint32_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE;
unsigned int maxNumberOfPacketsStored = DEFAULT_DOWNLINK_PACKETS_STORED; unsigned int maxNumberOfPacketsStored = DEFAULT_DOWNLINK_PACKETS_STORED;
}; };