From 0ea692a5ea8e5230ccb14ae42156ac74f05ac851 Mon Sep 17 00:00:00 2001
From: "Robin.Mueller" <robin.mueller.m@gmail.com>
Date: Thu, 23 Apr 2020 20:04:48 +0200
Subject: [PATCH] some more sif changes

---
 datapool/PoolRawAccessHelper.cpp        | 16 ++++++++--------
 devicehandlers/CommunicationMessage.cpp |  8 ++++----
 osal/FreeRTOS/BinarySemaphore.cpp       | 10 +++++-----
 tmtcpacket/pus/TmPacketStored.cpp       |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/datapool/PoolRawAccessHelper.cpp b/datapool/PoolRawAccessHelper.cpp
index 81a9eb01..963835f5 100644
--- a/datapool/PoolRawAccessHelper.cpp
+++ b/datapool/PoolRawAccessHelper.cpp
@@ -34,7 +34,7 @@ ReturnValue_t PoolRawAccessHelper::serialize(uint8_t **buffer, size_t *size,
 		}
 	}
 	if(remainingParametersSize != 0) {
-		debug << "Pool Raw Access: Remaining parameters size not 0 !" << std::endl;
+		sif::debug << "Pool Raw Access: Remaining parameters size not 0 !" << std::endl;
 		result = RETURN_FAILED;
 	}
 	return result;
@@ -56,7 +56,7 @@ ReturnValue_t PoolRawAccessHelper::serializeWithValidityMask(uint8_t ** buffer,
 		}
 	}
 	if(remainingParametersSize != 0) {
-		debug << "Pool Raw Access: Remaining parameters size not 0 !" << std::endl;
+		sif::debug << "Pool Raw Access: Remaining parameters size not 0 !" << std::endl;
 		result = RETURN_FAILED;
 	}
 
