Merge remote-tracking branch 'origin/development' into gaisser_countdown_timer

This commit is contained in:
Steffen Gaisser 2021-09-27 20:01:01 +02:00
commit 322c14d4bb
4 changed files with 11 additions and 3 deletions

View File

@ -32,7 +32,7 @@ ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object) {
sif::error << "PeriodicTask::addComponent: Invalid object. Make sure"
<< " it implements ExecutableObjectIF!" << std::endl;
#else
sif::printError("PeriodicTask::addComponent: Invalid object. Make sure it"
sif::printError("PeriodicTask::addComponent: Invalid object. Make sure it "
"implements ExecutableObjectIF!\n");
#endif
return HasReturnvaluesIF::RETURN_FAILED;

View File

@ -8,7 +8,7 @@ TcPacketPus::TcPacketPus(const uint8_t *setData): TcPacketBase(setData) {
}
void TcPacketPus::initializeTcPacket(uint16_t apid, uint16_t sequenceCount,
uint8_t ack, uint8_t service, uint8_t subservice) {
uint8_t ack, uint8_t service, uint8_t subservice, uint16_t sourceId) {
initSpacePacketHeader(true, true, apid, sequenceCount);
std::memset(&tcData->dataField, 0, sizeof(tcData->dataField));
setPacketDataLength(sizeof(PUSTcDataFieldHeader) + CRC_SIZE - 1);
@ -18,6 +18,12 @@ void TcPacketPus::initializeTcPacket(uint16_t apid, uint16_t sequenceCount,
tcData->dataField.versionTypeAck |= (ack & 0x0F);
tcData->dataField.serviceType = service;
tcData->dataField.serviceSubtype = subservice;
#if FSFW_USE_PUS_C_TELECOMMANDS == 1
tcData->dataField.sourceIdH = (sourceId >> 8) | 0xff;
tcData->dataField.sourceIdL = sourceId & 0xff;
#else
tcData->dataField.sourceId = sourceId;
#endif
}
uint8_t TcPacketPus::getService() const {

View File

@ -75,7 +75,7 @@ protected:
* @param subservice PUS Subservice
*/
void initializeTcPacket(uint16_t apid, uint16_t sequenceCount, uint8_t ack,
uint8_t service, uint8_t subservice);
uint8_t service, uint8_t subservice, uint16_t sourceId = 0);
/**
* A pointer to a structure which defines the data structure of

View File

@ -1,5 +1,7 @@
#include "TcPacketStoredPus.h"
#include "../../../serviceinterface/ServiceInterface.h"
#include <cstring>
TcPacketStoredPus::TcPacketStoredPus(uint16_t apid, uint8_t service,