taken over some tweaks
This commit is contained in:
parent
d2f631a955
commit
8c88255873
@ -1,5 +1,5 @@
|
||||
#ifndef ACCEPTSTELEMETRYIF_H_
|
||||
#define ACCEPTSTELEMETRYIF_H_
|
||||
#ifndef FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_
|
||||
#define FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_
|
||||
|
||||
#include "../ipc/MessageQueueSenderIF.h"
|
||||
/**
|
||||
@ -20,7 +20,8 @@ public:
|
||||
* receiving message queue.
|
||||
* @return The telemetry reception message queue id.
|
||||
*/
|
||||
virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) = 0;
|
||||
virtual MessageQueueId_t getReportReceptionQueue(
|
||||
uint8_t virtualChannel = 0) = 0;
|
||||
};
|
||||
|
||||
#endif /* ACCEPTSTELEMETRYIF_H_ */
|
||||
#endif /* FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_ */
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef ACCEPTSVERIFICATIONMESSAGEIF_H_
|
||||
#define ACCEPTSVERIFICATIONMESSAGEIF_H_
|
||||
#ifndef FSFW_TMTCSERVICES_ACCEPTSVERIFICATIONMESSAGEIF_H_
|
||||
#define FSFW_TMTCSERVICES_ACCEPTSVERIFICATIONMESSAGEIF_H_
|
||||
|
||||
#include "../ipc/MessageQueueSenderIF.h"
|
||||
|
||||
@ -12,4 +12,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif /* ACCEPTSVERIFICATIONMESSAGEIF_H_ */
|
||||
#endif /* FSFW_TMTCSERVICES_ACCEPTSVERIFICATIONMESSAGEIF_H_ */
|
||||
|
9
tmtcservices/CMakeLists.txt
Normal file
9
tmtcservices/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CommandingServiceBase.cpp
|
||||
PusServiceBase.cpp
|
||||
PusVerificationReport.cpp
|
||||
TmTcBridge.cpp
|
||||
TmTcMessage.cpp
|
||||
VerificationReporter.cpp
|
||||
)
|
@ -1,9 +1,9 @@
|
||||
#include "../tcdistribution/PUSDistributorIF.h"
|
||||
#include "AcceptsTelemetryIF.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
|
||||
#include "CommandingServiceBase.h"
|
||||
#include "TmTcMessage.h"
|
||||
|
||||
#include "../tcdistribution/PUSDistributorIF.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
#include "../ipc/QueueFactory.h"
|
||||
#include "../tmtcpacket/pus/TcPacketStored.h"
|
||||
#include "../tmtcpacket/pus/TmPacketStored.h"
|
||||
@ -149,13 +149,13 @@ void CommandingServiceBase::handleCommandMessage(CommandMessage* reply) {
|
||||
default:
|
||||
if (isStep) {
|
||||
verificationReporter.sendFailureReport(
|
||||
TC_VERIFY::PROGRESS_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
tc_verification::PROGRESS_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
iter->second.tcInfo.tcPacketId, iter->second.tcInfo.tcSequenceControl,
|
||||
result, ++iter->second.step, failureParameter1,
|
||||
failureParameter2);
|
||||
} else {
|
||||
verificationReporter.sendFailureReport(
|
||||
TC_VERIFY::COMPLETION_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
tc_verification::COMPLETION_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
iter->second.tcInfo.tcPacketId, iter->second.tcInfo.tcSequenceControl,
|
||||
result, 0, failureParameter1, failureParameter2);
|
||||
}
|
||||
@ -184,13 +184,13 @@ void CommandingServiceBase::handleReplyHandlerResult(ReturnValue_t result,
|
||||
if (sendResult == RETURN_OK) {
|
||||
if (isStep and result != NO_STEP_MESSAGE) {
|
||||
verificationReporter.sendSuccessReport(
|
||||
TC_VERIFY::PROGRESS_SUCCESS,
|
||||
tc_verification::PROGRESS_SUCCESS,
|
||||
iter->second.tcInfo.ackFlags, iter->second.tcInfo.tcPacketId,
|
||||
iter->second.tcInfo.tcSequenceControl, ++iter->second.step);
|
||||
}
|
||||
else {
|
||||
verificationReporter.sendSuccessReport(
|
||||
TC_VERIFY::COMPLETION_SUCCESS,
|
||||
tc_verification::COMPLETION_SUCCESS,
|
||||
iter->second.tcInfo.ackFlags, iter->second.tcInfo.tcPacketId,
|
||||
iter->second.tcInfo.tcSequenceControl, 0);
|
||||
checkAndExecuteFifo(iter);
|
||||
@ -200,14 +200,14 @@ void CommandingServiceBase::handleReplyHandlerResult(ReturnValue_t result,
|
||||
if (isStep) {
|
||||
nextCommand->clearCommandMessage();
|
||||
verificationReporter.sendFailureReport(
|
||||
TC_VERIFY::PROGRESS_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
tc_verification::PROGRESS_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
iter->second.tcInfo.tcPacketId,
|
||||
iter->second.tcInfo.tcSequenceControl, sendResult,
|
||||
++iter->second.step, failureParameter1, failureParameter2);
|
||||
} else {
|
||||
nextCommand->clearCommandMessage();
|
||||
verificationReporter.sendFailureReport(
|
||||
TC_VERIFY::COMPLETION_FAILURE,
|
||||
tc_verification::COMPLETION_FAILURE,
|
||||
iter->second.tcInfo.ackFlags, iter->second.tcInfo.tcPacketId,
|
||||
iter->second.tcInfo.tcSequenceControl, sendResult, 0,
|
||||
failureParameter1, failureParameter2);
|
||||
@ -232,14 +232,14 @@ void CommandingServiceBase::handleRequestQueue() {
|
||||
|
||||
if ((packet.getSubService() == 0)
|
||||
or (isValidSubservice(packet.getSubService()) != RETURN_OK)) {
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, &packet, INVALID_SUBSERVICE);
|
||||
rejectPacket(tc_verification::START_FAILURE, &packet, INVALID_SUBSERVICE);
|
||||
continue;
|
||||
}
|
||||
result = getMessageQueueAndObject(packet.getSubService(),
|
||||
packet.getApplicationData(), packet.getApplicationDataSize(),
|
||||
&queue, &objectId);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, &packet, result);
|
||||
rejectPacket(tc_verification::START_FAILURE, &packet, result);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -250,14 +250,14 @@ void CommandingServiceBase::handleRequestQueue() {
|
||||
if (iter != commandMap.end()) {
|
||||
result = iter->second.fifo.insert(address);
|
||||
if (result != RETURN_OK) {
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, &packet, OBJECT_BUSY);
|
||||
rejectPacket(tc_verification::START_FAILURE, &packet, OBJECT_BUSY);
|
||||
}
|
||||
} else {
|
||||
CommandInfo newInfo; //Info will be set by startExecution if neccessary
|
||||
newInfo.objectId = objectId;
|
||||
result = commandMap.insert(queue, newInfo, &iter);
|
||||
if (result != RETURN_OK) {
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, &packet, BUSY);
|
||||
rejectPacket(tc_verification::START_FAILURE, &packet, BUSY);
|
||||
} else {
|
||||
startExecution(&packet, iter);
|
||||
}
|
||||
@ -338,10 +338,10 @@ void CommandingServiceBase::startExecution(TcPacketStored *storedPacket,
|
||||
iter->second.tcInfo.tcPacketId = storedPacket->getPacketId();
|
||||
iter->second.tcInfo.tcSequenceControl =
|
||||
storedPacket->getPacketSequenceControl();
|
||||
acceptPacket(TC_VERIFY::START_SUCCESS, storedPacket);
|
||||
acceptPacket(tc_verification::START_SUCCESS, storedPacket);
|
||||
} else {
|
||||
command.clearCommandMessage();
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, storedPacket, sendResult);
|
||||
rejectPacket(tc_verification::START_FAILURE, storedPacket, sendResult);
|
||||
checkAndExecuteFifo(iter);
|
||||
}
|
||||
break;
|
||||
@ -352,18 +352,18 @@ void CommandingServiceBase::startExecution(TcPacketStored *storedPacket,
|
||||
&command);
|
||||
}
|
||||
if (sendResult == RETURN_OK) {
|
||||
verificationReporter.sendSuccessReport(TC_VERIFY::START_SUCCESS,
|
||||
verificationReporter.sendSuccessReport(tc_verification::START_SUCCESS,
|
||||
storedPacket);
|
||||
acceptPacket(TC_VERIFY::COMPLETION_SUCCESS, storedPacket);
|
||||
acceptPacket(tc_verification::COMPLETION_SUCCESS, storedPacket);
|
||||
checkAndExecuteFifo(iter);
|
||||
} else {
|
||||
command.clearCommandMessage();
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, storedPacket, sendResult);
|
||||
rejectPacket(tc_verification::START_FAILURE, storedPacket, sendResult);
|
||||
checkAndExecuteFifo(iter);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
rejectPacket(TC_VERIFY::START_FAILURE, storedPacket, result);
|
||||
rejectPacket(tc_verification::START_FAILURE, storedPacket, result);
|
||||
checkAndExecuteFifo(iter);
|
||||
break;
|
||||
}
|
||||
@ -414,7 +414,7 @@ void CommandingServiceBase::checkTimeout() {
|
||||
for (iter = commandMap.begin(); iter != commandMap.end(); ++iter) {
|
||||
if ((iter->second.uptimeOfStart + (timeoutSeconds * 1000)) < uptime) {
|
||||
verificationReporter.sendFailureReport(
|
||||
TC_VERIFY::COMPLETION_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
tc_verification::COMPLETION_FAILURE, iter->second.tcInfo.ackFlags,
|
||||
iter->second.tcInfo.tcPacketId, iter->second.tcInfo.tcSequenceControl,
|
||||
TIMEOUT);
|
||||
checkAndExecuteFifo(iter);
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include "PusServiceBase.h"
|
||||
#include "AcceptsTelemetryIF.h"
|
||||
#include "PusVerificationReport.h"
|
||||
#include "TmTcMessage.h"
|
||||
|
||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "../tcdistribution/PUSDistributorIF.h"
|
||||
#include "../tmtcservices/AcceptsTelemetryIF.h"
|
||||
#include "../tmtcservices/PusServiceBase.h"
|
||||
#include "../tmtcservices/PusVerificationReport.h"
|
||||
#include "../tmtcservices/TmTcMessage.h"
|
||||
#include "../ipc/QueueFactory.h"
|
||||
|
||||
object_id_t PusServiceBase::packetSource = 0;
|
||||
@ -60,11 +61,11 @@ void PusServiceBase::handleRequestQueue() {
|
||||
// ": handleRequest returned: " << (int)return_code << std::endl;
|
||||
if (result == RETURN_OK) {
|
||||
this->verifyReporter.sendSuccessReport(
|
||||
TC_VERIFY::COMPLETION_SUCCESS, &this->currentPacket);
|
||||
tc_verification::COMPLETION_SUCCESS, &this->currentPacket);
|
||||
}
|
||||
else {
|
||||
this->verifyReporter.sendFailureReport(
|
||||
TC_VERIFY::COMPLETION_FAILURE, &this->currentPacket,
|
||||
tc_verification::COMPLETION_FAILURE, &this->currentPacket,
|
||||
result, 0, errorParameter1, errorParameter2);
|
||||
}
|
||||
this->currentPacket.deletePacket();
|
||||
|
@ -1,14 +1,15 @@
|
||||
#ifndef FRAMEWORK_TMTCSERVICES_PUSSERVICEBASE_H_
|
||||
#define FRAMEWORK_TMTCSERVICES_PUSSERVICEBASE_H_
|
||||
#ifndef FSFW_TMTCSERVICES_PUSSERVICEBASE_H_
|
||||
#define FSFW_TMTCSERVICES_PUSSERVICEBASE_H_
|
||||
|
||||
#include "AcceptsTelecommandsIF.h"
|
||||
#include "VerificationCodes.h"
|
||||
#include "VerificationReporter.h"
|
||||
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
#include "../objectmanager/SystemObject.h"
|
||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||
#include "../tasks/ExecutableObjectIF.h"
|
||||
#include "../tmtcpacket/pus/TcPacketStored.h"
|
||||
#include "../tmtcservices/AcceptsTelecommandsIF.h"
|
||||
#include "../tmtcservices/VerificationCodes.h"
|
||||
#include "../tmtcservices/VerificationReporter.h"
|
||||
#include "../ipc/MessageQueueIF.h"
|
||||
|
||||
namespace Factory{
|
||||
@ -156,4 +157,4 @@ private:
|
||||
void handleRequestQueue();
|
||||
};
|
||||
|
||||
#endif /* PUSSERVICEBASE_H_ */
|
||||
#endif /* FSFW_TMTCSERVICES_PUSSERVICEBASE_H_ */
|
||||
|
@ -4,31 +4,6 @@
|
||||
PusVerificationMessage::PusVerificationMessage() {
|
||||
}
|
||||
|
||||
//PusVerificationMessage::PusVerificationMessage(uint8_t set_report_id,
|
||||
// TcPacketBase* current_packet, ReturnValue_t set_error_code,
|
||||
// uint8_t set_step, uint32_t parameter1, uint32_t parameter2) {
|
||||
// uint8_t ackFlags = current_packet->getAcknowledgeFlags();
|
||||
// uint16_t tcPacketId = current_packet->getPacketId();
|
||||
// uint16_t tcSequenceControl = current_packet->getPacketSequenceControl();
|
||||
// uint8_t* data = this->getBuffer();
|
||||
// data[messageSize] = set_report_id;
|
||||
// messageSize += sizeof(set_report_id);
|
||||
// data[messageSize] = ackFlags;
|
||||
// messageSize += sizeof(ackFlags);
|
||||
// memcpy(&data[messageSize], &tcPacketId, sizeof(tcPacketId));
|
||||
// messageSize += sizeof(tcPacketId);
|
||||
// memcpy(&data[messageSize], &tcSequenceControl, sizeof(tcSequenceControl));
|
||||
// messageSize += sizeof(tcSequenceControl);
|
||||
// data[messageSize] = set_step;
|
||||
// messageSize += sizeof(set_step);
|
||||
// memcpy(&data[messageSize], &set_error_code, sizeof(set_error_code));
|
||||
// messageSize += sizeof(set_error_code);
|
||||
// memcpy(&data[messageSize], ¶meter1, sizeof(parameter1));
|
||||
// messageSize += sizeof(parameter1);
|
||||
// memcpy(&data[messageSize], ¶meter2, sizeof(parameter2));
|
||||
// messageSize += sizeof(parameter2);
|
||||
//}
|
||||
|
||||
PusVerificationMessage::PusVerificationMessage(uint8_t set_report_id,
|
||||
uint8_t ackFlags, uint16_t tcPacketId, uint16_t tcSequenceControl,
|
||||
ReturnValue_t set_error_code, uint8_t set_step, uint32_t parameter1,
|
||||
|
@ -1,13 +1,7 @@
|
||||
/**
|
||||
* @file ServiceTypes.h
|
||||
* @brief This file defines the ServiceTypes class.
|
||||
* @date 11.04.2013
|
||||
* @author baetz
|
||||
*/
|
||||
|
||||
#ifndef SERVICETYPES_H_
|
||||
#define SERVICETYPES_H_
|
||||
|
||||
// SHOULDDO: This is a duplication of existing configuration structures. Delete it?
|
||||
namespace SERVICE {
|
||||
enum ServiceTypes {
|
||||
TELECOMMAND_VERIFICATION = 1,
|
||||
|
@ -1,12 +1,6 @@
|
||||
/**
|
||||
* @file SourceSequenceCounter.h
|
||||
* @brief This file defines the SourceSequenceCounter class.
|
||||
* @date 04.02.2013
|
||||
* @author baetz
|
||||
*/
|
||||
#ifndef FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_
|
||||
#define FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_
|
||||
|
||||
#ifndef SOURCESEQUENCECOUNTER_H_
|
||||
#define SOURCESEQUENCECOUNTER_H_
|
||||
#include "../tmtcpacket/SpacePacketBase.h"
|
||||
|
||||
class SourceSequenceCounter {
|
||||
@ -27,4 +21,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif /* SOURCESEQUENCECOUNTER_H_ */
|
||||
#endif /* FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_ */
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "../tmtcservices/TmTcBridge.h"
|
||||
#include "TmTcBridge.h"
|
||||
|
||||
#include "../ipc/QueueFactory.h"
|
||||
#include "../tmtcservices/AcceptsTelecommandsIF.h"
|
||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "../globalfunctions/arrayprinter.h"
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
#ifndef FRAMEWORK_TMTCSERVICES_TMTCBRIDGE_H_
|
||||
#define FRAMEWORK_TMTCSERVICES_TMTCBRIDGE_H_
|
||||
#ifndef FSFW_TMTCSERVICES_TMTCBRIDGE_H_
|
||||
#define FSFW_TMTCSERVICES_TMTCBRIDGE_H_
|
||||
|
||||
#include "AcceptsTelemetryIF.h"
|
||||
#include "AcceptsTelecommandsIF.h"
|
||||
|
||||
#include "../objectmanager/SystemObject.h"
|
||||
#include "../tmtcservices/AcceptsTelemetryIF.h"
|
||||
#include "../tasks/ExecutableObjectIF.h"
|
||||
#include "../ipc/MessageQueueIF.h"
|
||||
#include "../storagemanager/StorageManagerIF.h"
|
||||
#include "../tmtcservices/AcceptsTelecommandsIF.h"
|
||||
#include "../container/DynamicFIFO.h"
|
||||
#include "../tmtcservices/TmTcMessage.h"
|
||||
|
||||
@ -159,4 +159,4 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#endif /* FRAMEWORK_TMTCSERVICES_TMTCBRIDGE_H_ */
|
||||
#endif /* FSFW_TMTCSERVICES_TMTCBRIDGE_H_ */
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "../tmtcservices/TmTcMessage.h"
|
||||
#include <string.h>
|
||||
#include "TmTcMessage.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
||||
TmTcMessage::TmTcMessage() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef VERIFICATIONCODES_H_
|
||||
#define VERIFICATIONCODES_H_
|
||||
|
||||
namespace TC_VERIFY {
|
||||
namespace tc_verification {
|
||||
|
||||
enum verification_flags {
|
||||
NONE = 0b0000,
|
||||
|
Loading…
Reference in New Issue
Block a user