Space Packet Parser CRC Check #41

Merged
meierj merged 3 commits from meier/space-packet-crc-check into main 2024-11-15 10:21:29 +01:00
45 changed files with 96 additions and 87 deletions
Showing only changes of commit a95ca7d4eb - Show all commits

View File

@ -17,7 +17,8 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner, uint32_t
if (hkOwner == nullptr) {
// Configuration error.
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner " << "invalid!" << std::endl;
sif::error << "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
<< "invalid!" << std::endl;
#else
sif::printError(
"LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
@ -186,8 +187,8 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t **buffer, size
SerializeAdapter::serialize(&currentPoolId, buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LocalPoolDataSetBase::serializeLocalPoolIds: " << "Serialization error!"
<< std::endl;
sif::warning << "LocalPoolDataSetBase::serializeLocalPoolIds: "
<< "Serialization error!" << std::endl;
#else
sif::printWarning(
"LocalPoolDataSetBase::serializeLocalPoolIds: "

View File

@ -17,8 +17,8 @@ LocalPoolObjectBase::LocalPoolObjectBase(lp_id_t poolId, HasLocalDataPoolIF* hkO
}
if (hkOwner == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "LocalPoolVar<T>::LocalPoolVar: The supplied pool " << "owner is a invalid!"
<< std::endl;
sif::error << "LocalPoolVar<T>::LocalPoolVar: The supplied pool "
<< "owner is a invalid!" << std::endl;
#endif
return;
}

View File

@ -243,8 +243,8 @@ bool DeviceHandlerFailureIsolation::isFdirInActionOrAreWeFaulty(EventMessage* ev
if (owner == nullptr) {
// Configuration error.
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "DeviceHandlerFailureIsolation::" << "isFdirInActionOrAreWeFaulty: Owner not set!"
<< std::endl;
sif::error << "DeviceHandlerFailureIsolation::"
<< "isFdirInActionOrAreWeFaulty: Owner not set!" << std::endl;
#endif
return false;
}

View File

@ -62,7 +62,8 @@ ReturnValue_t FailureIsolationBase::initialize() {
ObjectManager::instance()->get<ConfirmsFailuresIF>(faultTreeParent);
if (parentIF == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "FailureIsolationBase::intialize: Parent object " << "invalid" << std::endl;
sif::error << "FailureIsolationBase::intialize: Parent object "
<< "invalid" << std::endl;
sif::error << "Make sure it implements ConfirmsFailuresIF" << std::endl;
#else
sif::printError("FailureIsolationBase::intialize: Parent object invalid\n");

View File

@ -321,8 +321,8 @@ ReturnValue_t TcpTmTcServer::handleTcRingBufferData(size_t availableReadData) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
// Possible configuration error, too much data or/and data coming in too fast,
// requiring larger buffers
sif::warning << "TcpTmTcServer::handleServerOperation: Ring buffer reached " << "fill count"
<< std::endl;
sif::warning << "TcpTmTcServer::handleServerOperation: Ring buffer reached "
<< "fill count" << std::endl;
#else
sif::printWarning(
"TcpTmTcServer::handleServerOperation: Ring buffer reached "

View File

@ -49,8 +49,8 @@ ReturnValue_t Service20ParameterManagement::checkAndAcquireTargetID(object_id_t*
if (SerializeAdapter::deSerialize(objectIdToSet, &tcData, &tcDataLen,
SerializeIF::Endianness::BIG) != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Service20ParameterManagement::checkAndAcquireTargetID: " << "Invalid data."
<< std::endl;
sif::error << "Service20ParameterManagement::checkAndAcquireTargetID: "
<< "Invalid data." << std::endl;
#else
sif::printError(
"Service20ParameterManagement::"

View File

@ -196,8 +196,8 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
default:
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Service3Housekeeping::handleReply: Invalid reply with " << "reply command "
<< command << std::endl;
sif::warning << "Service3Housekeeping::handleReply: Invalid reply with "
<< "reply command " << command << std::endl;
#else
sif::printWarning(
"Service3Housekeeping::handleReply: Invalid reply with "

View File

@ -12,7 +12,8 @@ LocalPool::LocalPool(object_id_t setObjectId, const LocalPoolConfig& poolConfig,
spillsToHigherPools(spillsToHigherPools) {
if (NUMBER_OF_SUBPOOLS == 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "LocalPool::LocalPool: Passed pool configuration is " << " invalid!" << std::endl;
sif::error << "LocalPool::LocalPool: Passed pool configuration is "
<< " invalid!" << std::endl;
#endif
}
max_subpools_t index = 0;

View File

@ -38,9 +38,10 @@ ReturnValue_t Subsystem::checkSequence(HybridIterator<ModeListEntry> iter,
if (!existsModeTable(iter->getTableId())) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
using namespace std;
sif::warning << "Subsystem::checkSequence: " << "Object " << setfill('0') << hex << "0x"
<< setw(8) << getObjectId() << setw(0) << ": Mode table for mode ID " << "0x"
<< setw(8) << iter->getTableId() << " does not exist" << dec << endl;
sif::warning << "Subsystem::checkSequence: "
<< "Object " << setfill('0') << hex << "0x" << setw(8) << getObjectId()
<< setw(0) << ": Mode table for mode ID "
<< "0x" << setw(8) << iter->getTableId() << " does not exist" << dec << endl;
#endif
return TABLE_DOES_NOT_EXIST;
} else {

View File

@ -101,7 +101,8 @@ ReturnValue_t FixedSlotSequence::checkSequence() const {
if (result != returnvalue::OK) {
// Continue for now but print error output.
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "FixedSlotSequence::checkSequence:" << " Custom check failed!" << std::endl;
sif::error << "FixedSlotSequence::checkSequence:"
<< " Custom check failed!" << std::endl;
#endif
}
}

View File

@ -1,15 +1,13 @@
#include <fsfw/globalfunctions/CRC.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw/tmtcservices/SpacePacketParser.h>
#include <fsfw/globalfunctions/CRC.h>
#include <algorithm>
SpacePacketParser::SpacePacketParser(std::vector<uint16_t> validPacketIds)
: validPacketIds(validPacketIds) {}
void SpacePacketParser::enableCrcCheck() {
checkCrc = true;
}
void SpacePacketParser::enableCrcCheck() { checkCrc = true; }
ReturnValue_t SpacePacketParser::parseSpacePackets(const uint8_t** buffer, const size_t maxSize,
FoundPacketInfo& packetInfo) {

View File

@ -34,7 +34,8 @@ ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(unsigned int maxNumberOfPa
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "TmTcBridge::setMaxNumberOfPacketsStored: Number of "
<< "packets stored exceeds limits. " << "Keeping default value." << std::endl;
<< "packets stored exceeds limits. "
<< "Keeping default value." << std::endl;
#endif
return returnvalue::FAILED;
}
@ -78,13 +79,15 @@ ReturnValue_t TmTcBridge::performOperation(uint8_t operationCode) {
result = handleTc();
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "TmTcBridge::performOperation: " << "Error handling TCs" << std::endl;
sif::debug << "TmTcBridge::performOperation: "
<< "Error handling TCs" << std::endl;
#endif
}
result = handleTm();
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "TmTcBridge::performOperation: " << "Error handling TMs" << std::endl;
sif::debug << "TmTcBridge::performOperation: "
<< "Error handling TMs" << std::endl;
#endif
}
return result;

View File

@ -418,8 +418,8 @@ ReturnValue_t LinuxLibgpioIF::checkForConflictsById(gpioId_t gpioIdToCheck,
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LinuxLibgpioIF::checkForConflictsRegularGpio: Duplicate GPIO "
"definition with ID "
<< gpioIdToCheck << " detected. " << "Duplicate will be removed from map to add"
<< std::endl;
<< gpioIdToCheck << " detected. "
<< "Duplicate will be removed from map to add" << std::endl;
#else
sif::printWarning(
"LinuxLibgpioIF::checkForConflictsRegularGpio: Duplicate GPIO definition "

View File

@ -49,7 +49,8 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) {
if (not statusPair.second) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "I2cComIF::initializeInterface: Failed to insert device with address "
<< i2cAddress << "to I2C device " << "map" << std::endl;
<< i2cAddress << "to I2C device "
<< "map" << std::endl;
#endif
return returnvalue::FAILED;
}
@ -90,8 +91,8 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
auto i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
if (i2cDeviceMapIter == i2cDeviceMap.end()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "I2cComIF::sendMessage: i2cAddress of Cookie not " << "registered in i2cDeviceMap"
<< std::endl;
sif::error << "I2cComIF::sendMessage: i2cAddress of Cookie not "
<< "registered in i2cDeviceMap" << std::endl;
#endif
return returnvalue::FAILED;
}

View File

@ -197,8 +197,9 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
if (result == MutexIF::MUTEX_TIMEOUT) {
sif::error << "SpiComIF::sendMessage: Lock timeout" << std::endl;
} else {
sif::error << "SpiComIF::sendMessage: Failed to lock mutex with code " << "0x" << std::hex
<< std::setfill('0') << std::setw(4) << result << std::dec << std::endl;
sif::error << "SpiComIF::sendMessage: Failed to lock mutex with code "
<< "0x" << std::hex << std::setfill('0') << std::setw(4) << result << std::dec
<< std::endl;
}
#else
sif::printError("SpiComIF::sendMessage: Failed to lock mutex with code %d\n", result);
@ -306,8 +307,9 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) {
if (result != returnvalue::OK) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "SpiComIF::sendMessage: Failed to lock mutex with code " << "0x" << std::hex
<< std::setfill('0') << std::setw(4) << result << std::dec << std::endl;
sif::error << "SpiComIF::sendMessage: Failed to lock mutex with code "
<< "0x" << std::hex << std::setfill('0') << std::setw(4) << result << std::dec
<< std::endl;
#else
sif::printError("SpiComIF::sendMessage: Failed to lock mutex with code %d\n", result);
#endif