@@ -75,7 +75,7 @@ ReturnValue_t PoolRawAccessHelper::serializeCurrentPoolEntryIntoBuffer(
 	ReturnValue_t result = AutoSerializeAdapter::deSerialize(&currentPoolId,
 			&poolIdBuffer,remainingParameters,true);
 	if(result != RETURN_OK) {
-		debug << std::hex << "Pool Raw Access Helper: Error deSeralizing "
+		sif::debug << std::hex << "Pool Raw Access Helper: Error deSeralizing "
 				"pool IDs" << std::dec << std::endl;
 		return result;
 	}
@@ -96,7 +96,7 @@ ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(
 	while(not poolEntrySerialized) {
 
 		if(counter > DataSet::DATA_SET_MAX_SIZE) {
-			error << "Pool Raw Access Helper: Config error, "
+			sif::error << "Pool Raw Access Helper: Config error, "
 					 "max. number of possible data set variables exceeded"
 				  << std::endl;
 			return result;
@@ -110,7 +110,7 @@ ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(
 
 		result = currentDataSet.read();
 		if (result != RETURN_OK) {
-			debug << std::hex << "Pool Raw Access Helper: Error reading raw "
+			sif::debug << std::hex << "Pool Raw Access Helper: Error reading raw "
 					"dataset with returncode 0x"
 				  << result << std::dec << std::endl;
 			return result;
@@ -119,7 +119,7 @@ ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(
 		result = checkRemainingSize(&currentPoolRawAccess, &poolEntrySerialized,
 				&arrayPosition);
 		if(result != RETURN_OK) {
-			error << "Pool Raw Access Helper: Configuration Error at pool ID "
+			sif::error << "Pool Raw Access Helper: Configuration Error at pool ID "
 				  << std::hex << currentPoolId
 				  << ". Size till end smaller than 0" << std::dec << std::endl;
 			return result;
@@ -136,7 +136,7 @@ ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(
 		result = currentDataSet.serialize(argStruct.buffer, argStruct.size,
 				argStruct.max_size, argStruct.bigEndian);
 		if (result != RETURN_OK) {
-			debug << "Pool Raw Access Helper: Error serializing pool data with "
+			sif::debug << "Pool Raw Access Helper: Error serializing pool data with "
 					 "ID 0x" << std::hex << currentPoolId << " into send buffer "
 					 "with return code " << result << std::dec << std::endl;
 			return result;
@@ -174,7 +174,7 @@ void PoolRawAccessHelper::handleMaskModification(uint8_t * validityMask) {
 uint8_t PoolRawAccessHelper::bitSetter(uint8_t byte, uint8_t position,
 		bool value) {
 	if(position < 1 or position > 8) {
-		debug << "Pool Raw Access: Bit setting invalid position" << std::endl;
+		sif::debug << "Pool Raw Access: Bit setting invalid position" << std::endl;
 		return byte;
 	}
 	uint8_t shiftNumber = position + (6 - 2 * (position - 1));
diff --git a/devicehandlers/CommunicationMessage.cpp b/devicehandlers/CommunicationMessage.cpp
index 028e8a2e..a80e7de1 100644
--- a/devicehandlers/CommunicationMessage.cpp
+++ b/devicehandlers/CommunicationMessage.cpp
@@ -126,7 +126,7 @@ void CommunicationMessage::setDataByte(uint8_t byte, uint8_t position) {
 		memcpy(getData() + 3 * sizeof(uint32_t) + position * sizeof(uint8_t), &byte, sizeof(byte));
 	}
 	else {
-		error << "Comm Message: Invalid byte position" << std::endl;
+		sif::error << "Comm Message: Invalid byte position" << std::endl;
 	}
 }
 
@@ -138,7 +138,7 @@ uint8_t CommunicationMessage::getDataByte(uint8_t position) const {
 	}
 	else {
 		return 0;
-		error << "Comm Message: Invalid byte position" << std::endl;
+		sif::error << "Comm Message: Invalid byte position" << std::endl;
 	}
 }
 
@@ -147,7 +147,7 @@ void CommunicationMessage::setDataUint16(uint16_t data, uint8_t position) {
 		memcpy(getData() + 3 * sizeof(uint32_t) + position * sizeof(uint16_t), &data, sizeof(data));
 	}
 	else {
-		error << "Comm Message: Invalid byte position" << std::endl;
+		sif::error << "Comm Message: Invalid byte position" << std::endl;
 	}
 
 }
@@ -160,7 +160,7 @@ uint16_t CommunicationMessage::getDataUint16(uint8_t position) const{
 	}
 	else {
 		return 0;
-		error << "Comm Message: Invalid byte position" << std::endl;
+		sif::error << "Comm Message: Invalid byte position" << std::endl;
 	}
 }
 
diff --git a/osal/FreeRTOS/BinarySemaphore.cpp b/osal/FreeRTOS/BinarySemaphore.cpp
index a6a923aa..6cacef65 100644
--- a/osal/FreeRTOS/BinarySemaphore.cpp
+++ b/osal/FreeRTOS/BinarySemaphore.cpp
@@ -12,7 +12,7 @@ BinarySemaphore::BinarySemaphore() {
 	handle = xSemaphoreCreateBinary();
 	if(handle == nullptr) {
 
-		error << "Binary semaphore creation failure" << std::endl;
+		sif::error << "Binary semaphore creation failure" << std::endl;
 	}
 	xSemaphoreGive(handle);
 }
@@ -26,7 +26,7 @@ BinarySemaphore::~BinarySemaphore() {
 BinarySemaphore::BinarySemaphore(const BinarySemaphore& other) {
     handle = xSemaphoreCreateBinary();
     if(handle == nullptr) {
-        error << "Binary semaphore creation failure" << std::endl;
+        sif::error << "Binary semaphore creation failure" << std::endl;
     }
     xSemaphoreGive(handle);
 }
@@ -35,7 +35,7 @@ BinarySemaphore& BinarySemaphore::operator =(const BinarySemaphore& s) {
     if(this != &s) {
         handle = xSemaphoreCreateBinary();
         if(handle == nullptr) {
-            error << "Binary semaphore creation failure" << std::endl;
+            sif::error << "Binary semaphore creation failure" << std::endl;
         }
         xSemaphoreGive(handle);
     }
@@ -45,7 +45,7 @@ BinarySemaphore& BinarySemaphore::operator =(const BinarySemaphore& s) {
 BinarySemaphore::BinarySemaphore(BinarySemaphore&& s) {
     handle = xSemaphoreCreateBinary();
     if(handle == nullptr) {
-        error << "Binary semaphore creation failure" << std::endl;
+        sif::error << "Binary semaphore creation failure" << std::endl;
     }
     xSemaphoreGive(handle);
 }
@@ -55,7 +55,7 @@ BinarySemaphore& BinarySemaphore::operator =(
     if(&s != this) {
         handle = xSemaphoreCreateBinary();
         if(handle == nullptr) {
-            error << "Binary semaphore creation failure" << std::endl;
+            sif::error << "Binary semaphore creation failure" << std::endl;
         }
         xSemaphoreGive(handle);
     }
diff --git a/tmtcpacket/pus/TmPacketStored.cpp b/tmtcpacket/pus/TmPacketStored.cpp
index 1ca87284..42d0d038 100644
--- a/tmtcpacket/pus/TmPacketStored.cpp
+++ b/tmtcpacket/pus/TmPacketStored.cpp
@@ -22,7 +22,7 @@ TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
 			(TmPacketBase::TM_PACKET_MIN_SIZE + size + headerSize), &pData);
 
 	if (returnValue != store->RETURN_OK) {
-		debug << "TM Packet Stored: Issue getting free storage" << std::endl;
+		sif::debug << "TM Packet Stored: Issue getting free storage" << std::endl;
 		checkAndReportLostTm();
 		return;
 	}