pus service improvements

This commit is contained in:
Robin Müller 2020-11-09 21:33:09 +01:00
parent 6bedc9b805
commit 6c22fab208
15 changed files with 71 additions and 67 deletions

View File

@ -7,9 +7,10 @@
#include "../modes/ModeMessage.h" #include "../modes/ModeMessage.h"
CService200ModeCommanding::CService200ModeCommanding(object_id_t objectId, CService200ModeCommanding::CService200ModeCommanding(object_id_t objectId,
uint16_t apid, uint8_t serviceId): uint16_t apid, uint8_t serviceId, uint8_t numParallelCommands,
uint16_t commandTimeoutSeconds):
CommandingServiceBase(objectId, apid, serviceId, CommandingServiceBase(objectId, apid, serviceId,
NUMBER_OF_PARALLEL_COMMANDS,COMMAND_TIMEOUT_SECONDS) {} numParallelCommands, commandTimeoutSeconds) {}
CService200ModeCommanding::~CService200ModeCommanding() {} CService200ModeCommanding::~CService200ModeCommanding() {}

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_CSERVICE200MODECOMMANDING_H_ #ifndef FSFW_PUS_CSERVICE200MODECOMMANDING_H_
#define FRAMEWORK_PUS_CSERVICE200MODECOMMANDING_H_ #define FSFW_PUS_CSERVICE200MODECOMMANDING_H_
#include "../tmtcservices/CommandingServiceBase.h" #include "../tmtcservices/CommandingServiceBase.h"
@ -15,11 +15,10 @@
*/ */
class CService200ModeCommanding: public CommandingServiceBase { class CService200ModeCommanding: public CommandingServiceBase {
public: public:
static constexpr uint8_t NUMBER_OF_PARALLEL_COMMANDS = 4;
static constexpr uint16_t COMMAND_TIMEOUT_SECONDS = 60;
CService200ModeCommanding(object_id_t objectId, CService200ModeCommanding(object_id_t objectId,
uint16_t apid, uint8_t serviceId); uint16_t apid, uint8_t serviceId, uint8_t numParallelCommands = 4,
uint16_t commandTimeoutSeconds = 60);
virtual~ CService200ModeCommanding(); virtual~ CService200ModeCommanding();
protected: protected:
@ -82,4 +81,4 @@ private:
}; };
}; };
#endif /* FRAMEWORK_PUS_CSERVICE200MODECOMMANDING_H_ */ #endif /* FSFW_PUS_CSERVICE200MODECOMMANDING_H_ */

View File

@ -6,15 +6,13 @@
#include "../tmtcpacket/pus/TmPacketStored.h" #include "../tmtcpacket/pus/TmPacketStored.h"
#include "../serviceinterface/ServiceInterfaceStream.h" #include "../serviceinterface/ServiceInterfaceStream.h"
#include "../tmtcservices/AcceptsTelemetryIF.h" #include "../tmtcservices/AcceptsTelemetryIF.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
Service1TelecommandVerification::Service1TelecommandVerification( Service1TelecommandVerification::Service1TelecommandVerification(
object_id_t objectId, uint16_t apid, uint8_t serviceId, object_id_t objectId, uint16_t apid, uint8_t serviceId,
object_id_t targetDestination): object_id_t targetDestination, uint16_t messageQueueDepth):
SystemObject(objectId), apid(apid), serviceId(serviceId), SystemObject(objectId), apid(apid), serviceId(serviceId),
targetDestination(targetDestination) { targetDestination(targetDestination) {
tmQueue = QueueFactory::instance()->createMessageQueue(); tmQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
} }
Service1TelecommandVerification::~Service1TelecommandVerification() {} Service1TelecommandVerification::~Service1TelecommandVerification() {}
@ -53,7 +51,7 @@ ReturnValue_t Service1TelecommandVerification::sendVerificationReport(
result = generateSuccessReport(message); result = generateSuccessReport(message);
} }
if(result != HasReturnvaluesIF::RETURN_OK){ if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Service1TelecommandVerification::initialize: " sif::error << "Service1TelecommandVerification::sendVerificationReport: "
"Sending verification packet failed !" << std::endl; "Sending verification packet failed !" << std::endl;
} }
return result; return result;

View File

