update tmtcservices module
This commit is contained in:
parent
eb00c50950
commit
96e56ddc64
|
@ -251,7 +251,7 @@ void CommandingServiceBase::handleRequestQueue() {
|
||||||
for (result = requestQueue->receiveMessage(&message); result == RETURN_OK;
|
for (result = requestQueue->receiveMessage(&message); result == RETURN_OK;
|
||||||
result = requestQueue->receiveMessage(&message)) {
|
result = requestQueue->receiveMessage(&message)) {
|
||||||
address = message.getStorageId();
|
address = message.getStorageId();
|
||||||
packet.setStoreAddress(address);
|
packet.setStoreAddress(address, &packet);
|
||||||
|
|
||||||
if ((packet.getSubService() == 0)
|
if ((packet.getSubService() == 0)
|
||||||
or (isValidSubservice(packet.getSubService()) != RETURN_OK)) {
|
or (isValidSubservice(packet.getSubService()) != RETURN_OK)) {
|
||||||
|
@ -351,18 +351,18 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CommandingServiceBase::startExecution(TcPacketStoredBase *storedPacket,
|
void CommandingServiceBase::startExecution(TcPacketStoredPus* storedPacket,
|
||||||
CommandMapIter iter) {
|
CommandMapIter iter) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
CommandMessage command;
|
CommandMessage command;
|
||||||
TcPacketBase* tcPacketBase = storedPacket->getPacketBase();
|
//TcPacketPusBase* tcPacketBase = storedPacket->getPacketBase();
|
||||||
if(tcPacketBase == nullptr) {
|
if(storedPacket == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
iter->second.subservice = tcPacketBase->getSubService();
|
iter->second.subservice = storedPacket->getSubService();
|
||||||
result = prepareCommand(&command, iter->second.subservice,
|
result = prepareCommand(&command, iter->second.subservice,
|
||||||
tcPacketBase->getApplicationData(),
|
storedPacket->getApplicationData(),
|
||||||
tcPacketBase->getApplicationDataSize(), &iter->second.state,
|
storedPacket->getApplicationDataSize(), &iter->second.state,
|
||||||
iter->second.objectId);
|
iter->second.objectId);
|
||||||
|
|
||||||
ReturnValue_t sendResult = RETURN_OK;
|
ReturnValue_t sendResult = RETURN_OK;
|
||||||
|
@ -375,12 +375,12 @@ void CommandingServiceBase::startExecution(TcPacketStoredBase *storedPacket,
|
||||||
if (sendResult == RETURN_OK) {
|
if (sendResult == RETURN_OK) {
|
||||||
Clock::getUptime(&iter->second.uptimeOfStart);
|
Clock::getUptime(&iter->second.uptimeOfStart);
|
||||||
iter->second.step = 0;
|
iter->second.step = 0;
|
||||||
iter->second.subservice = tcPacketBase->getSubService();
|
iter->second.subservice = storedPacket->getSubService();
|
||||||
iter->second.command = command.getCommand();
|
iter->second.command = command.getCommand();
|
||||||
iter->second.tcInfo.ackFlags = tcPacketBase->getAcknowledgeFlags();
|
iter->second.tcInfo.ackFlags = storedPacket->getAcknowledgeFlags();
|
||||||
iter->second.tcInfo.tcPacketId = tcPacketBase->getPacketId();
|
iter->second.tcInfo.tcPacketId = storedPacket->getPacketId();
|
||||||
iter->second.tcInfo.tcSequenceControl =
|
iter->second.tcInfo.tcSequenceControl =
|
||||||
tcPacketBase->getPacketSequenceControl();
|
storedPacket->getPacketSequenceControl();
|
||||||
acceptPacket(tc_verification::START_SUCCESS, storedPacket);
|
acceptPacket(tc_verification::START_SUCCESS, storedPacket);
|
||||||
} else {
|
} else {
|
||||||
command.clearCommandMessage();
|
command.clearCommandMessage();
|
||||||
|
@ -414,15 +414,16 @@ void CommandingServiceBase::startExecution(TcPacketStoredBase *storedPacket,
|
||||||
|
|
||||||
|
|
||||||
void CommandingServiceBase::rejectPacket(uint8_t reportId,
|
void CommandingServiceBase::rejectPacket(uint8_t reportId,
|
||||||
TcPacketStoredBase* packet, ReturnValue_t errorCode) {
|
TcPacketStoredPus* packet, ReturnValue_t errorCode) {
|
||||||
verificationReporter.sendFailureReport(reportId, packet->getPacketBase(), errorCode);
|
verificationReporter.sendFailureReport(reportId, dynamic_cast<TcPacketPusBase*>(packet),
|
||||||
|
errorCode);
|
||||||
packet->deletePacket();
|
packet->deletePacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CommandingServiceBase::acceptPacket(uint8_t reportId,
|
void CommandingServiceBase::acceptPacket(uint8_t reportId,
|
||||||
TcPacketStoredBase* packet) {
|
TcPacketStoredPus* packet) {
|
||||||
verificationReporter.sendSuccessReport(reportId, packet->getPacketBase());
|
verificationReporter.sendSuccessReport(reportId, dynamic_cast<TcPacketPusBase*>(packet));
|
||||||
packet->deletePacket();
|
packet->deletePacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
#include "fsfw/container/FIFO.h"
|
#include "fsfw/container/FIFO.h"
|
||||||
#include "fsfw/serialize/SerializeIF.h"
|
#include "fsfw/serialize/SerializeIF.h"
|
||||||
|
|
||||||
class TcPacketStored;
|
|
||||||
class TcPacketStoredBase;
|
class TcPacketStoredBase;
|
||||||
|
class TcPacketStoredPus;
|
||||||
|
|
||||||
namespace Factory{
|
namespace Factory{
|
||||||
void setStaticFrameworkObjectIds();
|
void setStaticFrameworkObjectIds();
|
||||||
|
@ -351,12 +351,12 @@ private:
|
||||||
*/
|
*/
|
||||||
void handleRequestQueue();
|
void handleRequestQueue();
|
||||||
|
|
||||||
void rejectPacket(uint8_t reportId, TcPacketStoredBase* packet,
|
void rejectPacket(uint8_t reportId, TcPacketStoredPus* packet,
|
||||||
ReturnValue_t errorCode);
|
ReturnValue_t errorCode);
|
||||||
|
|
||||||
void acceptPacket(uint8_t reportId, TcPacketStoredBase* packet);
|
void acceptPacket(uint8_t reportId, TcPacketStoredPus* packet);
|
||||||
|
|
||||||
void startExecution(TcPacketStoredBase *storedPacket, CommandMapIter iter);
|
void startExecution(TcPacketStoredPus* storedPacket, CommandMapIter iter);
|
||||||
|
|
||||||
void handleCommandMessage(CommandMessage* reply);
|
void handleCommandMessage(CommandMessage* reply);
|
||||||
void handleReplyHandlerResult(ReturnValue_t result, CommandMapIter iter,
|
void handleReplyHandlerResult(ReturnValue_t result, CommandMapIter iter,
|
||||||
|
|
|
@ -56,7 +56,7 @@ void PusServiceBase::handleRequestQueue() {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (status == RETURN_OK) {
|
if (status == RETURN_OK) {
|
||||||
this->currentPacket.setStoreAddress(message.getStorageId());
|
this->currentPacket.setStoreAddress(message.getStorageId(), ¤tPacket);
|
||||||
//info << "Service " << (uint16_t) this->serviceId <<
|
//info << "Service " << (uint16_t) this->serviceId <<
|
||||||
// ": new packet!" << std::endl;
|
// ": new packet!" << std::endl;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "VerificationCodes.h"
|
#include "VerificationCodes.h"
|
||||||
|
|
||||||
#include "fsfw/ipc/MessageQueueMessage.h"
|
#include "fsfw/ipc/MessageQueueMessage.h"
|
||||||
#include "fsfw/tmtcpacket/pus/tc/TcPacketBase.h"
|
#include "fsfw/tmtcpacket/pus/tc/TcPacketPusBase.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||||
|
|
||||||
class PusVerificationMessage: public MessageQueueMessage {
|
class PusVerificationMessage: public MessageQueueMessage {
|
||||||
|
|
|
@ -17,7 +17,7 @@ VerificationReporter::VerificationReporter() :
|
||||||
VerificationReporter::~VerificationReporter() {}
|
VerificationReporter::~VerificationReporter() {}
|
||||||
|
|
||||||
void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
||||||
TcPacketBase* currentPacket, uint8_t set_step) {
|
TcPacketPusBase* currentPacket, uint8_t set_step) {
|
||||||
if (acknowledgeQueue == MessageQueueIF::NO_QUEUE) {
|
if (acknowledgeQueue == MessageQueueIF::NO_QUEUE) {
|
||||||
this->initialize();
|
this->initialize();
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
void VerificationReporter::sendFailureReport(uint8_t report_id,
|
void VerificationReporter::sendFailureReport(uint8_t report_id,
|
||||||
TcPacketBase* currentPacket, ReturnValue_t error_code, uint8_t step,
|
TcPacketPusBase* currentPacket, ReturnValue_t error_code, uint8_t step,
|
||||||
uint32_t parameter1, uint32_t parameter2) {
|
uint32_t parameter1, uint32_t parameter2) {
|
||||||
if (acknowledgeQueue == MessageQueueIF::NO_QUEUE) {
|
if (acknowledgeQueue == MessageQueueIF::NO_QUEUE) {
|
||||||
this->initialize();
|
this->initialize();
|
||||||
|
|
|
@ -25,13 +25,13 @@ public:
|
||||||
VerificationReporter();
|
VerificationReporter();
|
||||||
virtual ~VerificationReporter();
|
virtual ~VerificationReporter();
|
||||||
|
|
||||||
void sendSuccessReport( uint8_t set_report_id, TcPacketBase* current_packet,
|
void sendSuccessReport( uint8_t set_report_id, TcPacketPusBase* current_packet,
|
||||||
uint8_t set_step = 0 );
|
uint8_t set_step = 0 );
|
||||||
void sendSuccessReport(uint8_t set_report_id, uint8_t ackFlags,
|
void sendSuccessReport(uint8_t set_report_id, uint8_t ackFlags,
|
||||||
uint16_t tcPacketId, uint16_t tcSequenceControl,
|
uint16_t tcPacketId, uint16_t tcSequenceControl,
|
||||||
uint8_t set_step = 0);
|
uint8_t set_step = 0);
|
||||||
|
|
||||||
void sendFailureReport( uint8_t report_id, TcPacketBase* current_packet,
|
void sendFailureReport( uint8_t report_id, TcPacketPusBase* current_packet,
|
||||||
ReturnValue_t error_code = 0,
|
ReturnValue_t error_code = 0,
|
||||||
uint8_t step = 0, uint32_t parameter1 = 0,
|
uint8_t step = 0, uint32_t parameter1 = 0,
|
||||||
uint32_t parameter2 = 0 );
|
uint32_t parameter2 = 0 );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user