Compare commits
39 Commits
24069dfd78
...
irini
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1910a7838c | ||
![]() |
ba3a99466a | ||
438efe074e | |||
1759700b6a | |||
c7618294ac | |||
af890c6218 | |||
7f3e5e42bb | |||
cda81fc841 | |||
5a69c1f8b9 | |||
1d1d91f591 | |||
043b8b5b3f | |||
![]() |
95a64e1da3 | ||
![]() |
ab68817e9a | ||
![]() |
36652e6fce | ||
![]() |
3749f31ab4 | ||
ebbe08639c | |||
d286fc1855 | |||
cf35cca923 | |||
2058817ba5 | |||
c328891030 | |||
76a459a02c | |||
fbec1b3dc9 | |||
c4fa7281ae | |||
ac62443f31 | |||
8cfe848dfe | |||
c7cf8e710d | |||
af7c6c57a3 | |||
c835525196 | |||
7dddcdfd55 | |||
261eea381e | |||
e59f1f26bf | |||
f7cde80088 | |||
e60a665de4 | |||
34658ef7db | |||
f288d5120d | |||
5a425a1c58 | |||
5e62258aa6 | |||
13cda86d23 | |||
e0c9bf5871 |
@@ -252,6 +252,7 @@ ReturnValue_t GyroHandlerL3GD20H::initializeLocalDataPool(localpool::DataPool &l
|
|||||||
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Y, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Y, new PoolEntry<float>({0.0}));
|
||||||
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Z, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Z, new PoolEntry<float>({0.0}));
|
||||||
localDataPoolMap.emplace(L3GD20H::TEMPERATURE, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(L3GD20H::TEMPERATURE, new PoolEntry<float>({0.0}));
|
||||||
|
poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 10.0, false);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -475,6 +475,7 @@ ReturnValue_t MgmLIS3MDLHandler::initializeLocalDataPool(localpool::DataPool &lo
|
|||||||
localDataPoolMap.emplace(MGMLIS3MDL::FIELD_STRENGTH_Y, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(MGMLIS3MDL::FIELD_STRENGTH_Y, new PoolEntry<float>({0.0}));
|
||||||
localDataPoolMap.emplace(MGMLIS3MDL::FIELD_STRENGTH_Z, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(MGMLIS3MDL::FIELD_STRENGTH_Z, new PoolEntry<float>({0.0}));
|
||||||
localDataPoolMap.emplace(MGMLIS3MDL::TEMPERATURE_CELCIUS, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(MGMLIS3MDL::TEMPERATURE_CELCIUS, new PoolEntry<float>({0.0}));
|
||||||
|
poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 10.0, false);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -312,6 +312,7 @@ ReturnValue_t MgmRM3100Handler::initializeLocalDataPool(localpool::DataPool &loc
|
|||||||
localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_X, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_X, new PoolEntry<float>({0.0}));
|
||||||
localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_Y, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_Y, new PoolEntry<float>({0.0}));
|
||||||
localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_Z, new PoolEntry<float>({0.0}));
|
localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_Z, new PoolEntry<float>({0.0}));
|
||||||
|
poolManager.subscribeForPeriodicPacket(primaryDataset.getSid(), false, 10.0, false);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -577,6 +577,9 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me
|
|||||||
|
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
if(result == WRONG_HK_PACKET_TYPE) {
|
||||||
|
printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleHousekeepingMessage", WRONG_HK_PACKET_TYPE);
|
||||||
|
}
|
||||||
HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result);
|
HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result);
|
||||||
} else {
|
} else {
|
||||||
HousekeepingMessage::setHkRequestSuccessReply(&reply, sid);
|
HousekeepingMessage::setHkRequestSuccessReply(&reply, sid);
|
||||||
@@ -696,9 +699,9 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
/* Configuration error */
|
/* Configuration error */
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "LocalDataPoolManager::performHkOperation: HK generation failed." << std::endl;
|
sif::warning << "LocalDataPoolManager::performPeriodicHkOperation: HK generation failed." << std::endl;
|
||||||
#else
|
#else
|
||||||
sif::printWarning("LocalDataPoolManager::performHkOperation: HK generation failed.\n");
|
sif::printWarning("LocalDataPoolManager::performPeriodicHkOperation: HK generation failed.\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -834,6 +837,8 @@ void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType,
|
|||||||
errorPrint = "Dataset not found";
|
errorPrint = "Dataset not found";
|
||||||
} else if (error == POOLOBJECT_NOT_FOUND) {
|
} else if (error == POOLOBJECT_NOT_FOUND) {
|
||||||
errorPrint = "Pool Object not found";
|
errorPrint = "Pool Object not found";
|
||||||
|
} else if (error == WRONG_HK_PACKET_TYPE) {
|
||||||
|
errorPrint = "Wrong Packet Type";
|
||||||
} else if (error == HasReturnvaluesIF::RETURN_FAILED) {
|
} else if (error == HasReturnvaluesIF::RETURN_FAILED) {
|
||||||
if (outputType == sif::OutputTypes::OUT_WARNING) {
|
if (outputType == sif::OutputTypes::OUT_WARNING) {
|
||||||
errorPrint = "Generic Warning";
|
errorPrint = "Generic Warning";
|
||||||
|
@@ -572,6 +572,9 @@ void DeviceHandlerBase::setMode(Mode_t newMode, uint8_t newSubmode) {
|
|||||||
mode = newMode;
|
mode = newMode;
|
||||||
modeChanged();
|
modeChanged();
|
||||||
setNormalDatapoolEntriesInvalid();
|
setNormalDatapoolEntriesInvalid();
|
||||||
|
if (newMode == MODE_OFF) {
|
||||||
|
disableCommandsAndReplies();
|
||||||
|
}
|
||||||
if (!isTransitionalMode()) {
|
if (!isTransitionalMode()) {
|
||||||
modeHelper.modeChanged(newMode, newSubmode);
|
modeHelper.modeChanged(newMode, newSubmode);
|
||||||
announceMode(false);
|
announceMode(false);
|
||||||
@@ -1567,3 +1570,22 @@ void DeviceHandlerBase::setParent(object_id_t parent) { this->parent = parent; }
|
|||||||
void DeviceHandlerBase::setPowerSwitcher(PowerSwitchIF* switcher) {
|
void DeviceHandlerBase::setPowerSwitcher(PowerSwitchIF* switcher) {
|
||||||
this->powerSwitcher = switcher;
|
this->powerSwitcher = switcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceHandlerBase::disableCommandsAndReplies() {
|
||||||
|
for (auto& command : deviceCommandMap) {
|
||||||
|
if (command.second.isExecuting) {
|
||||||
|
command.second.isExecuting = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (auto& reply : deviceReplyMap) {
|
||||||
|
if (!reply.second.periodic) {
|
||||||
|
if (reply.second.countdown != nullptr) {
|
||||||
|
reply.second.countdown->timeOut();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
reply.second.delayCycles = 0;
|
||||||
|
}
|
||||||
|
reply.second.active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1325,6 +1325,11 @@ class DeviceHandlerBase : public DeviceHandlerIF,
|
|||||||
void printWarningOrError(sif::OutputTypes errorType, const char *functionName,
|
void printWarningOrError(sif::OutputTypes errorType, const char *functionName,
|
||||||
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
|
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
|
||||||
const char *errorPrint = nullptr);
|
const char *errorPrint = nullptr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disables all commands and replies when device is set to MODE_OFF
|
||||||
|
*/
|
||||||
|
void disableCommandsAndReplies();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_DEVICEHANDLERS_DEVICEHANDLERBASE_H_ */
|
#endif /* FSFW_DEVICEHANDLERS_DEVICEHANDLERBASE_H_ */
|
||||||
|
@@ -27,6 +27,7 @@ enum : uint8_t {
|
|||||||
PUS_SERVICE_6 = 86,
|
PUS_SERVICE_6 = 86,
|
||||||
PUS_SERVICE_8 = 88,
|
PUS_SERVICE_8 = 88,
|
||||||
PUS_SERVICE_9 = 89,
|
PUS_SERVICE_9 = 89,
|
||||||
|
PUS_SERVICE_11 = 91,
|
||||||
PUS_SERVICE_17 = 97,
|
PUS_SERVICE_17 = 97,
|
||||||
PUS_SERVICE_23 = 103,
|
PUS_SERVICE_23 = 103,
|
||||||
MGM_LIS3MDL = 106,
|
MGM_LIS3MDL = 106,
|
||||||
|
@@ -4,6 +4,7 @@ target_sources(
|
|||||||
AsciiConverter.cpp
|
AsciiConverter.cpp
|
||||||
CRC.cpp
|
CRC.cpp
|
||||||
DleEncoder.cpp
|
DleEncoder.cpp
|
||||||
|
DleParser.cpp
|
||||||
PeriodicOperationDivider.cpp
|
PeriodicOperationDivider.cpp
|
||||||
timevalOperations.cpp
|
timevalOperations.cpp
|
||||||
Type.cpp
|
Type.cpp
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
#include "DleParser.h"
|
#include "DleParser.h"
|
||||||
|
|
||||||
#include <fsfw/globalfunctions/DleEncoder.h>
|
|
||||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef MISSION_DEVICES_DLEPARSER_H_
|
#pragma once
|
||||||
#define MISSION_DEVICES_DLEPARSER_H_
|
|
||||||
|
|
||||||
#include <fsfw/container/SimpleRingBuffer.h>
|
#include <fsfw/container/SimpleRingBuffer.h>
|
||||||
#include <fsfw/globalfunctions/DleEncoder.h>
|
#include <fsfw/globalfunctions/DleEncoder.h>
|
||||||
@@ -123,5 +122,3 @@ class DleParser : public HasReturnvaluesIF {
|
|||||||
Context ctx;
|
Context ctx;
|
||||||
bool startFound = false;
|
bool startFound = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_DEVICES_DLEPARSER_H_ */
|
|
||||||
|
@@ -34,7 +34,7 @@ class CommandMessageIF {
|
|||||||
static const Command_t CMD_NONE = MAKE_COMMAND_ID(0);
|
static const Command_t CMD_NONE = MAKE_COMMAND_ID(0);
|
||||||
static const Command_t REPLY_COMMAND_OK = MAKE_COMMAND_ID(1);
|
static const Command_t REPLY_COMMAND_OK = MAKE_COMMAND_ID(1);
|
||||||
//! Reply indicating that the current command was rejected,
|
//! Reply indicating that the current command was rejected,
|
||||||
//! par1 should contain the error code
|
//! Parameter 1 should contain the error code
|
||||||
static const Command_t REPLY_REJECTED = MAKE_COMMAND_ID(2);
|
static const Command_t REPLY_REJECTED = MAKE_COMMAND_ID(2);
|
||||||
|
|
||||||
virtual ~CommandMessageIF(){};
|
virtual ~CommandMessageIF(){};
|
||||||
|
@@ -122,7 +122,6 @@ TcpTmTcServer::~TcpTmTcServer() { closeSocket(listenerTcpSocket); }
|
|||||||
}
|
}
|
||||||
|
|
||||||
connSocket = accept(listenerTcpSocket, &clientSockAddr, &connectorSockAddrLen);
|
connSocket = accept(listenerTcpSocket, &clientSockAddr, &connectorSockAddrLen);
|
||||||
// connSocket = accept(listenerTcpSocket, nullptr, nullptr);
|
|
||||||
|
|
||||||
if (connSocket == INVALID_SOCKET) {
|
if (connSocket == INVALID_SOCKET) {
|
||||||
handleError(Protocol::TCP, ErrorSources::ACCEPT_CALL, 500);
|
handleError(Protocol::TCP, ErrorSources::ACCEPT_CALL, 500);
|
||||||
|
@@ -44,18 +44,26 @@ class Service11TelecommandScheduling final : public PusServiceBase {
|
|||||||
static constexpr ReturnValue_t INVALID_RELATIVE_TIME =
|
static constexpr ReturnValue_t INVALID_RELATIVE_TIME =
|
||||||
HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3);
|
HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3);
|
||||||
|
|
||||||
|
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_11;
|
||||||
|
|
||||||
|
//! [EXPORT] : [COMMENT] Deletion of a TC from the map failed.
|
||||||
|
//! P1: First 32 bit of request ID, P2. Last 32 bit of Request ID
|
||||||
|
static constexpr Event TC_DELETION_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||||
|
|
||||||
// The types of PUS-11 subservices
|
// The types of PUS-11 subservices
|
||||||
enum Subservice : uint8_t{ENABLE_SCHEDULING = 1,
|
enum Subservice : uint8_t {
|
||||||
DISABLE_SCHEDULING = 2,
|
ENABLE_SCHEDULING = 1,
|
||||||
RESET_SCHEDULING = 3,
|
DISABLE_SCHEDULING = 2,
|
||||||
INSERT_ACTIVITY = 4,
|
RESET_SCHEDULING = 3,
|
||||||
DELETE_ACTIVITY = 5,
|
INSERT_ACTIVITY = 4,
|
||||||
FILTER_DELETE_ACTIVITY = 6,
|
DELETE_ACTIVITY = 5,
|
||||||
TIMESHIFT_ACTIVITY = 7,
|
FILTER_DELETE_ACTIVITY = 6,
|
||||||
FILTER_TIMESHIFT_ACTIVITY = 8,
|
TIMESHIFT_ACTIVITY = 7,
|
||||||
DETAIL_REPORT = 9,
|
FILTER_TIMESHIFT_ACTIVITY = 8,
|
||||||
TIMEBASE_SCHEDULE_DETAIL_REPORT = 10,
|
DETAIL_REPORT = 9,
|
||||||
TIMESHIFT_ALL_SCHEDULE_ACTIVITIES = 15};
|
TIMEBASE_SCHEDULE_DETAIL_REPORT = 10,
|
||||||
|
TIMESHIFT_ALL_SCHEDULE_ACTIVITIES = 15
|
||||||
|
};
|
||||||
|
|
||||||
// The types of time windows for TC[11,6] and TC[11,8], as defined in ECSS-E-ST-70-41C,
|
// The types of time windows for TC[11,6] and TC[11,8], as defined in ECSS-E-ST-70-41C,
|
||||||
// requirement 8.11.3c (p. 507)
|
// requirement 8.11.3c (p. 507)
|
||||||
@@ -73,6 +81,9 @@ class Service11TelecommandScheduling final : public PusServiceBase {
|
|||||||
|
|
||||||
~Service11TelecommandScheduling() override;
|
~Service11TelecommandScheduling() override;
|
||||||
|
|
||||||
|
void enableExpiredTcDeletion();
|
||||||
|
void disableExpiredTcDeletion();
|
||||||
|
|
||||||
/** PusServiceBase overrides */
|
/** PusServiceBase overrides */
|
||||||
ReturnValue_t handleRequest(uint8_t subservice) override;
|
ReturnValue_t handleRequest(uint8_t subservice) override;
|
||||||
ReturnValue_t performService() override;
|
ReturnValue_t performService() override;
|
||||||
@@ -90,6 +101,11 @@ class Service11TelecommandScheduling final : public PusServiceBase {
|
|||||||
// minimum release time offset to insert into schedule
|
// minimum release time offset to insert into schedule
|
||||||
const uint16_t RELEASE_TIME_MARGIN_SECONDS = 5;
|
const uint16_t RELEASE_TIME_MARGIN_SECONDS = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, the scheduling will be disabled. This is a standard requirement
|
||||||
|
*/
|
||||||
|
bool schedulingEnabled = false;
|
||||||
|
bool deleteExpiredTcWhenDisabled = true;
|
||||||
bool debugMode = false;
|
bool debugMode = false;
|
||||||
StorageManagerIF* tcStore = nullptr;
|
StorageManagerIF* tcStore = nullptr;
|
||||||
AcceptsTelecommandsIF* tcRecipient = nullptr;
|
AcceptsTelecommandsIF* tcRecipient = nullptr;
|
||||||
@@ -104,6 +120,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
|
|||||||
|
|
||||||
TelecommandMap telecommandMap;
|
TelecommandMap telecommandMap;
|
||||||
|
|
||||||
|
ReturnValue_t handleResetCommand();
|
||||||
/**
|
/**
|
||||||
* @brief Logic to be performed on an incoming TC[11,4].
|
* @brief Logic to be performed on an incoming TC[11,4].
|
||||||
* @return RETURN_OK if successful
|
* @return RETURN_OK if successful
|
||||||
|
@@ -38,6 +38,17 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest(
|
|||||||
return handleInvalidData("handleRequest");
|
return handleInvalidData("handleRequest");
|
||||||
}
|
}
|
||||||
switch (subservice) {
|
switch (subservice) {
|
||||||
|
case Subservice::ENABLE_SCHEDULING: {
|
||||||
|
schedulingEnabled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Subservice::DISABLE_SCHEDULING: {
|
||||||
|
schedulingEnabled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Subservice::RESET_SCHEDULING: {
|
||||||
|
return handleResetCommand();
|
||||||
|
}
|
||||||
case Subservice::INSERT_ACTIVITY:
|
case Subservice::INSERT_ACTIVITY:
|
||||||
return doInsertActivity(data, size);
|
return doInsertActivity(data, size);
|
||||||
case Subservice::DELETE_ACTIVITY:
|
case Subservice::DELETE_ACTIVITY:
|
||||||
@@ -49,41 +60,43 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest(
|
|||||||
case Subservice::FILTER_TIMESHIFT_ACTIVITY:
|
case Subservice::FILTER_TIMESHIFT_ACTIVITY:
|
||||||
return doFilterTimeshiftActivity(data, size);
|
return doFilterTimeshiftActivity(data, size);
|
||||||
default:
|
default:
|
||||||
break;
|
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
|
||||||
}
|
}
|
||||||
|
return RETURN_OK;
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t MAX_NUM_TCS>
|
template <size_t MAX_NUM_TCS>
|
||||||
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::performService() {
|
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::performService() {
|
||||||
// DEBUG
|
if (not schedulingEnabled) {
|
||||||
// DebugPrintMultimapContent();
|
return RETURN_OK;
|
||||||
|
}
|
||||||
// get current time as UNIX timestamp
|
// get current time as UNIX timestamp
|
||||||
timeval tNow = {};
|
timeval tNow = {};
|
||||||
Clock::getClock_timeval(&tNow);
|
Clock::getClock_timeval(&tNow);
|
||||||
|
|
||||||
|
// TODO: Optionally limit the max number of released TCs per cycle?
|
||||||
// NOTE: The iterator is increased in the loop here. Increasing the iterator as for-loop arg
|
// NOTE: The iterator is increased in the loop here. Increasing the iterator as for-loop arg
|
||||||
// does not work in this case as we are deleting the current element here.
|
// does not work in this case as we are deleting the current element here.
|
||||||
for (auto it = telecommandMap.begin(); it != telecommandMap.end();) {
|
for (auto it = telecommandMap.begin(); it != telecommandMap.end();) {
|
||||||
if (it->first <= tNow.tv_sec) {
|
if (it->first <= static_cast<uint32_t>(tNow.tv_sec)) {
|
||||||
// release tc
|
if (schedulingEnabled) {
|
||||||
TmTcMessage releaseMsg(it->second.storeAddr);
|
// release tc
|
||||||
auto sendRet = this->requestQueue->sendMessage(recipientMsgQueueId, &releaseMsg, false);
|
TmTcMessage releaseMsg(it->second.storeAddr);
|
||||||
|
auto sendRet = this->requestQueue->sendMessage(recipientMsgQueueId, &releaseMsg, false);
|
||||||
|
|
||||||
if (sendRet != HasReturnvaluesIF::RETURN_OK) {
|
if (sendRet != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return sendRet;
|
return sendRet;
|
||||||
}
|
}
|
||||||
|
if (debugMode) {
|
||||||
telecommandMap.erase(it++);
|
|
||||||
|
|
||||||
if (debugMode) {
|
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::info << "Released TC & erased it from TC map" << std::endl;
|
sif::info << "Released TC & erased it from TC map" << std::endl;
|
||||||
#else
|
#else
|
||||||
sif::printInfo("Released TC & erased it from TC map\n");
|
sif::printInfo("Released TC & erased it from TC map\n");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
telecommandMap.erase(it++);
|
||||||
|
} else if (deleteExpiredTcWhenDisabled) {
|
||||||
|
telecommandMap.erase(it++);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -113,6 +126,26 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::initialize() {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <size_t MAX_NUM_TCS>
|
||||||
|
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleResetCommand() {
|
||||||
|
for (auto it = telecommandMap.begin(); it != telecommandMap.end(); it++) {
|
||||||
|
ReturnValue_t result = tcStore->deleteData(it->second.storeAddr);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
|
// This should not happen
|
||||||
|
sif::warning << "Service11TelecommandScheduling::handleRequestDeleting: Deletion failed"
|
||||||
|
<< std::endl;
|
||||||
|
#else
|
||||||
|
sif::printWarning("Service11TelecommandScheduling::handleRequestDeleting: Deletion failed\n");
|
||||||
|
#endif
|
||||||
|
triggerEvent(TC_DELETION_FAILED, (it->second.requestId >> 32) & 0xffffffff,
|
||||||
|
it->second.requestId & 0xffffffff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
telecommandMap.clear();
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
template <size_t MAX_NUM_TCS>
|
template <size_t MAX_NUM_TCS>
|
||||||
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity(
|
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity(
|
||||||
const uint8_t *data, size_t size) {
|
const uint8_t *data, size_t size) {
|
||||||
@@ -582,7 +615,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleInvalidD
|
|||||||
|
|
||||||
template <size_t MAX_NUM_TCS>
|
template <size_t MAX_NUM_TCS>
|
||||||
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapContent() const {
|
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapContent() const {
|
||||||
for (const auto &dit : telecommandMap) {
|
for ([[maybe_unused]] const auto &dit : telecommandMap) {
|
||||||
#if FSFW_DISABLE_PRINTOUT == 0
|
#if FSFW_DISABLE_PRINTOUT == 0
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
|
sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
|
||||||
@@ -600,3 +633,13 @@ inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapConte
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <size_t MAX_NUM_TCS>
|
||||||
|
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::enableExpiredTcDeletion() {
|
||||||
|
deleteExpiredTcWhenDisabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <size_t MAX_NUM_TCS>
|
||||||
|
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::disableExpiredTcDeletion() {
|
||||||
|
deleteExpiredTcWhenDisabled = false;
|
||||||
|
}
|
||||||
|
@@ -208,7 +208,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
|
|||||||
ReturnValue_t error = HasReturnvaluesIF::RETURN_FAILED;
|
ReturnValue_t error = HasReturnvaluesIF::RETURN_FAILED;
|
||||||
HousekeepingMessage::getHkRequestFailureReply(reply, &error);
|
HousekeepingMessage::getHkRequestFailureReply(reply, &error);
|
||||||
failureParameter2 = error;
|
failureParameter2 = error;
|
||||||
return CommandingServiceBase::EXECUTION_COMPLETE;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -248,19 +248,23 @@ void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) {
|
|||||||
case (HousekeepingMessage::HK_REQUEST_FAILURE): {
|
case (HousekeepingMessage::HK_REQUEST_FAILURE): {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case(CommandMessage::REPLY_REJECTED): {
|
||||||
|
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Unexpected reply "
|
||||||
|
"rejected with error code" << reply->getParameter() << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Invalid reply with reply "
|
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Invalid reply with reply "
|
||||||
"command "
|
"command " << command << "" << std::endl;
|
||||||
<< command << "!" << std::endl;
|
|
||||||
#else
|
#else
|
||||||
sif::printWarning(
|
sif::printWarning(
|
||||||
"Service3Housekeeping::handleUnrequestedReply: Invalid reply with "
|
"Service3Housekeeping::handleUnrequestedReply: Invalid reply with "
|
||||||
"reply command %hu!\n",
|
"reply command %hu\n",
|
||||||
command);
|
command);
|
||||||
#endif
|
#endif
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,6 +279,7 @@ void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) {
|
|||||||
"Could not generate reply!\n");
|
"Could not generate reply!\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
CommandingServiceBase::handleUnrequestedReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueId_t Service3Housekeeping::getHkQueue() const { return commandQueue->getId(); }
|
MessageQueueId_t Service3Housekeeping::getHkQueue() const { return commandQueue->getId(); }
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
FixedTimeslotTaskBase::FixedTimeslotTaskBase(TaskPeriod period_,
|
FixedTimeslotTaskBase::FixedTimeslotTaskBase(TaskPeriod period_,
|
||||||
TaskDeadlineMissedFunction dlmFunc_)
|
TaskDeadlineMissedFunction dlmFunc_)
|
||||||
: pollingSeqTable(getPeriodMs()), period(period_), dlmFunc(dlmFunc_) {}
|
: period(period_), pollingSeqTable(getPeriodMs()), dlmFunc(dlmFunc_) {}
|
||||||
uint32_t FixedTimeslotTaskBase::getPeriodMs() const { return static_cast<uint32_t>(period * 1000); }
|
uint32_t FixedTimeslotTaskBase::getPeriodMs() const { return static_cast<uint32_t>(period * 1000); }
|
||||||
|
|
||||||
bool FixedTimeslotTaskBase::isEmpty() const { return pollingSeqTable.isEmpty(); }
|
bool FixedTimeslotTaskBase::isEmpty() const { return pollingSeqTable.isEmpty(); }
|
||||||
|
@@ -12,15 +12,15 @@ class FixedTimeslotTaskBase : public FixedTimeslotTaskIF {
|
|||||||
;
|
;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Polling sequence table which contains the object to execute
|
|
||||||
//! and information like the timeslots and the passed execution step.
|
|
||||||
FixedSlotSequence pollingSeqTable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Period of task in floating point seconds
|
* @brief Period of task in floating point seconds
|
||||||
*/
|
*/
|
||||||
TaskPeriod period;
|
TaskPeriod period;
|
||||||
|
|
||||||
|
//! Polling sequence table which contains the object to execute
|
||||||
|
//! and information like the timeslots and the passed execution step.
|
||||||
|
FixedSlotSequence pollingSeqTable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The pointer to the deadline-missed function.
|
* @brief The pointer to the deadline-missed function.
|
||||||
* @details
|
* @details
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
CCSDSDistributor::CCSDSDistributor(uint16_t setDefaultApid, object_id_t setObjectId)
|
CCSDSDistributor::CCSDSDistributor(uint16_t setDefaultApid, object_id_t setObjectId)
|
||||||
: TcDistributor(setObjectId), defaultApid(setDefaultApid) {}
|
: TcDistributor(setObjectId), defaultApid(setDefaultApid) {}
|
||||||
|
|
||||||
CCSDSDistributor::~CCSDSDistributor() {}
|
CCSDSDistributor::~CCSDSDistributor() = default;
|
||||||
|
|
||||||
TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
|
TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
|
||||||
#if CCSDS_DISTRIBUTOR_DEBUGGING == 1
|
#if CCSDS_DISTRIBUTOR_DEBUGGING == 1
|
||||||
@@ -38,6 +38,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
|
|||||||
" store failed!\n");
|
" store failed!\n");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
return queueMap.end();
|
||||||
}
|
}
|
||||||
SpacePacketBase currentPacket(packet);
|
SpacePacketBase currentPacket(packet);
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
|
|||||||
sif::info << "CCSDSDistributor::selectDestination has packet with APID " << std::hex
|
sif::info << "CCSDSDistributor::selectDestination has packet with APID " << std::hex
|
||||||
<< currentPacket.getAPID() << std::dec << std::endl;
|
<< currentPacket.getAPID() << std::dec << std::endl;
|
||||||
#endif
|
#endif
|
||||||
TcMqMapIter position = this->queueMap.find(currentPacket.getAPID());
|
auto position = this->queueMap.find(currentPacket.getAPID());
|
||||||
if (position != this->queueMap.end()) {
|
if (position != this->queueMap.end()) {
|
||||||
return position;
|
return position;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -48,8 +48,8 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
|
|||||||
sif::warning << "PUSDistributor::handlePacket: Packet format invalid, " << keyword
|
sif::warning << "PUSDistributor::handlePacket: Packet format invalid, " << keyword
|
||||||
<< " error" << std::endl;
|
<< " error" << std::endl;
|
||||||
#else
|
#else
|
||||||
sif::printWarning(
|
sif::printWarning("PUSDistributor::handlePacket: Packet format invalid, %s error\n",
|
||||||
"PUSDistributor::handlePacket: Packet format invalid, %s error\n", keyword);
|
keyword);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -131,8 +131,7 @@ ReturnValue_t PUSDistributor::initialize() {
|
|||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* ccsdsDistributor =
|
auto* ccsdsDistributor = ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource);
|
||||||
ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource);
|
|
||||||
if (ccsdsDistributor == nullptr) {
|
if (ccsdsDistributor == nullptr) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "PUSDistributor::initialize: Packet source invalid" << std::endl;
|
sif::error << "PUSDistributor::initialize: Packet source invalid" << std::endl;
|
||||||
|
@@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
class TcPacketStoredIF {
|
class TcPacketStoredIF {
|
||||||
public:
|
public:
|
||||||
virtual ~TcPacketStoredIF()= default;;
|
virtual ~TcPacketStoredIF() = default;
|
||||||
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* With this call, the stored packet can be set to another packet in a store. This is useful
|
* With this call, the stored packet can be set to another packet in a store. This is useful
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_
|
#ifndef FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_
|
||||||
#define FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_
|
#define FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_
|
||||||
|
|
||||||
#include "../ipc/MessageQueueSenderIF.h"
|
#include "fsfw/ipc/MessageQueueSenderIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This interface is implemented by classes that are sinks for
|
* @brief This interface is implemented by classes that are sinks for
|
||||||
@@ -20,7 +20,7 @@ class AcceptsTelecommandsIF {
|
|||||||
/**
|
/**
|
||||||
* @brief The virtual destructor as it is mandatory for C++ interfaces.
|
* @brief The virtual destructor as it is mandatory for C++ interfaces.
|
||||||
*/
|
*/
|
||||||
virtual ~AcceptsTelecommandsIF() {}
|
virtual ~AcceptsTelecommandsIF() = default;
|
||||||
/**
|
/**
|
||||||
* @brief Getter for the service id.
|
* @brief Getter for the service id.
|
||||||
* @details Any receiving service (at least any PUS service) shall have a
|
* @details Any receiving service (at least any PUS service) shall have a
|
||||||
|
@@ -36,7 +36,7 @@ ReturnValue_t TmTcBridge::setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(uint8_t maxNumberOfPacketsStored) {
|
ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(unsigned int maxNumberOfPacketsStored) {
|
||||||
if (maxNumberOfPacketsStored <= LIMIT_DOWNLINK_PACKETS_STORED) {
|
if (maxNumberOfPacketsStored <= LIMIT_DOWNLINK_PACKETS_STORED) {
|
||||||
this->maxNumberOfPacketsStored = maxNumberOfPacketsStored;
|
this->maxNumberOfPacketsStored = maxNumberOfPacketsStored;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
|
@@ -18,7 +18,7 @@ class TmTcBridge : public AcceptsTelemetryIF,
|
|||||||
public:
|
public:
|
||||||
static constexpr uint8_t TMTC_RECEPTION_QUEUE_DEPTH = 20;
|
static constexpr uint8_t TMTC_RECEPTION_QUEUE_DEPTH = 20;
|
||||||
static constexpr uint8_t LIMIT_STORED_DATA_SENT_PER_CYCLE = 15;
|
static constexpr uint8_t LIMIT_STORED_DATA_SENT_PER_CYCLE = 15;
|
||||||
static constexpr uint8_t LIMIT_DOWNLINK_PACKETS_STORED = 200;
|
static constexpr unsigned int LIMIT_DOWNLINK_PACKETS_STORED = 1000;
|
||||||
|
|
||||||
static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5;
|
static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5;
|
||||||
static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10;
|
static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10;
|
||||||
@@ -43,7 +43,7 @@ class TmTcBridge : public AcceptsTelemetryIF,
|
|||||||
* @return -@c RETURN_OK if value was set successfully
|
* @return -@c RETURN_OK if value was set successfully
|
||||||
* -@c RETURN_FAILED otherwise, stored value stays the same
|
* -@c RETURN_FAILED otherwise, stored value stays the same
|
||||||
*/
|
*/
|
||||||
ReturnValue_t setMaxNumberOfPacketsStored(uint8_t maxNumberOfPacketsStored);
|
ReturnValue_t setMaxNumberOfPacketsStored(unsigned int maxNumberOfPacketsStored);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This will set up the bridge to overwrite old data in the FIFO.
|
* This will set up the bridge to overwrite old data in the FIFO.
|
||||||
@@ -152,7 +152,7 @@ class TmTcBridge : public AcceptsTelemetryIF,
|
|||||||
*/
|
*/
|
||||||
DynamicFIFO<store_address_t>* tmFifo = nullptr;
|
DynamicFIFO<store_address_t>* tmFifo = nullptr;
|
||||||
uint8_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE;
|
uint8_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE;
|
||||||
uint8_t maxNumberOfPacketsStored = DEFAULT_DOWNLINK_PACKETS_STORED;
|
unsigned int maxNumberOfPacketsStored = DEFAULT_DOWNLINK_PACKETS_STORED;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_TMTCSERVICES_TMTCBRIDGE_H_ */
|
#endif /* FSFW_TMTCSERVICES_TMTCBRIDGE_H_ */
|
||||||
|
Reference in New Issue
Block a user