@ -1,5 +1,5 @@
#ifndef MISSION_PUS_SERVICE1TELECOMMANDVERIFICATION_H_ #ifndef FSFW_PUS_SERVICE1TELECOMMANDVERIFICATION_H_
#define MISSION_PUS_SERVICE1TELECOMMANDVERIFICATION_H_ #define FSFW_PUS_SERVICE1TELECOMMANDVERIFICATION_H_
#include "../objectmanager/SystemObject.h" #include "../objectmanager/SystemObject.h"
#include "../returnvalues/HasReturnvaluesIF.h" #include "../returnvalues/HasReturnvaluesIF.h"
@ -44,14 +44,15 @@ public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_1; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_1;
Service1TelecommandVerification(object_id_t objectId, Service1TelecommandVerification(object_id_t objectId,
uint16_t apid, uint8_t serviceId, object_id_t targetDestination); uint16_t apid, uint8_t serviceId, object_id_t targetDestination,
uint16_t messageQueueDepth);
virtual ~Service1TelecommandVerification(); virtual ~Service1TelecommandVerification();
/** /**
* *
* @return ID of Verification Queue * @return ID of Verification Queue
*/ */
virtual MessageQueueId_t getVerificationQueue(); virtual MessageQueueId_t getVerificationQueue() override;
/** /**
* Performs the service periodically as specified in init_mission(). * Performs the service periodically as specified in init_mission().
@ -91,4 +92,4 @@ private:
}; };
}; };
#endif /* MISSION_PUS_SERVICE1TELECOMMANDVERIFICATION_H_ */ #endif /* FSFW_PUS_SERVICE1TELECOMMANDVERIFICATION_H_ */

View File

