From 5f27fe63922a1a9458714de75f8cb7bec93abd46 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 14 Jun 2021 15:06:26 +0200 Subject: [PATCH 1/3] indentation --- memory/GenericFileSystemMessage.cpp | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/memory/GenericFileSystemMessage.cpp b/memory/GenericFileSystemMessage.cpp index 005f4ede..b0e1a9ec 100644 --- a/memory/GenericFileSystemMessage.cpp +++ b/memory/GenericFileSystemMessage.cpp @@ -134,28 +134,28 @@ bool GenericFileSystemMessage::getReadReply(const CommandMessage *message, } ReturnValue_t GenericFileSystemMessage::clear(CommandMessage* message) { - switch(message->getCommand()) { - case(CMD_CREATE_FILE): - case(CMD_DELETE_FILE): - case(CMD_CREATE_DIRECTORY): - case(CMD_REPORT_FILE_ATTRIBUTES): - case(REPLY_REPORT_FILE_ATTRIBUTES): - case(CMD_LOCK_FILE): - case(CMD_UNLOCK_FILE): - case(CMD_COPY_FILE): - case(REPLY_READ_FROM_FILE): - case(CMD_READ_FROM_FILE): - case(CMD_APPEND_TO_FILE): - case(CMD_FINISH_APPEND_TO_FILE): - case(REPLY_READ_FINISHED_STOP): - case(REPLY_FINISH_APPEND): { - store_address_t storeId = GenericFileSystemMessage::getStoreId(message); - auto ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); - if(ipcStore == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; - } - return ipcStore->deleteData(storeId); - } - } + switch(message->getCommand()) { + case(CMD_CREATE_FILE): + case(CMD_DELETE_FILE): + case(CMD_CREATE_DIRECTORY): + case(CMD_REPORT_FILE_ATTRIBUTES): + case(REPLY_REPORT_FILE_ATTRIBUTES): + case(CMD_LOCK_FILE): + case(CMD_UNLOCK_FILE): + case(CMD_COPY_FILE): + case(REPLY_READ_FROM_FILE): + case(CMD_READ_FROM_FILE): + case(CMD_APPEND_TO_FILE): + case(CMD_FINISH_APPEND_TO_FILE): + case(REPLY_READ_FINISHED_STOP): + case(REPLY_FINISH_APPEND): { + store_address_t storeId = GenericFileSystemMessage::getStoreId(message); + auto ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); + if(ipcStore == nullptr) { + return HasReturnvaluesIF::RETURN_FAILED; + } + return ipcStore->deleteData(storeId); + } + } return HasReturnvaluesIF::RETURN_OK; } From 105a498b93d563126cf25cb373fa337915c09436 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 14 Jun 2021 15:24:26 +0200 Subject: [PATCH 2/3] added way to set source ID --- tmtcpacket/pus/tc/TcPacketPus.cpp | 8 +++++++- tmtcpacket/pus/tc/TcPacketPus.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tmtcpacket/pus/tc/TcPacketPus.cpp b/tmtcpacket/pus/tc/TcPacketPus.cpp index 334da4e7..d2b19206 100644 --- a/tmtcpacket/pus/tc/TcPacketPus.cpp +++ b/tmtcpacket/pus/tc/TcPacketPus.cpp @@ -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 { diff --git a/tmtcpacket/pus/tc/TcPacketPus.h b/tmtcpacket/pus/tc/TcPacketPus.h index b50b868d..7a28a957 100644 --- a/tmtcpacket/pus/tc/TcPacketPus.h +++ b/tmtcpacket/pus/tc/TcPacketPus.h @@ -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 From b52644dd2af39901f442ac30833f27cbddc4b9df Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 21 Jun 2021 14:50:19 +0200 Subject: [PATCH 3/3] tiny form fix --- osal/linux/PeriodicPosixTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osal/linux/PeriodicPosixTask.cpp b/osal/linux/PeriodicPosixTask.cpp index 1cba22ee..c0152bec 100644 --- a/osal/linux/PeriodicPosixTask.cpp +++ b/osal/linux/PeriodicPosixTask.cpp @@ -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;