From a5d2cbd7db6d6f47e7a3f75cc429ac36070f806e Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 23 Apr 2020 21:59:24 +0200 Subject: [PATCH] some more sif replacements --- osal/FreeRTOS/FixedTimeslotTask.cpp | 2 +- osal/FreeRTOS/Mutex.cpp | 2 +- serialize/SerialBufferAdapter.cpp | 4 ++-- storagemanager/LocalPool.h | 2 +- timemanager/Stopwatch.cpp | 4 ++-- tmtcservices/TmTcBridge.cpp | 24 ++++++++++++------------ 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/osal/FreeRTOS/FixedTimeslotTask.cpp b/osal/FreeRTOS/FixedTimeslotTask.cpp index d6fa5936..aed66349 100644 --- a/osal/FreeRTOS/FixedTimeslotTask.cpp +++ b/osal/FreeRTOS/FixedTimeslotTask.cpp @@ -67,7 +67,7 @@ ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId, return HasReturnvaluesIF::RETURN_OK; } - error << "Component " << std::hex << componentId + sif::error << "Component " << std::hex << componentId << " not found, not adding it to pst" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/osal/FreeRTOS/Mutex.cpp b/osal/FreeRTOS/Mutex.cpp index 616ef7b8..25513a81 100644 --- a/osal/FreeRTOS/Mutex.cpp +++ b/osal/FreeRTOS/Mutex.cpp @@ -7,7 +7,7 @@ const uint32_t MutexIF::NO_TIMEOUT = 0; Mutex::Mutex() { handle = xSemaphoreCreateMutex(); if(handle == NULL) { - error << "Mutex creation failure" << std::endl; + sif::error << "Mutex creation failure" << std::endl; } } diff --git a/serialize/SerialBufferAdapter.cpp b/serialize/SerialBufferAdapter.cpp index 5fb5e387..3df2abe9 100644 --- a/serialize/SerialBufferAdapter.cpp +++ b/serialize/SerialBufferAdapter.cpp @@ -100,7 +100,7 @@ ReturnValue_t SerialBufferAdapter::deSerialize(const uint8_t** buffer, template uint8_t * SerialBufferAdapter::getBuffer() { if(m_buffer == nullptr) { - error << "Wrong access function for stored type !" + sif::error << "Wrong access function for stored type !" " Use getConstBuffer()" << std::endl; return nullptr; } @@ -110,7 +110,7 @@ uint8_t * SerialBufferAdapter::getBuffer() { template const uint8_t * SerialBufferAdapter::getConstBuffer() { if(constBuffer == nullptr) { - error << "Wrong access function for stored type !" + sif::error << "Wrong access function for stored type !" " Use getBuffer()" << std::endl; return nullptr; } diff --git a/storagemanager/LocalPool.h b/storagemanager/LocalPool.h index b541c5e1..7e934c40 100644 --- a/storagemanager/LocalPool.h +++ b/storagemanager/LocalPool.h @@ -295,7 +295,7 @@ inline ReturnValue_t LocalPool::reserveSpace( if (!ignoreFault) { internalErrorReporter->storeFull(); } - error << "LocalPool( " << std::hex << getObjectId() << std::dec + sif::error << "LocalPool( " << std::hex << getObjectId() << std::dec << " )::reserveSpace: Packet store is full." << std::endl; } return status; diff --git a/timemanager/Stopwatch.cpp b/timemanager/Stopwatch.cpp index 3f0755fd..e2018469 100644 --- a/timemanager/Stopwatch.cpp +++ b/timemanager/Stopwatch.cpp @@ -31,11 +31,11 @@ seconds_t Stopwatch::stopSeconds() { void Stopwatch::display() { if(displayMode == StopwatchDisplayMode::MILLIS) { - info << "Stopwatch: Operation took " << (elapsedTime.tv_sec * 1000 + + sif::info << "Stopwatch: Operation took " << (elapsedTime.tv_sec * 1000 + elapsedTime.tv_usec / 1000) << " milliseconds" << std::endl; } else if(displayMode == StopwatchDisplayMode::SECONDS) { - info <<"Stopwatch: Operation took " << std::setprecision(3) + sif::info <<"Stopwatch: Operation took " << std::setprecision(3) << std::fixed << timevalOperations::toDouble(elapsedTime) << " seconds" << std::endl; } diff --git a/tmtcservices/TmTcBridge.cpp b/tmtcservices/TmTcBridge.cpp index 4e65cefa..c5eaf78b 100644 --- a/tmtcservices/TmTcBridge.cpp +++ b/tmtcservices/TmTcBridge.cpp @@ -21,7 +21,7 @@ ReturnValue_t TmTcBridge::setNumberOfSentPacketsPerCycle( return RETURN_OK; } else { - warning << "TmTcBridge: Number of packets sent per cycle " + sif::warning << "TmTcBridge: Number of packets sent per cycle " "exceeds limits. Keeping default value." << std::endl; return RETURN_FAILED; } @@ -34,7 +34,7 @@ ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored( return RETURN_OK; } else { - warning << "TmTcBridge: Number of packets stored " + sif::warning << "TmTcBridge: Number of packets stored " "exceeds limits. Keeping default value." << std::endl; return RETURN_FAILED; } @@ -62,11 +62,11 @@ ReturnValue_t TmTcBridge::performOperation(uint8_t operationCode) { ReturnValue_t result; result = handleTc(); if(result != RETURN_OK) { - error << "TMTC Bridge: Error handling TCs" << std::endl; + sif::error << "TMTC Bridge: Error handling TCs" << std::endl; } result = handleTm(); if (result != RETURN_OK) { - error << "TMTC Bridge: Error handling TMs" << std::endl; + sif::error << "TMTC Bridge: Error handling TMs" << std::endl; } return result; } @@ -81,7 +81,7 @@ ReturnValue_t TmTcBridge::handleTc() { ReturnValue_t TmTcBridge::handleTm() { ReturnValue_t result = handleTmQueue(); if(result != RETURN_OK) { - error << "TMTC Bridge: Reading TM Queue failed" << std::endl; + sif::error << "TMTC Bridge: Reading TM Queue failed" << std::endl; return RETURN_FAILED; } @@ -111,7 +111,7 @@ ReturnValue_t TmTcBridge::handleTmQueue() { result = sendTm(data, size); if (result != RETURN_OK) { - error << "TMTC Bridge: Could not send TM packet"<< std::endl; + sif::error << "TMTC Bridge: Could not send TM packet"<< std::endl; tmStore->deleteData(message.getStorageId()); return result; @@ -127,7 +127,7 @@ ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) { store_address_t storeId = 0; if(tmFifo.full()) { - error << "TMTC Bridge: TM downlink max. number of stored packet IDs " + sif::error << "TMTC Bridge: TM downlink max. number of stored packet IDs " "reached! Overwriting old data" << std::endl; tmFifo.retrieve(&storeId); tmStore->deleteData(storeId); @@ -153,7 +153,7 @@ ReturnValue_t TmTcBridge::handleStoredTm() { sendTm(data,size); if(result != RETURN_OK) { - error << "TMTC Bridge: Could not send stored downlink data" + sif::error << "TMTC Bridge: Could not send stored downlink data" << std::endl; result = RETURN_FAILED; } @@ -188,12 +188,12 @@ MessageQueueId_t TmTcBridge::getReportReceptionQueue(uint8_t virtualChannel) { void TmTcBridge::printData(uint8_t * data, size_t dataLen) { - info << "TMTC Bridge: Printing data: ["; + sif::info << "TMTC Bridge: Printing data: ["; for(uint32_t i = 0; i < dataLen; i++) { - info << std::hex << (int)data[i]; + sif::info << std::hex << (int)data[i]; if(i < dataLen-1){ - info << " , "; + sif::info << " , "; } } - info << " ] " << std::endl; + sif::info << " ] " << std::endl; }