From 7e394ea15fd199d9adcef11b779e12bb747cdcaa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Jan 2021 13:18:18 +0100 Subject: [PATCH] replaced all fsfw:: by sif:: for printouts --- datapool/PoolEntry.cpp | 4 +- datapoollocal/HasLocalDataPoolIF.h | 2 +- datapoollocal/LocalDataPoolManager.cpp | 54 +++++++++---------- datapoollocal/LocalDataPoolManager.h | 6 +-- datapoollocal/LocalPoolDataSetBase.cpp | 6 +-- datapoollocal/LocalPoolObjectBase.cpp | 2 +- datapoollocal/LocalPoolVector.tpp | 4 +- devicehandlers/DeviceHandlerBase.cpp | 36 ++++++------- devicehandlers/DeviceHandlerBase.h | 2 +- globalfunctions/arrayprinter.cpp | 2 +- osal/linux/BinarySemaphore.cpp | 4 +- osal/linux/MessageQueue.cpp | 2 +- osal/linux/PosixThread.cpp | 4 +- osal/linux/TmTcUnixUdpBridge.cpp | 2 +- serviceinterface/ServiceInterfaceBuffer.cpp | 10 ++-- unittest/internal/UnittDefinitions.cpp | 2 +- .../user/unittest/core/CatchDefinitions.cpp | 2 +- 17 files changed, 72 insertions(+), 72 deletions(-) diff --git a/datapool/PoolEntry.cpp b/datapool/PoolEntry.cpp index 1e99a28c4..a5867222b 100644 --- a/datapool/PoolEntry.cpp +++ b/datapool/PoolEntry.cpp @@ -73,8 +73,8 @@ void PoolEntry::print() { sif::info << "PoolEntry information." << std::endl; sif::info << "PoolEntry validity: " << validString << std::endl; #else - fsfw::printInfo("PoolEntry information.\n"); - fsfw::printInfo("PoolEntry validity: %s\n", validString); + sif::printInfo("PoolEntry information.\n"); + sif::printInfo("PoolEntry validity: %s\n", validString); #endif arrayprinter::print(reinterpret_cast(address), getByteSize()); } diff --git a/datapoollocal/HasLocalDataPoolIF.h b/datapoollocal/HasLocalDataPoolIF.h index 07c6882be..3aa9a554a 100644 --- a/datapoollocal/HasLocalDataPoolIF.h +++ b/datapoollocal/HasLocalDataPoolIF.h @@ -94,7 +94,7 @@ public: sif::warning << "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden" << ". Returning nullptr!" << std::endl; #else - fsfw::printWarning("HasLocalDataPoolIF::getPoolObjectHandle: " + sif::printWarning("HasLocalDataPoolIF::getPoolObjectHandle: " "Not overriden. Returning nullptr!\n"); #endif return nullptr; diff --git a/datapoollocal/LocalDataPoolManager.cpp b/datapoollocal/LocalDataPoolManager.cpp index 2a0ec923c..0c5e6d70d 100644 --- a/datapoollocal/LocalDataPoolManager.cpp +++ b/datapoollocal/LocalDataPoolManager.cpp @@ -20,7 +20,7 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner, MessageQueueIF* queueToUse, bool appendValidityBuffer): appendValidityBuffer(appendValidityBuffer) { if(owner == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "LocalDataPoolManager", HasReturnvaluesIF::RETURN_FAILED, "Invalid supplied owner"); return; @@ -28,7 +28,7 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner, this->owner = owner; mutex = MutexFactory::instance()->createMutex(); if(mutex == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "LocalDataPoolManager", HasReturnvaluesIF::RETURN_FAILED, "Could not create mutex"); } @@ -41,7 +41,7 @@ LocalDataPoolManager::~LocalDataPoolManager() {} ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) { if(queueToUse == nullptr) { // error, all destinations invalid - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", QUEUE_OR_DESTINATION_INVALID); } hkQueue = queueToUse; @@ -49,7 +49,7 @@ ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) { ipcStore = objectManager->get(objects::IPC_STORE); if(ipcStore == nullptr) { // error, all destinations invalid - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", HasReturnvaluesIF::RETURN_FAILED, "Could not set IPC store."); return HasReturnvaluesIF::RETURN_FAILED; @@ -63,7 +63,7 @@ ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) { hkDestinationId = hkPacketReceiver->getHkQueue(); } else { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", QUEUE_OR_DESTINATION_INVALID); return QUEUE_OR_DESTINATION_INVALID; } @@ -88,7 +88,7 @@ ReturnValue_t LocalDataPoolManager::initializeHousekeepingPoolEntriesOnce() { return result; } - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "initialize", HasReturnvaluesIF::RETURN_FAILED, "The map should only be initialized once"); return HasReturnvaluesIF::RETURN_OK; @@ -155,7 +155,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate( LocalPoolObjectBase* poolObj = owner->getPoolObjectHandle( receiver.dataId.localPoolId); if(poolObj == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleNotificationUpdate", POOLOBJECT_NOT_FOUND); return POOLOBJECT_NOT_FOUND; } @@ -177,7 +177,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate( LocalPoolDataSetBase* dataSet = owner->getDataSetHandle( receiver.dataId.sid); if(dataSet == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleNotificationUpdate", DATASET_NOT_FOUND); return DATASET_NOT_FOUND; } @@ -209,7 +209,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot( LocalPoolObjectBase* poolObj = owner->getPoolObjectHandle( receiver.dataId.localPoolId); if(poolObj == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleNotificationSnapshot", POOLOBJECT_NOT_FOUND); return POOLOBJECT_NOT_FOUND; } @@ -247,7 +247,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot( LocalPoolDataSetBase* dataSet = owner->getDataSetHandle( receiver.dataId.sid); if(dataSet == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleNotificationSnapshot", DATASET_NOT_FOUND); return DATASET_NOT_FOUND; } @@ -355,7 +355,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForPeriodicPacket(sid_t sid, AcceptsHkPacketsIF* hkReceiverObject = objectManager->get(packetDestination); if(hkReceiverObject == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "subscribeForPeriodicPacket", QUEUE_OR_DESTINATION_INVALID); return QUEUE_OR_DESTINATION_INVALID; } @@ -385,7 +385,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForUpdatePackets(sid_t sid, AcceptsHkPacketsIF* hkReceiverObject = objectManager->get(packetDestination); if(hkReceiverObject == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "subscribeForPeriodicPacket", QUEUE_OR_DESTINATION_INVALID); return QUEUE_OR_DESTINATION_INVALID; } @@ -594,7 +594,7 @@ ReturnValue_t LocalDataPoolManager::printPoolEntry( lp_id_t localPoolId) { auto poolIter = localPoolMap.find(localPoolId); if (poolIter == localPoolMap.end()) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, "printPoolEntry", + printWarningOrError(sif::OutputTypes::OUT_WARNING, "printPoolEntry", HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND); return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND; } @@ -615,7 +615,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid, MessageQueueId_t destination) { if(dataSet == nullptr) { // Configuration error. - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "generateHousekeepingPacket", DATASET_NOT_FOUND); return DATASET_NOT_FOUND; @@ -641,7 +641,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid, if(hkQueue == nullptr) { // error, no queue available to send packet with. - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "generateHousekeepingPacket", QUEUE_OR_DESTINATION_INVALID); return QUEUE_OR_DESTINATION_INVALID; @@ -649,7 +649,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid, if(destination == MessageQueueIF::NO_QUEUE) { if(hkDestinationId == MessageQueueIF::NO_QUEUE) { // error, all destinations invalid - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "generateHousekeepingPacket", QUEUE_OR_DESTINATION_INVALID); } @@ -688,7 +688,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) { sid_t sid = receiver.dataId.sid; LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(sid); if(dataSet == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "performPeriodicHkGeneration", DATASET_NOT_FOUND); return; @@ -715,7 +715,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) { sif::warning << "LocalDataPoolManager::performHkOperation: " << "HK generation failed." << std::endl; #else - fsfw::printWarning("LocalDataPoolManager::performHkOperation: " + sif::printWarning("LocalDataPoolManager::performHkOperation: " "HK generation failed.\n"); #endif } @@ -762,7 +762,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, // Get and check dataset first. LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(sid); if(dataSet == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "performPeriodicHkGeneration", DATASET_NOT_FOUND); return DATASET_NOT_FOUND; @@ -789,7 +789,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, ReturnValue_t result = ipcStore->getFreeElement(&storeId, expectedSize,&storePtr); if(result != HasReturnvaluesIF::RETURN_OK) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "generateSetStructurePacket", HasReturnvaluesIF::RETURN_FAILED, "Could not get free element from IPC store."); return result; @@ -800,7 +800,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, result = setPacket.serialize(&storePtr, &size, expectedSize, SerializeIF::Endianness::BIG); if(expectedSize != size) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "generateSetStructurePacket", HasReturnvaluesIF::RETURN_FAILED, "Expected size is not equal to serialized size"); } @@ -825,7 +825,7 @@ void LocalDataPoolManager::clearReceiversList() { HkReceivers().swap(hkReceiversMap); } -void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType, +void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType, const char* functionName, ReturnValue_t error, const char* errorPrint) { if(errorPrint == nullptr) { if(error == DATASET_NOT_FOUND) { @@ -835,7 +835,7 @@ void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType, errorPrint = "Pool Object not found"; } else if(error == HasReturnvaluesIF::RETURN_FAILED) { - if(outputType == fsfw::OutputTypes::OUT_WARNING) { + if(outputType == sif::OutputTypes::OUT_WARNING) { errorPrint = "Generic Warning"; } else { @@ -856,25 +856,25 @@ void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType, } } - if(outputType == fsfw::OutputTypes::OUT_WARNING) { + if(outputType == sif::OutputTypes::OUT_WARNING) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "LocalDataPoolManager::" << functionName << ": Object ID " << std::setw(8) << std::setfill('0') << std::hex << owner->getObjectId() << " | " << errorPrint << std::dec << std::setfill(' ') << std::endl; #else - fsfw::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n", + sif::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n", owner->getObjectId(), errorPrint); #endif } - else if(outputType == fsfw::OutputTypes::OUT_ERROR) { + else if(outputType == sif::OutputTypes::OUT_ERROR) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "LocalDataPoolManager::" << functionName << ": Object ID " << std::setw(8) << std::setfill('0') << std::hex << owner->getObjectId() << " | " << errorPrint << std::dec << std::setfill(' ') << std::endl; #else - fsfw::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n", + sif::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n", owner->getObjectId(), errorPrint); #endif } diff --git a/datapoollocal/LocalDataPoolManager.h b/datapoollocal/LocalDataPoolManager.h index 2ced2efd0..2bc0cf7ed 100644 --- a/datapoollocal/LocalDataPoolManager.h +++ b/datapoollocal/LocalDataPoolManager.h @@ -377,7 +377,7 @@ private: ReturnValue_t addUpdateToStore(HousekeepingPacketUpdate& updatePacket, store_address_t& storeId); - void printWarningOrError(fsfw::OutputTypes outputType, + void printWarningOrError(sif::OutputTypes outputType, const char* functionName, ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED, const char* errorPrint = nullptr); @@ -389,14 +389,14 @@ ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId, PoolEntry **poolEntry) { auto poolIter = localPoolMap.find(localPoolId); if (poolIter == localPoolMap.end()) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "fetchPoolEntry", + printWarningOrError(sif::OutputTypes::OUT_ERROR, "fetchPoolEntry", HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND); return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND; } *poolEntry = dynamic_cast< PoolEntry* >(poolIter->second); if(*poolEntry == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "fetchPoolEntry", + printWarningOrError(sif::OutputTypes::OUT_ERROR, "fetchPoolEntry", HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT); return HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT; } diff --git a/datapoollocal/LocalPoolDataSetBase.cpp b/datapoollocal/LocalPoolDataSetBase.cpp index af492146d..bd22698f4 100644 --- a/datapoollocal/LocalPoolDataSetBase.cpp +++ b/datapoollocal/LocalPoolDataSetBase.cpp @@ -18,7 +18,7 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner, sif::error << "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner " << "invalid!" << std::endl; #else - fsfw::printError("LocalPoolDataSetBase::LocalPoolDataSetBase: Owner " + sif::printError("LocalPoolDataSetBase::LocalPoolDataSetBase: Owner " "invalid!\n\r"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return; @@ -171,7 +171,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t** buffer, sif::warning << "LocalPoolDataSetBase::serializeLocalPoolIds: " << "Serialization error!" << std::endl; #else - fsfw::printWarning("LocalPoolDataSetBase::serializeLocalPoolIds: " + sif::printWarning("LocalPoolDataSetBase::serializeLocalPoolIds: " "Serialization error!\n\r"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return result; @@ -235,7 +235,7 @@ void LocalPoolDataSetBase::bitSetter(uint8_t* byte, uint8_t position) const { sif::warning << "LocalPoolDataSetBase::bitSetter: Invalid position!" << std::endl; #else - fsfw::printWarning("LocalPoolDataSetBase::bitSetter: " + sif::printWarning("LocalPoolDataSetBase::bitSetter: " "Invalid position!\n\r"); #endif return; diff --git a/datapoollocal/LocalPoolObjectBase.cpp b/datapoollocal/LocalPoolObjectBase.cpp index bb7822dad..c2872617a 100644 --- a/datapoollocal/LocalPoolObjectBase.cpp +++ b/datapoollocal/LocalPoolObjectBase.cpp @@ -114,7 +114,7 @@ void LocalPoolObjectBase::reportReadCommitError(const char* variableType, << std::setfill('0') << objectId << std::dec << " LPID: " << lpId << std::endl; #else - fsfw::printWarning("%s: %s call | %s | Owner: 0x%08x LPID: %lu\n", + sif::printWarning("%s: %s call | %s | Owner: 0x%08x LPID: %lu\n", variableType, type, errMsg, objectId, lpId); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_DISABLE_PRINTOUT == 0 */ diff --git a/datapoollocal/LocalPoolVector.tpp b/datapoollocal/LocalPoolVector.tpp index f311c23d5..df2feb24f 100644 --- a/datapoollocal/LocalPoolVector.tpp +++ b/datapoollocal/LocalPoolVector.tpp @@ -101,7 +101,7 @@ inline T& LocalPoolVector::operator [](size_t i) { sif::warning << "LocalPoolVector: Invalid index. Setting or returning" " last value!" << std::endl; #else - fsfw::printWarning("LocalPoolVector: Invalid index. Setting or returning" + sif::printWarning("LocalPoolVector: Invalid index. Setting or returning" " last value!\n"); #endif return value[vectorSize - 1]; @@ -118,7 +118,7 @@ inline const T& LocalPoolVector::operator [](size_t i) const { sif::warning << "LocalPoolVector: Invalid index. Setting or returning" " last value!" << std::endl; #else - fsfw::printWarning("LocalPoolVector: Invalid index. Setting or returning" + sif::printWarning("LocalPoolVector: Invalid index. Setting or returning" " last value!\n"); #endif return value[vectorSize - 1]; diff --git a/devicehandlers/DeviceHandlerBase.cpp b/devicehandlers/DeviceHandlerBase.cpp index 4fa7b09c0..d515ac975 100644 --- a/devicehandlers/DeviceHandlerBase.cpp +++ b/devicehandlers/DeviceHandlerBase.cpp @@ -36,7 +36,7 @@ DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId, cookieInfo.state = COOKIE_UNUSED; cookieInfo.pendingCommand = deviceCommandMap.end(); if (comCookie == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "DeviceHandlerBase", + printWarningOrError(sif::OutputTypes::OUT_ERROR, "DeviceHandlerBase", HasReturnvaluesIF::RETURN_FAILED, "Invalid cookie"); } if (this->fdirInstance == nullptr) { @@ -124,7 +124,7 @@ ReturnValue_t DeviceHandlerBase::initialize() { communicationInterface = objectManager->get( deviceCommunicationId); if (communicationInterface == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "initialize", + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "Passed communication IF invalid"); return ObjectManagerIF::CHILD_INIT_FAILED; @@ -132,7 +132,7 @@ ReturnValue_t DeviceHandlerBase::initialize() { result = communicationInterface->initializeInterface(comCookie); if (result != RETURN_OK) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "initialize", + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "ComIF initialization failed"); return result; @@ -140,7 +140,7 @@ ReturnValue_t DeviceHandlerBase::initialize() { IPCStore = objectManager->get(objects::IPC_STORE); if (IPCStore == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "initialize", + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "IPC Store not set up"); return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -150,14 +150,14 @@ ReturnValue_t DeviceHandlerBase::initialize() { AcceptsDeviceResponsesIF>(rawDataReceiverId); if (rawReceiver == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "Raw receiver object ID set but no valid object found."); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Make sure the raw receiver object is set up properly" " and implements AcceptsDeviceResponsesIF" << std::endl; #else - fsfw::printError("Make sure the raw receiver object is set up " + sif::printError("Make sure the raw receiver object is set up " "properly and implements AcceptsDeviceResponsesIF\n"); #endif return ObjectManagerIF::CHILD_INIT_FAILED; @@ -168,14 +168,14 @@ ReturnValue_t DeviceHandlerBase::initialize() { if(powerSwitcherId != objects::NO_OBJECT) { powerSwitcher = objectManager->get(powerSwitcherId); if (powerSwitcher == nullptr) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "Power switcher set but no valid object found."); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Make sure the power switcher object is set up " << "properly and implements PowerSwitchIF" << std::endl; #else - fsfw::printError("Make sure the power switcher object is set up " + sif::printError("Make sure the power switcher object is set up " "properly and implements PowerSwitchIF\n"); #endif return ObjectManagerIF::CHILD_INIT_FAILED; @@ -717,7 +717,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData, case RETURN_OK: handleReply(receivedData, foundId, foundLen); if(foundLen == 0) { - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "parseReply", ObjectManagerIF::CHILD_INIT_FAILED, "Found length is one, parsing might be stuck"); } @@ -730,7 +730,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData, foundId); } if(foundLen == 0) { - printWarningOrError(fsfw::OutputTypes::OUT_ERROR, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "parseReply", ObjectManagerIF::CHILD_INIT_FAILED, "Power switcher set but no valid object found."); #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -1292,7 +1292,7 @@ void DeviceHandlerBase::buildInternalCommand(void) { result = buildNormalDeviceCommand(&deviceCommandId); if (result == BUSY) { // so we can track misconfigurations - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "buildInternalCommand", HasReturnvaluesIF::RETURN_FAILED, "Busy."); @@ -1324,7 +1324,7 @@ void DeviceHandlerBase::buildInternalCommand(void) { sprintf(output, "Command 0x%08x is executing", static_cast(deviceCommandId)); // so we can track misconfigurations - printWarningOrError(fsfw::OutputTypes::OUT_WARNING, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "buildInternalCommand", HasReturnvaluesIF::RETURN_FAILED, output); @@ -1488,7 +1488,7 @@ void DeviceHandlerBase::setNormalDatapoolEntriesInvalid() { } } -void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType, +void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType, const char *functionName, ReturnValue_t errorCode, const char *errorPrint) { if(errorPrint == nullptr) { @@ -1496,7 +1496,7 @@ void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType, errorPrint = "Initialization error"; } if(errorCode == HasReturnvaluesIF::RETURN_FAILED) { - if(errorType == fsfw::OutputTypes::OUT_WARNING) { + if(errorType == sif::OutputTypes::OUT_WARNING) { errorPrint = "Generic Warning"; } else { @@ -1508,25 +1508,25 @@ void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType, } } - if(errorType == fsfw::OutputTypes::OUT_WARNING) { + if(errorType == sif::OutputTypes::OUT_WARNING) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "DeviceHandlerBase::" << functionName << ": Object ID " << std::hex << std::setw(8) << std::setfill('0') << this->getObjectId() << " | " << errorPrint << std::dec << std::setfill(' ') << std::endl; #else - fsfw::printWarning("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n", + sif::printWarning("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n", this->getObjectId(), errorPrint); #endif } - else if(errorType == fsfw::OutputTypes::OUT_ERROR) { + else if(errorType == sif::OutputTypes::OUT_ERROR) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "DeviceHandlerBase::" << functionName << ": Object ID " << std::hex << std::setw(8) << std::setfill('0') << this->getObjectId() << " | " << errorPrint << std::dec << std::setfill(' ') << std::endl; #else - fsfw::printError("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n", + sif::printError("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n", this->getObjectId(), errorPrint); #endif } diff --git a/devicehandlers/DeviceHandlerBase.h b/devicehandlers/DeviceHandlerBase.h index 4c745b4f1..414588e18 100644 --- a/devicehandlers/DeviceHandlerBase.h +++ b/devicehandlers/DeviceHandlerBase.h @@ -1251,7 +1251,7 @@ private: void handleTransitionToOnMode(Mode_t commandedMode, Submode_t commandedSubmode); - void printWarningOrError(fsfw::OutputTypes errorType, + void printWarningOrError(sif::OutputTypes errorType, const char* functionName, ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED, const char* errorPrint = nullptr); diff --git a/globalfunctions/arrayprinter.cpp b/globalfunctions/arrayprinter.cpp index ebf21bb86..25d6fcf4b 100644 --- a/globalfunctions/arrayprinter.cpp +++ b/globalfunctions/arrayprinter.cpp @@ -10,7 +10,7 @@ void arrayprinter::print(const uint8_t *data, size_t size, OutputType type, } sif::info << "["; #else - fsfw::printInfo("Printing data with size %zu: [", size); + sif::printInfo("Printing data with size %zu: [", size); #endif if(type == OutputType::HEX) { arrayprinter::printHex(data, size, maxCharPerLine); diff --git a/osal/linux/BinarySemaphore.cpp b/osal/linux/BinarySemaphore.cpp index c2eb85149..5716e5602 100644 --- a/osal/linux/BinarySemaphore.cpp +++ b/osal/linux/BinarySemaphore.cpp @@ -114,7 +114,7 @@ uint8_t BinarySemaphore::getSemaphoreCounter(sem_t *handle) { } else if(result != 0 and errno == EINVAL) { // Could be called from interrupt, use lightweight printf - fsfw::printError("BinarySemaphore::getSemaphoreCounter: " + sif::printError("BinarySemaphore::getSemaphoreCounter: " "Invalid semaphore\n"); return 0; } @@ -136,7 +136,7 @@ void BinarySemaphore::initSemaphore(uint8_t initCount) { sif::error << "BinarySemaphore: Init failed with " << strerror(errno) << std::endl; #else - fsfw::printError("BinarySemaphore: Init failed with %s\n", + sif::printError("BinarySemaphore: Init failed with %s\n", strerror(errno)); #endif } diff --git a/osal/linux/MessageQueue.cpp b/osal/linux/MessageQueue.cpp index d93b7f6d5..60d15dee7 100644 --- a/osal/linux/MessageQueue.cpp +++ b/osal/linux/MessageQueue.cpp @@ -127,7 +127,7 @@ ReturnValue_t MessageQueue::handleError(mq_attr* attributes, sif::error << "MessageQueue::MessageQueue: Creating Queue " << name << " failed with status: " << strerror(errno) << std::endl; #else - fsfw::printError("MessageQueue::MessageQueue: Creating Queue %s" + sif::printError("MessageQueue::MessageQueue: Creating Queue %s" " failed with status: %s\n", name, strerror(errno)); #endif } diff --git a/osal/linux/PosixThread.cpp b/osal/linux/PosixThread.cpp index 8d368c182..2499b442e 100644 --- a/osal/linux/PosixThread.cpp +++ b/osal/linux/PosixThread.cpp @@ -151,7 +151,7 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) { sif::error << "PosixThread::createTask: Insufficient memory for" " the requested " << stackMb << " MB" << std::endl; #else - fsfw::printError("PosixThread::createTask: Insufficient memory for " + sif::printError("PosixThread::createTask: Insufficient memory for " "the requested %zu MB\n", stackMb); #endif } @@ -160,7 +160,7 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) { sif::error << "PosixThread::createTask: Wrong alignment argument!" << std::endl; #else - fsfw::printError("PosixThread::createTask: " + sif::printError("PosixThread::createTask: " "Wrong alignment argument!\n"); #endif } diff --git a/osal/linux/TmTcUnixUdpBridge.cpp b/osal/linux/TmTcUnixUdpBridge.cpp index 0bedce0f0..0af1fc68b 100644 --- a/osal/linux/TmTcUnixUdpBridge.cpp +++ b/osal/linux/TmTcUnixUdpBridge.cpp @@ -193,7 +193,7 @@ void TmTcUnixUdpBridge::handleSendError() { sif::error << "TmTcUnixBridge::handleSendError: " << strerror(errno) << std::endl; #else - fsfw::printError("TmTcUnixBridge::handleSendError: %s\n", + sif::printError("TmTcUnixBridge::handleSendError: %s\n", strerror(errno)); #endif } diff --git a/serviceinterface/ServiceInterfaceBuffer.cpp b/serviceinterface/ServiceInterfaceBuffer.cpp index 5846d233a..1a02d6e90 100644 --- a/serviceinterface/ServiceInterfaceBuffer.cpp +++ b/serviceinterface/ServiceInterfaceBuffer.cpp @@ -29,19 +29,19 @@ ServiceInterfaceBuffer::ServiceInterfaceBuffer(std::string setMessage, #if FSFW_COLORED_OUTPUT == 1 if(setMessage.find("DEBUG") != std::string::npos) { - colorPrefix = fsfw::ANSI_COLOR_MAGENTA; + colorPrefix = sif::ANSI_COLOR_MAGENTA; } else if(setMessage.find("INFO") != std::string::npos) { - colorPrefix = fsfw::ANSI_COLOR_GREEN; + colorPrefix = sif::ANSI_COLOR_GREEN; } else if(setMessage.find("WARNING") != std::string::npos) { - colorPrefix = fsfw::ANSI_COLOR_YELLOW; + colorPrefix = sif::ANSI_COLOR_YELLOW; } else if(setMessage.find("ERROR") != std::string::npos) { - colorPrefix = fsfw::ANSI_COLOR_RED; + colorPrefix = sif::ANSI_COLOR_RED; } else { - colorPrefix = fsfw::ANSI_COLOR_RESET; + colorPrefix = sif::ANSI_COLOR_RESET; } #ifdef WIN32 diff --git a/unittest/internal/UnittDefinitions.cpp b/unittest/internal/UnittDefinitions.cpp index d20771a43..517f561ab 100644 --- a/unittest/internal/UnittDefinitions.cpp +++ b/unittest/internal/UnittDefinitions.cpp @@ -5,7 +5,7 @@ sif::error << "Unit Tester error: Failed at test ID " << errorId << std::endl; #else - fsfw::printError("Unit Tester error: Failed at test ID 0x%08x", errorId); + sif::printError("Unit Tester error: Failed at test ID 0x%08x", errorId); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/unittest/user/unittest/core/CatchDefinitions.cpp b/unittest/user/unittest/core/CatchDefinitions.cpp index 531ee87b7..bae028759 100644 --- a/unittest/user/unittest/core/CatchDefinitions.cpp +++ b/unittest/user/unittest/core/CatchDefinitions.cpp @@ -9,7 +9,7 @@ StorageManagerIF* tglob::getIpcStoreHandle() { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Global object manager uninitialized" << std::endl; #else - fsfw::printError("Global object manager uninitialized\n\r"); + sif::printError("Global object manager uninitialized\n\r"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return nullptr; }