@ -21,8 +21,8 @@ Service2DeviceAccess::~Service2DeviceAccess() {}
ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) { ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) {
switch(static_cast<Subservice>(subservice)){ switch(static_cast<Subservice>(subservice)){
case Subservice::RAW_COMMANDING: case Subservice::COMMAND_RAW_COMMANDING:
case Subservice::TOGGLE_WIRETAPPING: case Subservice::COMMAND_TOGGLE_WIRETAPPING:
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
default: default:
sif::error << "Invalid Subservice" << std::endl; sif::error << "Invalid Subservice" << std::endl;
@ -39,8 +39,7 @@ ReturnValue_t Service2DeviceAccess::getMessageQueueAndObject(
SerializeAdapter::deSerialize(objectId, &tcData, SerializeAdapter::deSerialize(objectId, &tcData,
&tcDataLen, SerializeIF::Endianness::BIG); &tcDataLen, SerializeIF::Endianness::BIG);
ReturnValue_t result = checkInterfaceAndAcquireMessageQueue(id,objectId); return checkInterfaceAndAcquireMessageQueue(id,objectId);
return result;
} }
ReturnValue_t Service2DeviceAccess::checkInterfaceAndAcquireMessageQueue( ReturnValue_t Service2DeviceAccess::checkInterfaceAndAcquireMessageQueue(
@ -59,14 +58,12 @@ ReturnValue_t Service2DeviceAccess::prepareCommand(CommandMessage* message,
uint8_t subservice, const uint8_t* tcData, size_t tcDataLen, uint8_t subservice, const uint8_t* tcData, size_t tcDataLen,
uint32_t* state, object_id_t objectId) { uint32_t* state, object_id_t objectId) {
switch(static_cast<Subservice>(subservice)){ switch(static_cast<Subservice>(subservice)){
case Subservice::RAW_COMMANDING: { case Subservice::COMMAND_RAW_COMMANDING: {
return prepareRawCommand(dynamic_cast<CommandMessage*>(message), return prepareRawCommand(message, tcData, tcDataLen);
tcData, tcDataLen);
} }
break; break;
case Subservice::TOGGLE_WIRETAPPING: { case Subservice::COMMAND_TOGGLE_WIRETAPPING: {
return prepareWiretappingCommand(dynamic_cast<CommandMessage*>(message), return prepareWiretappingCommand(message, tcData, tcDataLen);
tcData, tcDataLen);
} }
break; break;
default: default:
@ -121,11 +118,11 @@ void Service2DeviceAccess::handleUnrequestedReply(CommandMessage* reply) {
switch(reply->getCommand()) { switch(reply->getCommand()) {
case DeviceHandlerMessage::REPLY_RAW_COMMAND: case DeviceHandlerMessage::REPLY_RAW_COMMAND:
sendWiretappingTm(reply, sendWiretappingTm(reply,
static_cast<uint8_t>(Subservice::WIRETAPPING_RAW_TC)); static_cast<uint8_t>(Subservice::REPLY_WIRETAPPING_RAW_TC));
break; break;
case DeviceHandlerMessage::REPLY_RAW_REPLY: case DeviceHandlerMessage::REPLY_RAW_REPLY:
sendWiretappingTm(reply, sendWiretappingTm(reply,
static_cast<uint8_t>(Subservice::RAW_REPLY)); static_cast<uint8_t>(Subservice::REPLY_RAW));
break; break;
default: default:
sif::error << "Unknown message in Service2DeviceAccess::" sif::error << "Unknown message in Service2DeviceAccess::"

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_SERVICE2DEVICEACCESS_H_ #ifndef FSFW_PUS_SERVICE2DEVICEACCESS_H_
#define FRAMEWORK_PUS_SERVICE2DEVICEACCESS_H_ #define FSFW_PUS_SERVICE2DEVICEACCESS_H_
#include "../objectmanager/SystemObjectIF.h" #include "../objectmanager/SystemObjectIF.h"
#include "../devicehandlers/AcceptsDeviceResponsesIF.h" #include "../devicehandlers/AcceptsDeviceResponsesIF.h"
@ -81,12 +81,16 @@ private:
const uint8_t* tcData, size_t tcDataLen); const uint8_t* tcData, size_t tcDataLen);
enum class Subservice { enum class Subservice {
RAW_COMMANDING = 128, //!< [EXPORT] : [COMMAND] Command in device native protocol //!< [EXPORT] : [COMMAND] Command in device native protocol
TOGGLE_WIRETAPPING = 129, //!< [EXPORT] : [COMMAND] Toggle wiretapping of raw communication COMMAND_RAW_COMMANDING = 128,
RAW_REPLY = 130, //!< [EXPORT] : [REPLY] Includes wiretapping TM and normal TM raw replies from device //!< [EXPORT] : [COMMAND] Toggle wiretapping of raw communication
WIRETAPPING_RAW_TC = 131 //!< [EXPORT] : [REPLY] Wiretapping packets of commands built by device handler COMMAND_TOGGLE_WIRETAPPING = 129,
//!< [EXPORT] : [REPLY] Includes wiretapping TM and normal TM raw replies from device
REPLY_RAW = 130,
//!< [EXPORT] : [REPLY] Wiretapping packets of commands built by device handler
REPLY_WIRETAPPING_RAW_TC = 131
}; };
}; };
#endif /* MISSION_PUS_DEVICE2DEVICECOMMANDING_H_ */ #endif /* FSFW_PUS_DEVICE2DEVICECOMMANDING_H_ */

View File

@ -8,10 +8,11 @@
Service5EventReporting::Service5EventReporting(object_id_t objectId, Service5EventReporting::Service5EventReporting(object_id_t objectId,
uint16_t apid, uint8_t serviceId, size_t maxNumberReportsPerCycle): uint16_t apid, uint8_t serviceId, size_t maxNumberReportsPerCycle,
uint32_t messageQueueDepth):
PusServiceBase(objectId, apid, serviceId), PusServiceBase(objectId, apid, serviceId),
maxNumberReportsPerCycle(maxNumberReportsPerCycle) { maxNumberReportsPerCycle(maxNumberReportsPerCycle) {
eventQueue = QueueFactory::instance()->createMessageQueue(); eventQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
} }
Service5EventReporting::~Service5EventReporting(){} Service5EventReporting::~Service5EventReporting(){}

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_SERVICE5EVENTREPORTING_H_ #ifndef FSFW_PUS_SERVICE5EVENTREPORTING_H_
#define FRAMEWORK_PUS_SERVICE5EVENTREPORTING_H_ #define FSFW_PUS_SERVICE5EVENTREPORTING_H_
#include "../tmtcservices/PusServiceBase.h" #include "../tmtcservices/PusServiceBase.h"
#include "../events/EventMessage.h" #include "../events/EventMessage.h"
@ -42,7 +42,8 @@ class Service5EventReporting: public PusServiceBase {
public: public:
Service5EventReporting(object_id_t objectId, uint16_t apid, Service5EventReporting(object_id_t objectId, uint16_t apid,
uint8_t serviceId, size_t maxNumberReportsPerCycle = 10); uint8_t serviceId, size_t maxNumberReportsPerCycle = 10,
uint32_t messageQueueDepth = 10);
virtual ~Service5EventReporting(); virtual ~Service5EventReporting();
/*** /***
@ -83,4 +84,4 @@ private:
ReturnValue_t generateEventReport(EventMessage message); ReturnValue_t generateEventReport(EventMessage message);
}; };
#endif /* MISSION_PUS_SERVICE5EVENTREPORTING_H_ */ #endif /* FSFW_PUS_SERVICE5EVENTREPORTING_H_ */

View File

@ -7,10 +7,10 @@
#include "../serialize/SerializeAdapter.h" #include "../serialize/SerializeAdapter.h"
#include "../serviceinterface/ServiceInterfaceStream.h" #include "../serviceinterface/ServiceInterfaceStream.h"
Service8FunctionManagement::Service8FunctionManagement(object_id_t object_id, Service8FunctionManagement::Service8FunctionManagement(object_id_t objectId,
uint16_t apid, uint8_t serviceId, uint8_t numParallelCommands, uint16_t apid, uint8_t serviceId, uint8_t numParallelCommands,
uint16_t commandTimeoutSeconds): uint16_t commandTimeoutSeconds):
CommandingServiceBase(object_id, apid, serviceId, numParallelCommands, CommandingServiceBase(objectId, apid, serviceId, numParallelCommands,
commandTimeoutSeconds) {} commandTimeoutSeconds) {}
Service8FunctionManagement::~Service8FunctionManagement() {} Service8FunctionManagement::~Service8FunctionManagement() {}
@ -19,7 +19,7 @@ Service8FunctionManagement::~Service8FunctionManagement() {}
ReturnValue_t Service8FunctionManagement::isValidSubservice( ReturnValue_t Service8FunctionManagement::isValidSubservice(
uint8_t subservice) { uint8_t subservice) {
switch(static_cast<Subservice>(subservice)) { switch(static_cast<Subservice>(subservice)) {
case Subservice::DIRECT_COMMANDING: case Subservice::COMMAND_DIRECT_COMMANDING:
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
default: default:
return AcceptsTelecommandsIF::INVALID_SUBSERVICE; return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
@ -131,7 +131,7 @@ ReturnValue_t Service8FunctionManagement::handleDataReply(
} }
DataReply dataReply(objectId, actionId, buffer, size); DataReply dataReply(objectId, actionId, buffer, size);
result = sendTmPacket(static_cast<uint8_t>( result = sendTmPacket(static_cast<uint8_t>(
Subservice::DIRECT_COMMANDING_DATA_REPLY), &dataReply); Subservice::REPLY_DIRECT_COMMANDING_DATA), &dataReply);
auto deletionResult = IPCStore->deleteData(storeId); auto deletionResult = IPCStore->deleteData(storeId);
if(deletionResult != HasReturnvaluesIF::RETURN_OK) { if(deletionResult != HasReturnvaluesIF::RETURN_OK) {

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_SERVICE8FUNCTIONMANAGEMENT_H_ #ifndef FSFW_PUS_SERVICE8FUNCTIONMANAGEMENT_H_
#define FRAMEWORK_PUS_SERVICE8FUNCTIONMANAGEMENT_H_ #define FSFW_PUS_SERVICE8FUNCTIONMANAGEMENT_H_
#include "../action/ActionMessage.h" #include "../action/ActionMessage.h"
#include "../tmtcservices/CommandingServiceBase.h" #include "../tmtcservices/CommandingServiceBase.h"
@ -52,8 +52,10 @@ protected:
private: private:
enum class Subservice { enum class Subservice {
DIRECT_COMMANDING = 128, //!< [EXPORT] : [COMMAND] Functional commanding //!< [EXPORT] : [COMMAND] Functional commanding
DIRECT_COMMANDING_DATA_REPLY = 130, //!< [EXPORT] : [REPLY] Data reply COMMAND_DIRECT_COMMANDING = 128,
//!< [EXPORT] : [REPLY] Data reply
REPLY_DIRECT_COMMANDING_DATA = 130,
}; };
ReturnValue_t checkInterfaceAndAcquireMessageQueue( ReturnValue_t checkInterfaceAndAcquireMessageQueue(
@ -64,4 +66,4 @@ private:
object_id_t objectId, ActionId_t actionId); object_id_t objectId, ActionId_t actionId);
}; };
#endif /* FRAMEWORK_PUS_SERVICE8FUNCTIONMANAGEMENT_H_ */ #endif /* FSFW_PUS_SERVICE8FUNCTIONMANAGEMENT_H_ */

View File

@ -1,3 +1,6 @@
#ifndef FSFW_PUS_SERVICEPACKETS_SERVICE1PACKETS_H_
#define FSFW_PUS_SERVICEPACKETS_SERVICE1PACKETS_H_
/** /**
* @defgroup spacepackets PUS Packet Definitions * @defgroup spacepackets PUS Packet Definitions
* This group contains all implemented TM or TM packages that are sent to * This group contains all implemented TM or TM packages that are sent to
@ -5,9 +8,6 @@
* packet structures in Mission Information Base (MIB). * packet structures in Mission Information Base (MIB).
*/ */
#ifndef MISSION_PUS_SERVICEPACKETS_SERVICE1PACKETS_H_
#define MISSION_PUS_SERVICEPACKETS_SERVICE1PACKETS_H_
#include "../../serialize/SerializeAdapter.h" #include "../../serialize/SerializeAdapter.h"
#include "../../tmtcservices/VerificationCodes.h" #include "../../tmtcservices/VerificationCodes.h"

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_SERVICEPACKETS_SERVICE200PACKETS_H_ #ifndef FSFW_PUS_SERVICEPACKETS_SERVICE200PACKETS_H_
#define FRAMEWORK_PUS_SERVICEPACKETS_SERVICE200PACKETS_H_ #define FSFW_PUS_SERVICEPACKETS_SERVICE200PACKETS_H_
#include "../../serialize/SerialLinkedListAdapter.h" #include "../../serialize/SerialLinkedListAdapter.h"
#include "../../modes/ModeMessage.h" #include "../../modes/ModeMessage.h"
@ -60,4 +60,4 @@ public:
SerializeElement<ReturnValue_t> reason; //!< [EXPORT] : [COMMENT] Reason the mode could not be reached SerializeElement<ReturnValue_t> reason; //!< [EXPORT] : [COMMENT] Reason the mode could not be reached
}; };
#endif /* FRAMEWORK_PUS_SERVICEPACKETS_SERVICE200PACKETS_H_ */ #endif /* FSFW_PUS_SERVICEPACKETS_SERVICE200PACKETS_H_ */

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_ #ifndef FSFW_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_
#define FRAMEWORK_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_ #define FSFW_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_
#include "../../action/ActionMessage.h" #include "../../action/ActionMessage.h"
#include "../../objectmanager/SystemObjectIF.h" #include "../../objectmanager/SystemObjectIF.h"
@ -73,4 +73,4 @@ public:
} }
}; };
#endif /* FRAMEWORK_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_ */ #endif /* FSFW_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_ */

View File

@ -1,5 +1,5 @@
#ifndef MISSION_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_ #ifndef FSFW_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_
#define MISSION_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_ #define FSFW_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_
#include "../../serialize/SerializeAdapter.h" #include "../../serialize/SerializeAdapter.h"
#include "../../tmtcservices/VerificationCodes.h" #include "../../tmtcservices/VerificationCodes.h"
@ -73,4 +73,4 @@ private:
}; };
#endif /* MISSION_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_ */ #endif /* FSFW_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_ */

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_PUS_SERVICEPACKETS_SERVICE8PACKETS_H_ #ifndef FSFW_PUS_SERVICEPACKETS_SERVICE8PACKETS_H_
#define FRAMEWORK_PUS_SERVICEPACKETS_SERVICE8PACKETS_H_ #define FSFW_PUS_SERVICEPACKETS_SERVICE8PACKETS_H_
#include "../../action/ActionMessage.h" #include "../../action/ActionMessage.h"
#include "../../objectmanager/SystemObjectIF.h" #include "../../objectmanager/SystemObjectIF.h"
@ -118,4 +118,4 @@ private:
}; };
#endif /* FRAMEWORK_PUS_SERVICEPACKETS_SERVICE8PACKETS_H_ */ #endif /* FSFW_PUS_SERVICEPACKETS_SERVICE8PACKETS_H_ */