it compiles again

This commit is contained in:
Robin Müller 2022-05-09 00:09:13 +02:00
parent 1b34b90ae0
commit 83a2882f9d
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
96 changed files with 563 additions and 1210 deletions

View File

@ -1,30 +1,19 @@
#include "fsfw_hal/common/gpio/GpioCookie.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/serviceinterface.h"
GpioCookie::GpioCookie() {}
GpioCookie::GpioCookie() = default;
ReturnValue_t GpioCookie::addGpio(gpioId_t gpioId, GpioBase* gpioConfig) {
if (gpioConfig == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "GpioCookie::addGpio: gpioConfig is nullpointer" << std::endl;
#else
sif::printWarning("GpioCookie::addGpio: gpioConfig is nullpointer\n");
#endif
FSFW_LOGW("addGpio: gpioConfig is nullpointer\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
auto gpioMapIter = gpioMap.find(gpioId);
if (gpioMapIter == gpioMap.end()) {
auto statusPair = gpioMap.emplace(gpioId, gpioConfig);
if (statusPair.second == false) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "GpioCookie::addGpio: Failed to add GPIO " << gpioId << " to GPIO map"
<< std::endl;
#else
sif::printWarning("GpioCookie::addGpio: Failed to add GPIO %d to GPIO map\n", gpioId);
#endif
#endif
if (!statusPair.second) {
FSFW_LOGW("addGpio: Failed to add GPIO {} to GPIO map\n", gpioId);
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;

View File

@ -60,16 +60,8 @@ ReturnValue_t GyroHandlerL3GD20H::buildTransitionDeviceCommand(DeviceCommandId_t
return buildCommandFromCommand(*id, nullptr, 0);
}
default:
#if FSFW_CPP_OSTREAM_ENABLED == 1
/* Might be a configuration error. */
sif::warning << "GyroL3GD20Handler::buildTransitionDeviceCommand: "
"Unknown internal state!"
<< std::endl;
#else
sif::printDebug(
"GyroL3GD20Handler::buildTransitionDeviceCommand: "
"Unknown internal state!\n");
#endif
FSFW_LOGW("buildTransitionDeviceCommand: Unknown internal state\n");
return HasReturnvaluesIF::RETURN_OK;
}
return HasReturnvaluesIF::RETURN_OK;
@ -192,17 +184,8 @@ ReturnValue_t GyroHandlerL3GD20H::interpretDeviceReply(DeviceCommandId_t id,
if (periodicPrintout) {
if (debugDivider.checkAndIncrement()) {
/* Set terminal to utf-8 if there is an issue with micro printout. */
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "GyroHandlerL3GD20H: Angular velocities (deg/s):" << std::endl;
sif::info << "X: " << angVelocX << std::endl;
sif::info << "Y: " << angVelocY << std::endl;
sif::info << "Z: " << angVelocZ << std::endl;
#else
sif::printInfo("GyroHandlerL3GD20H: Angular velocities (deg/s):\n");
sif::printInfo("X: %f\n", angVelocX);
sif::printInfo("Y: %f\n", angVelocY);
sif::printInfo("Z: %f\n", angVelocZ);
#endif
FSFW_LOGI("GyroHandlerL3GD20H: Angular velocities (deg/s):\nX {} | Y {} | Z {}\n",
angVelocX, angVelocY, angVelocZ);
}
}

View File

@ -76,21 +76,16 @@ ReturnValue_t MgmLIS3MDLHandler::buildTransitionDeviceCommand(DeviceCommandId_t
}
default: {
/* might be a configuration error. */
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "GyroHandler::buildTransitionDeviceCommand: Unknown internal state!"
<< std::endl;
#else
sif::printWarning("GyroHandler::buildTransitionDeviceCommand: Unknown internal state!\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
FSFW_LOGW("buildTransitionDeviceCommand: Unknown internal state\n");
return HasReturnvaluesIF::RETURN_OK;
}
}
return buildCommandFromCommand(*id, NULL, 0);
return buildCommandFromCommand(*id, nullptr, 0);
}
uint8_t MgmLIS3MDLHandler::readCommand(uint8_t command, bool continuousCom) {
command |= (1 << MGMLIS3MDL::RW_BIT);
if (continuousCom == true) {
if (continuousCom) {
command |= (1 << MGMLIS3MDL::MS_BIT);
}
return command;
@ -98,7 +93,7 @@ uint8_t MgmLIS3MDLHandler::readCommand(uint8_t command, bool continuousCom) {
uint8_t MgmLIS3MDLHandler::writeCommand(uint8_t command, bool continuousCom) {
command &= ~(1 << MGMLIS3MDL::RW_BIT);
if (continuousCom == true) {
if (continuousCom) {
command |= (1 << MGMLIS3MDL::MS_BIT);
}
return command;
@ -186,13 +181,7 @@ ReturnValue_t MgmLIS3MDLHandler::scanForReply(const uint8_t *start, size_t len,
// Check validity by checking config registers
if (start[1] != registers[0] or start[2] != registers[1] or start[3] != registers[2] or
start[4] != registers[3] or start[5] != registers[4]) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "MGMHandlerLIS3MDL::scanForReply: Invalid registers!" << std::endl;
#else
sif::printWarning("MGMHandlerLIS3MDL::scanForReply: Invalid registers!\n");
#endif
#endif
FSFW_LOGW("scanForReply: Invalid registers\n");
return DeviceHandlerIF::INVALID_DATA;
}
if (mode == _MODE_START_UP) {
@ -210,17 +199,9 @@ ReturnValue_t MgmLIS3MDLHandler::scanForReply(const uint8_t *start, size_t len,
*foundId = getPendingCommand();
if (*foundId == MGMLIS3MDL::IDENTIFY_DEVICE) {
if (start[1] != MGMLIS3MDL::DEVICE_ID) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "MGMHandlerLIS3MDL::scanForReply: "
"Device identification failed!"
<< std::endl;
#else
sif::printWarning(
"MGMHandlerLIS3MDL::scanForReply: "
"Device identification failed!\n");
#endif
#endif
FSFW_FLOGW(
"scanForReply: Device identification failed, found ID {} not equal to expected {}\n",
start[1], MGMLIS3MDL::DEVICE_ID);
return DeviceHandlerIF::INVALID_DATA;
}
@ -268,19 +249,10 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons
if (periodicPrintout) {
if (debugDivider.checkAndIncrement()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "MGMHandlerLIS3: Magnetic field strength in"
" microtesla:"
<< std::endl;
sif::info << "X: " << mgmX << " uT" << std::endl;
sif::info << "Y: " << mgmY << " uT" << std::endl;
sif::info << "Z: " << mgmZ << " uT" << std::endl;
#else
sif::printInfo("MGMHandlerLIS3: Magnetic field strength in microtesla:\n");
sif::printInfo("X: %f uT\n", mgmX);
sif::printInfo("Y: %f uT\n", mgmY);
sif::printInfo("Z: %f uT\n", mgmZ);
#endif /* FSFW_CPP_OSTREAM_ENABLED == 0 */
FSFW_LOGI(
"MGMHandlerLIS3: Magnetic field strength in"
" microtesla (uT):\nX {} | Y {} | Z {}\n",
mgmX, mgmY, mgmZ);
}
}
@ -311,15 +283,11 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons
}
case MGMLIS3MDL::READ_TEMPERATURE: {
int16_t tempValueRaw = packet[2] << 8 | packet[1];
auto tempValueRaw = static_cast<int16_t>((packet[2] << 8) | packet[1]);
float tempValue = 25.0 + ((static_cast<float>(tempValueRaw)) / 8.0);
if (periodicPrintout) {
if (debugDivider.check()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "MGMHandlerLIS3: Temperature: " << tempValue << " C" << std::endl;
#else
sif::printInfo("MGMHandlerLIS3: Temperature: %f C\n");
#endif
FSFW_LOGI("MGMHandlerLIS3: Temperature: {} C\n", tempValue);
}
}

View File

@ -81,18 +81,8 @@ ReturnValue_t MgmRM3100Handler::buildTransitionDeviceCommand(DeviceCommandId_t *
break;
}
default:
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
// Might be a configuration error
sif::warning << "MgmRM3100Handler::buildTransitionDeviceCommand: "
"Unknown internal state"
<< std::endl;
#else
sif::printWarning(
"MgmRM3100Handler::buildTransitionDeviceCommand: "
"Unknown internal state\n");
#endif
#endif
FSFW_LOGW("buildTransitionDeviceCommand: Unknown internal state\n");
return HasReturnvaluesIF::RETURN_OK;
}
@ -335,19 +325,10 @@ ReturnValue_t MgmRM3100Handler::handleDataReadout(const uint8_t *packet) {
if (periodicPrintout) {
if (debugDivider.checkAndIncrement()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "MgmRM3100Handler: Magnetic field strength in"
" microtesla:"
<< std::endl;
sif::info << "X: " << fieldStrengthX << " uT" << std::endl;
sif::info << "Y: " << fieldStrengthY << " uT" << std::endl;
sif::info << "Z: " << fieldStrengthZ << " uT" << std::endl;
#else
sif::printInfo("MgmRM3100Handler: Magnetic field strength in microtesla:\n");
sif::printInfo("X: %f uT\n", fieldStrengthX);
sif::printInfo("Y: %f uT\n", fieldStrengthY);
sif::printInfo("Z: %f uT\n", fieldStrengthZ);
#endif
FSFW_LOGI(
"MgmRM3100Handler: Magnetic field strength in"
" microtesla(uT)\nX {} | Y {} | Z {}\n",
fieldStrengthX, fieldStrengthY, fieldStrengthZ);
}
}

View File

@ -59,22 +59,16 @@ ReturnValue_t CommandExecutor::close() {
return HasReturnvaluesIF::RETURN_OK;
}
void CommandExecutor::printLastError(std::string funcName) const {
void CommandExecutor::printLastError(const std::string& funcName) const {
if (lastError != 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << funcName << " pclose failed with code " << lastError << ": "
<< strerror(lastError) << std::endl;
#else
sif::printError("%s pclose failed with code %d: %s\n", funcName, lastError,
strerror(lastError));
#endif
FSFW_FLOGW("{} | pclose failed with code {} | {}\n", funcName, lastError, strerror(lastError));
}
}
void CommandExecutor::setRingBuffer(SimpleRingBuffer* ringBuffer,
DynamicFIFO<uint16_t>* sizesFifo) {
this->ringBuffer = ringBuffer;
this->sizesFifo = sizesFifo;
void CommandExecutor::setRingBuffer(SimpleRingBuffer* ringBuffer_,
DynamicFIFO<uint16_t>* sizesFifo_) {
this->ringBuffer = ringBuffer_;
this->sizesFifo = sizesFifo_;
}
ReturnValue_t CommandExecutor::check(bool& replyReceived) {
@ -102,23 +96,13 @@ ReturnValue_t CommandExecutor::check(bool& replyReceived) {
ssize_t readBytes = read(currentFd, readVec.data(), readVec.size());
if (readBytes == 0) {
// Should not happen
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "CommandExecutor::check: No bytes read "
"after poll event.."
<< std::endl;
#else
sif::printWarning("CommandExecutor::check: No bytes read after poll event..\n");
#endif
FSFW_LOGWT("CommandExecutor::check: No bytes read after poll event\n");
break;
} else if (readBytes > 0) {
replyReceived = true;
if (printOutput) {
// It is assumed the command output is line terminated
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << currentCmd << " | " << readVec.data();
#else
sif::printInfo("%s | %s", currentCmd, readVec.data());
#endif
FSFW_LOGIT("{} | {}", currentCmd, readVec.data());
}
if (ringBuffer != nullptr) {
ringBuffer->writeData(reinterpret_cast<const uint8_t*>(readVec.data()), readBytes);
@ -130,20 +114,11 @@ ReturnValue_t CommandExecutor::check(bool& replyReceived) {
}
} else {
// Should also not happen
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "CommandExecutor::check: Error " << errno << ": " << strerror(errno)
<< std::endl;
#else
sif::printWarning("CommandExecutor::check: Error %d: %s\n", errno, strerror(errno));
#endif
FSFW_LOGW("check: Error {} | {}\n", errno, strerror(errno));
}
}
if (waiter.revents & POLLERR) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "CommandExecuter::check: Poll error" << std::endl;
#else
sif::printWarning("CommandExecuter::check: Poll error\n");
#endif
FSFW_LOGW("check: Poll error\n");
return COMMAND_ERROR;
}
if (waiter.revents & POLLHUP) {
@ -183,11 +158,7 @@ ReturnValue_t CommandExecutor::executeBlocking() {
while (fgets(readVec.data(), readVec.size(), currentCmdFile) != nullptr) {
std::string output(readVec.data());
if (printOutput) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << currentCmd << " | " << output;
#else
sif::printInfo("%s | %s", currentCmd, output);
#endif
FSFW_LOGI("{} | {}", currentCmd, output);
}
if (ringBuffer != nullptr) {
ringBuffer->writeData(reinterpret_cast<const uint8_t*>(output.data()), output.size());

View File

@ -93,7 +93,7 @@ class CommandExecutor {
States getCurrentState() const;
int getLastError() const;
void printLastError(std::string funcName) const;
void printLastError(const std::string& funcName) const;
/**
* Assign a ring buffer and a FIFO which will be filled by the executor with the output

View File

@ -14,15 +14,8 @@ UnixFileGuard::UnixFileGuard(std::string device, int* fileDescriptor, int flags,
}
*fileDescriptor = open(device.c_str(), flags);
if (*fileDescriptor < 0) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << diagnosticPrefix << ": Opening device failed with error code " << errno << ": "
<< strerror(errno) << std::endl;
#else
sif::printWarning("%s: Opening device failed with error code %d: %s\n", diagnosticPrefix, errno,
strerror(errno));
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
FSFW_LOGW("{} | Opening device failed with error code {} | {}\n", diagnosticPrefix, errno,
strerror(errno));
openStatus = OPEN_FILE_FAILED;
}
}

View File

@ -26,7 +26,7 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) {
std::string deviceFile;
if (cookie == nullptr) {
FSFW_LOGE("{}", "initializeInterface: Invalid cookie\n");
FSFW_FLOGE("{}", "initializeInterface: Invalid cookie\n");
return NULLPOINTER;
}
auto* i2cCookie = dynamic_cast<I2cCookie*>(cookie);
@ -38,14 +38,14 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) {
I2cInstance i2cInstance = {std::vector<uint8_t>(maxReplyLen), 0};
auto statusPair = i2cDeviceMap.emplace(i2cAddress, i2cInstance);
if (not statusPair.second) {
FSFW_LOGW("initializeInterface: Failed to insert device with address {} to I2C device map\n",
i2cAddress);
FSFW_FLOGW("initializeInterface: Failed to insert device with address {} to I2C device map\n",
i2cAddress);
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
}
FSFW_LOGE("initializeInterface: Device with address {} already in use\n", i2cAddress);
FSFW_FLOGE("initializeInterface: Device with address {} already in use\n", i2cAddress);
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -55,7 +55,7 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
std::string deviceFile;
if (sendData == nullptr) {
FSFW_LOGW("{}", "sendMessage: Send Data is nullptr\n");
FSFW_FLOGW("{}", "sendMessage: Send Data is nullptr\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -65,14 +65,14 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
auto* i2cCookie = dynamic_cast<I2cCookie*>(cookie);
if (i2cCookie == nullptr) {
FSFW_LOGWT("{}", "sendMessage: Invalid I2C Cookie\n");
FSFW_FLOGWT("{}", "sendMessage: Invalid I2C Cookie\n");
return NULLPOINTER;
}
address_t i2cAddress = i2cCookie->getAddress();
i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
if (i2cDeviceMapIter == i2cDeviceMap.end()) {
FSFW_LOGWT("{}", "sendMessage: I2C address of cookie not registered in I2C device map\n");
FSFW_FLOGWT("{}", "sendMessage: I2C address of cookie not registered in I2C device map\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -87,8 +87,8 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
}
if (write(fd, sendData, sendLen) != static_cast<int>(sendLen)) {
FSFW_LOGE("sendMessage: Failed to send data to I2C device with error code {} | {}\n", errno,
strerror(errno));
FSFW_FLOGE("sendMessage: Failed to send data to I2C device with error code {} | {}\n", errno,
strerror(errno));
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -112,7 +112,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
auto* i2cCookie = dynamic_cast<I2cCookie*>(cookie);
if (i2cCookie == nullptr) {
FSFW_LOGWT("{}", "requestReceiveMessage: Invalid I2C Cookie\n");
FSFW_FLOGWT("{}", "requestReceiveMessage: Invalid I2C Cookie\n");
i2cDeviceMapIter->second.replyLen = 0;
return NULLPOINTER;
}
@ -120,8 +120,8 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
address_t i2cAddress = i2cCookie->getAddress();
i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
if (i2cDeviceMapIter == i2cDeviceMap.end()) {
FSFW_LOGW("requestReceiveMessage: I2C address {} of Cookie not registered in i2cDeviceMap",
i2cAddress);
FSFW_FLOGW("requestReceiveMessage: I2C address {} of Cookie not registered in i2cDeviceMap",
i2cAddress);
i2cDeviceMapIter->second.replyLen = 0;
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -141,7 +141,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
ssize_t readLen = read(fd, replyBuffer, requestLen);
if (readLen != static_cast<int>(requestLen)) {
FSFW_LOGWT(
FSFW_FLOGWT(
"requestReceiveMessage: Reading from I2C device failed with error code "
"{} | {}\nRead only {} from {} bytes\n",
errno, strerror(errno), readLen, requestLen);
@ -161,15 +161,15 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
ReturnValue_t I2cComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) {
auto* i2cCookie = dynamic_cast<I2cCookie*>(cookie);
if (i2cCookie == nullptr) {
FSFW_LOGW("{}", "readReceivedMessage: Invalid I2C Cookie\n");
FSFW_FLOGW("{}", "readReceivedMessage: Invalid I2C Cookie\n");
return NULLPOINTER;
}
address_t i2cAddress = i2cCookie->getAddress();
i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
if (i2cDeviceMapIter == i2cDeviceMap.end()) {
FSFW_LOGE("readReceivedMessage: I2C address {} of cookie not found in I2C device map\n",
i2cAddress);
FSFW_FLOGE("readReceivedMessage: I2C address {} of cookie not found in I2C device map\n",
i2cAddress);
return HasReturnvaluesIF::RETURN_FAILED;
}
*buffer = i2cDeviceMapIter->second.replyBuffer.data();
@ -181,8 +181,8 @@ ReturnValue_t I2cComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer,
ReturnValue_t I2cComIF::openDevice(std::string deviceFile, address_t i2cAddress,
int* fileDescriptor) {
if (ioctl(*fileDescriptor, I2C_SLAVE, i2cAddress) < 0) {
FSFW_LOGWT("openDevice: Specifying target device failed with error code {} | {}\n", errno,
strerror(errno));
FSFW_FLOGWT("openDevice: Specifying target device failed with error code {} | {}\n", errno,
strerror(errno));
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;

View File

@ -19,7 +19,7 @@
SpiComIF::SpiComIF(object_id_t objectId, GpioIF* gpioComIF)
: SystemObject(objectId), gpioComIF(gpioComIF) {
if (gpioComIF == nullptr) {
FSFW_LOGET("{}", "SpiComIF::SpiComIF: GPIO communication interface invalid\n");
FSFW_FLOGET("{}", "SpiComIF::SpiComIF: GPIO communication interface invalid\n");
}
spiMutex = MutexFactory::instance()->createMutex();
@ -40,7 +40,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) {
SpiInstance spiInstance(bufferSize);
auto statusPair = spiDeviceMap.emplace(spiAddress, spiInstance);
if (not statusPair.second) {
FSFW_LOGWT(
FSFW_FLOGWT(
"SpiComIF::initializeInterface: Failed to insert device with address {} to SPI device "
"map\n",
spiAddress);
@ -50,7 +50,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) {
to the SPI driver transfer struct */
spiCookie->assignReadBuffer(statusPair.first->second.replyBuffer.data());
} else {
FSFW_LOGWT("{}", "initializeInterface: SPI address already exists\n");
FSFW_FLOGWT("{}", "initializeInterface: SPI address already exists\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -123,7 +123,7 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
}
if (sendLen > spiCookie->getMaxBufferSize()) {
FSFW_LOGW(
FSFW_FLOGW(
"sendMessage: Too much data sent, send length {} larger than maximum buffer length {}\n",
spiCookie->getMaxBufferSize(), sendLen);
return DeviceCommunicationIF::TOO_MUCH_DATA;
@ -173,12 +173,12 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
if (gpioId != gpio::NO_GPIO) {
result = spiMutex->lockMutex(timeoutType, timeoutMs);
if (result != RETURN_OK) {
FSFW_LOGET("{}", "sendMessage: Failed to lock mutex\n");
FSFW_FLOGET("{}", "sendMessage: Failed to lock mutex\n");
return result;
}
result = gpioComIF->pullLow(gpioId);
if (result != HasReturnvaluesIF::RETURN_OK) {
FSFW_LOGW("{}", "sendMessage: Pulling low CS pin failed\n");
FSFW_FLOGW("{}", "sendMessage: Pulling low CS pin failed\n");
return result;
}
}
@ -197,7 +197,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
} else {
/* We write with a blocking half-duplex transfer here */
if (write(fileDescriptor, sendData, sendLen) != static_cast<ssize_t>(sendLen)) {
FSFW_LOGET("{}", "sendMessage: Half-Duplex write operation failed\n");
FSFW_FLOGET("{}", "sendMessage: Half-Duplex write operation failed\n");
result = HALF_DUPLEX_TRANSFER_FAILED;
}
}
@ -206,7 +206,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
gpioComIF->pullHigh(gpioId);
result = spiMutex->unlockMutex();
if (result != RETURN_OK) {
FSFW_LOGWT("{}", "sendMessage: Failed to unlock mutex\n");
FSFW_FLOGWT("{}", "sendMessage: Failed to unlock mutex\n");
return result;
}
}
@ -248,14 +248,14 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) {
if (gpioId != gpio::NO_GPIO) {
result = spiMutex->lockMutex(timeoutType, timeoutMs);
if (result != RETURN_OK) {
FSFW_LOGW("{}", "getSendSuccess: Failed to lock mutex\n");
FSFW_FLOGW("{}", "getSendSuccess: Failed to lock mutex\n");
return result;
}
gpioComIF->pullLow(gpioId);
}
if (read(fileDescriptor, rxBuf, readSize) != static_cast<ssize_t>(readSize)) {
FSFW_LOGW("{}", "sendMessage: Half-Duplex read operation failed\n");
FSFW_FLOGW("{}", "sendMessage: Half-Duplex read operation failed\n");
result = HALF_DUPLEX_TRANSFER_FAILED;
}
@ -263,7 +263,7 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) {
gpioComIF->pullHigh(gpioId);
result = spiMutex->unlockMutex();
if (result != RETURN_OK) {
FSFW_LOGW("{}", "getSendSuccess: Failed to unlock mutex\n");
FSFW_FLOGW("{}", "getSendSuccess: Failed to unlock mutex\n");
return result;
}
}

View File

@ -25,7 +25,7 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) {
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGE("{}", "initializeInterface: Invalid UART Cookie\n");
FSFW_FLOGE("{}", "initializeInterface: Invalid UART Cookie\n");
return NULLPOINTER;
}
@ -41,11 +41,12 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) {
UartElements uartElements = {fileDescriptor, std::vector<uint8_t>(maxReplyLen), 0};
auto status = uartDeviceMap.emplace(deviceFile, uartElements);
if (!status.second) {
FSFW_LOGW("initializeInterface: Failed to insert device {} to UART device map\n", deviceFile);
FSFW_FLOGW("initializeInterface: Failed to insert device {} to UART device map\n",
deviceFile);
return RETURN_FAILED;
}
} else {
FSFW_LOGW("initializeInterface: UART device {} already in use\n", deviceFile);
FSFW_FLOGW("initializeInterface: UART device {} already in use\n", deviceFile);
return RETURN_FAILED;
}
@ -65,14 +66,14 @@ int UartComIF::configureUartPort(UartCookie* uartCookie) {
int fd = open(deviceFile.c_str(), flags);
if (fd < 0) {
FSFW_LOGW("configureUartPort: Failed to open UART {} with error code {} | {}\n", deviceFile,
errno, strerror(errno));
FSFW_FLOGW("configureUartPort: Failed to open UART {} with error code {} | {}\n", deviceFile,
errno, strerror(errno));
return fd;
}
/* Read in existing settings */
if (tcgetattr(fd, &options) != 0) {
FSFW_LOGW("configureUartPort: Error {} from tcgetattr: {}\n", errno, strerror(errno));
FSFW_FLOGW("configureUartPort: Error {} from tcgetattr: {}\n", errno, strerror(errno));
return fd;
}
@ -93,8 +94,8 @@ int UartComIF::configureUartPort(UartCookie* uartCookie) {
/* Save option settings */
if (tcsetattr(fd, TCSANOW, &options) != 0) {
FSFW_LOGW("configureUartPort: Failed to set options with error {} | {}\n", errno,
strerror(errno));
FSFW_FLOGW("configureUartPort: Failed to set options with error {} | {}\n", errno,
strerror(errno));
return fd;
}
return fd;
@ -146,8 +147,8 @@ void UartComIF::setDatasizeOptions(struct termios* options, UartCookie* uartCook
options->c_cflag |= CS8;
break;
default:
FSFW_LOGW("setDatasizeOptions: Invalid size {} specified\n",
static_cast<unsigned int>(uartCookie->getBitsPerWord()));
FSFW_FLOGW("setDatasizeOptions: Invalid size {} specified\n",
static_cast<unsigned int>(uartCookie->getBitsPerWord()));
break;
}
}
@ -300,7 +301,7 @@ void UartComIF::configureBaudrate(struct termios* options, UartCookie* uartCooki
break;
#endif // ! __APPLE__
default:
FSFW_LOGW("{}", "UartComIF::configureBaudrate: Baudrate not supported\n");
FSFW_FLOGW("{}", "UartComIF::configureBaudrate: Baudrate not supported\n");
break;
}
}
@ -315,27 +316,27 @@ ReturnValue_t UartComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData,
}
if (sendData == nullptr) {
FSFW_LOGWT("{}", "sendMessage: Send data is nullptr");
FSFW_FLOGWT("{}", "sendMessage: Send data is nullptr");
return RETURN_FAILED;
}
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGWT("{}", "sendMessage: Invalid UART Cookie\n");
FSFW_FLOGWT("{}", "sendMessage: Invalid UART Cookie\n");
return NULLPOINTER;
}
deviceFile = uartCookie->getDeviceFile();
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
if (uartDeviceMapIter == uartDeviceMap.end()) {
FSFW_LOGWT("{}", "sendMessage: Device file {} not in UART map\n", deviceFile);
FSFW_FLOGWT("{}", "sendMessage: Device file {} not in UART map\n", deviceFile);
return RETURN_FAILED;
}
fd = uartDeviceMapIter->second.fileDescriptor;
if (write(fd, sendData, sendLen) != static_cast<int>(sendLen)) {
FSFW_LOGE("sendMessage: Failed to send data with error code {} | {}", errno, strerror(errno));
FSFW_FLOGE("sendMessage: Failed to send data with error code {} | {}", errno, strerror(errno));
return RETURN_FAILED;
}
@ -350,7 +351,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGWT("{}", "requestReceiveMessage: Invalid UART Cookie\n");
FSFW_FLOGWT("{}", "requestReceiveMessage: Invalid UART Cookie\n");
return NULLPOINTER;
}
@ -363,7 +364,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL
}
if (uartDeviceMapIter == uartDeviceMap.end()) {
FSFW_LOGW("requestReceiveMessage: Device file {} not in UART map\n", deviceFile);
FSFW_FLOGW("requestReceiveMessage: Device file {} not in UART map\n", deviceFile);
return RETURN_FAILED;
}
@ -392,7 +393,7 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM
if (currentBytesRead >= maxReplySize) {
// Overflow risk. Emit warning, trigger event and break. If this happens,
// the reception buffer is not large enough or data is not polled often enough.
FSFW_LOGWT("{}", "requestReceiveMessage: Next read would cause overflow\n");
FSFW_FLOGWT("{}", "requestReceiveMessage: Next read would cause overflow\n");
result = UART_RX_BUFFER_TOO_SMALL;
break;
} else {
@ -403,7 +404,7 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM
if (bytesRead < 0) {
// EAGAIN: No data available in non-blocking mode
if (errno != EAGAIN) {
FSFW_LOGWT("handleCanonicalRead: read failed with code {} | {}\n", errno, strerror(errno));
FSFW_FLOGWT("handleCanonicalRead: read failed with code {} | {}\n", errno, strerror(errno));
return RETURN_FAILED;
}
@ -423,7 +424,7 @@ ReturnValue_t UartComIF::handleNoncanonicalRead(UartCookie& uartCookie, UartDevi
auto bufferPtr = iter->second.replyBuffer.data();
// Size check to prevent buffer overflow
if (requestLen > uartCookie.getMaxReplyLen()) {
FSFW_LOGW("{}", "requestReceiveMessage: Next read would cause overflow\n");
FSFW_FLOGW("{}", "requestReceiveMessage: Next read would cause overflow\n");
return UART_RX_BUFFER_TOO_SMALL;
}
ssize_t bytesRead = read(fd, bufferPtr, requestLen);
@ -431,8 +432,8 @@ ReturnValue_t UartComIF::handleNoncanonicalRead(UartCookie& uartCookie, UartDevi
return RETURN_FAILED;
} else if (bytesRead != static_cast<int>(requestLen)) {
if (uartCookie.isReplySizeFixed()) {
FSFW_LOGWT("UartComIF::requestReceiveMessage: Only read {} of {} bytes\n", bytesRead,
requestLen);
FSFW_FLOGWT("UartComIF::requestReceiveMessage: Only read {} of {} bytes\n", bytesRead,
requestLen);
return RETURN_FAILED;
}
}
@ -446,14 +447,14 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer,
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGWT("{}", "readReceivedMessage: Invalid uart cookie");
FSFW_FLOGWT("{}", "readReceivedMessage: Invalid uart cookie");
return NULLPOINTER;
}
deviceFile = uartCookie->getDeviceFile();
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
if (uartDeviceMapIter == uartDeviceMap.end()) {
FSFW_LOGW("UartComIF::readReceivedMessage: Device file {} not in UART map\n", deviceFile);
FSFW_FLOGW("UartComIF::readReceivedMessage: Device file {} not in UART map\n", deviceFile);
return RETURN_FAILED;
}
@ -471,7 +472,7 @@ ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF* cookie) {
UartDeviceMapIter uartDeviceMapIter;
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGWT("{}", "flushUartRxBuffer: Invalid UART cookie\n");
FSFW_FLOGWT("{}", "flushUartRxBuffer: Invalid UART cookie\n");
return NULLPOINTER;
}
deviceFile = uartCookie->getDeviceFile();
@ -489,7 +490,7 @@ ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF* cookie) {
UartDeviceMapIter uartDeviceMapIter;
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGWT("{}", "flushUartTxBuffer: Invalid uart cookie\n");
FSFW_FLOGWT("{}", "flushUartTxBuffer: Invalid uart cookie\n");
return NULLPOINTER;
}
deviceFile = uartCookie->getDeviceFile();
@ -507,7 +508,7 @@ ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF* cookie) {
UartDeviceMapIter uartDeviceMapIter;
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
if (uartCookie == nullptr) {
FSFW_LOGWT("{}", "flushUartTxAndRxBuf: Invalid UART cookie\n");
FSFW_FLOGWT("{}", "flushUartTxAndRxBuf: Invalid UART cookie\n");
return NULLPOINTER;
}
deviceFile = uartCookie->getDeviceFile();

View File

@ -3,21 +3,11 @@
#include <cerrno>
#include <cstring>
#include "fsfw/FSFW.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/serviceinterface.h"
void utility::handleIoctlError(const char* const customPrintout) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
if (customPrintout != nullptr) {
sif::warning << customPrintout << std::endl;
FSFW_LOGW(customPrintout);
}
sif::warning << "handleIoctlError: Error code " << errno << ", " << strerror(errno) << std::endl;
#else
if (customPrintout != nullptr) {
sif::printWarning("%s\n", customPrintout);
}
sif::printWarning("handleIoctlError: Error code %d, %s\n", errno, strerror(errno));
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
FSFW_LOGW("Error code {} | {}\n", errno, strerror(errno));
}

View File

@ -28,7 +28,7 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
}
if (queueToUse == nullptr) {
FSFW_LOGW("{}", "initialize: No queue set\n");
FSFW_FLOGW("{}", "initialize: No queue set\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -90,7 +90,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
size_t size = 0;
ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr);
if (result != HasReturnvaluesIF::RETURN_OK) {
FSFW_LOGWT("{}", "reportData: Getting free element from IPC store failed\n");
FSFW_FLOGWT("{}", "reportData: Getting free element from IPC store failed\n");
return result;
}
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
@ -125,7 +125,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
store_address_t storeAddress;
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
if (result != HasReturnvaluesIF::RETURN_OK) {
FSFW_LOGWT("{}", "reportData: Adding data to IPC store failed\n");
FSFW_FLOGWT("{}", "reportData: Adding data to IPC store failed\n");
return result;
}

View File

@ -29,7 +29,7 @@ ReturnValue_t CFDPHandler::initialize() {
}
ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) {
FSFW_LOGDT("{}", "CFDPHandler::handleRequest\n");
FSFW_FLOGDT("{}", "CFDPHandler::handleRequest\n");
// TODO read out packet from store using storeId

View File

@ -50,9 +50,9 @@ ReturnValue_t EofPduDeserializer::parseData() {
if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) {
EntityIdTlv* tlvPtr = info.getFaultLoc();
if (tlvPtr == nullptr) {
FSFW_LOGW("{}",
"parseData: Ca not deserialize fault location,"
" given TLV pointer invalid\n");
FSFW_FLOGW("{}",
"parseData: Ca not deserialize fault location,"
" given TLV pointer invalid\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness);

View File

@ -7,7 +7,7 @@
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() {
ReturnValue_t result = this->setValue(width, value);
if (result != HasReturnvaluesIF::RETURN_OK) {
FSFW_LOGW("{}", "cfdp::VarLenField: Setting value failed\n");
FSFW_FLOGW("{}", "cfdp::VarLenField: Setting value failed\n");
}
}

View File

@ -128,7 +128,7 @@ class FilestoreTlvBase : public TlvIF {
}
void secondFileNameMissing() const {
FSFW_LOGWT("{}", "secondFileNameMissing: Second file name required but TLV pointer not set\n");
FSFW_FLOGWT("{}", "secondFileNameMissing: Second file name required but TLV pointer not set\n");
}
FilestoreActionCode getActionCode() const { return actionCode; }

View File

@ -17,15 +17,15 @@ ReturnValue_t PoolDataSetBase::registerVariable(PoolVariableIF* variable) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if (state != States::STATE_SET_UNINITIALISED) {
FSFW_LOGW("{}", "registerVariable: Call made in wrong position\n");
FSFW_FLOGW("{}", "registerVariable: Call made in wrong position\n");
return DataSetIF::DATA_SET_UNINITIALISED;
}
if (variable == nullptr) {
FSFW_LOGW("{}", "registerVariable: Pool variable is nullptr\n");
FSFW_FLOGW("{}", "registerVariable: Pool variable is nullptr\n");
return DataSetIF::POOL_VAR_NULL;
}
if (fillCount >= maxFillCount) {
FSFW_LOGW("{}", "registerVariable: DataSet is full\n");
FSFW_FLOGW("{}", "registerVariable: DataSet is full\n");
return DataSetIF::DATA_SET_FULL;
}
registeredVariables[fillCount] = variable;
@ -47,7 +47,7 @@ ReturnValue_t PoolDataSetBase::read(MutexIF::TimeoutType timeoutType, uint32_t l
state = States::STATE_SET_WAS_READ;
unlockDataPool();
} else {
FSFW_LOGWT("{}", "read: Call made in wrong position. commit call might be missing\n");
FSFW_FLOGWT("{}", "read: Call made in wrong position. commit call might be missing\n");
result = SET_WAS_ALREADY_READ;
}

View File

@ -68,7 +68,7 @@ void PoolEntry<T>::print() {
} else {
validString = "Invalid";
}
FSFW_LOGI("PoolEntry Info. Validity {}\n", validString);
FSFW_FLOGI("PoolEntry Info. Validity {}\n", validString);
arrayprinter::print(reinterpret_cast<uint8_t*>(address), getByteSize());
}

View File

@ -17,7 +17,7 @@ class PoolReadGuard {
if (readObject != nullptr) {
readResult = readObject->read(timeoutType, mutexTimeout);
if (readResult != HasReturnvaluesIF::RETURN_OK) {
FSFW_LOGW("{}", "ctor: Read failed\n");
FSFW_FLOGW("{}", "ctor: Read failed\n");
}
}
}

View File

@ -166,7 +166,7 @@ class HasLocalDataPoolIF {
* @return
*/
virtual LocalPoolObjectBase* getPoolObjectHandle(lp_id_t localPoolId) {
FSFW_LOGW("{}", "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden. Returning nullptr\n");
FSFW_FLOGW("{}", "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden. Returning nullptr\n");
return nullptr;
}
};

View File

@ -695,7 +695,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
ReturnValue_t result = generateHousekeepingPacket(sid, dataSet, true);
if (result != HasReturnvaluesIF::RETURN_OK) {
/* Configuration error */
FSFW_LOGWT("{}", "performHkOperation: HK generation failed");
FSFW_FLOGWT("{}", "performHkOperation: HK generation failed");
}
}
@ -852,23 +852,9 @@ void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType,
}
if (outputType == sif::OutputTypes::OUT_WARNING) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LocalDataPoolManager::" << functionName << ": Object ID 0x" << std::setw(8)
<< std::setfill('0') << std::hex << objectId << " | " << errorPrint << std::dec
<< std::setfill(' ') << std::endl;
#else
sif::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n", functionName, objectId,
errorPrint);
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
FSFW_FLOGWT("{} | Object ID {} | {}\n", functionName, objectId, errorPrint);
} else if (outputType == sif::OutputTypes::OUT_ERROR) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "LocalDataPoolManager::" << functionName << ": Object ID 0x" << std::setw(8)
<< std::setfill('0') << std::hex << objectId << " | " << errorPrint << std::dec
<< std::setfill(' ') << std::endl;
#else
sif::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n", functionName, objectId,
errorPrint);
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
FSFW_FLOGET("{} | Object ID {} | {}\n", functionName, objectId, errorPrint);
}
#endif /* #if FSFW_VERBOSE_LEVEL >= 1 */
}

View File

@ -16,7 +16,7 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner, uint32_t
: PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) {
if (hkOwner == nullptr) {
// Configuration error.
FSFW_LOGW("{}", "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner invalid\n");
FSFW_FLOGW("{}", "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner invalid\n");
return;
}
AccessPoolManagerIF *accessor = HasLocalDpIFUserAttorney::getAccessorHandle(hkOwner);
@ -179,7 +179,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t **buffer, size
auto result =
SerializeAdapter::serialize(&currentPoolId, buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
FSFW_LOGW("{}", "serializeLocalPoolIds: Serialization error\n");
FSFW_FLOGW("{}", "serializeLocalPoolIds: Serialization error\n");
return result;
}
}

View File

@ -11,10 +11,10 @@ LocalPoolObjectBase::LocalPoolObjectBase(lp_id_t poolId, HasLocalDataPoolIF* hkO
DataSetIF* dataSet, pool_rwm_t setReadWriteMode)
: localPoolId(poolId), readWriteMode(setReadWriteMode) {
if (poolId == PoolVariableIF::NO_PARAMETER) {
FSFW_LOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
FSFW_FLOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
}
if (hkOwner == nullptr) {
FSFW_LOGET("{}", "ctor: Supplied pool owner is a invalid\n");
FSFW_FLOGET("{}", "ctor: Supplied pool owner is a invalid\n");
return;
}
AccessPoolManagerIF* poolManAccessor = HasLocalDpIFUserAttorney::getAccessorHandle(hkOwner);
@ -29,11 +29,11 @@ LocalPoolObjectBase::LocalPoolObjectBase(object_id_t poolOwner, lp_id_t poolId,
pool_rwm_t setReadWriteMode)
: localPoolId(poolId), readWriteMode(setReadWriteMode) {
if (poolId == PoolVariableIF::NO_PARAMETER) {
FSFW_LOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
FSFW_FLOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
}
auto* hkOwner = ObjectManager::instance()->get<HasLocalDataPoolIF>(poolOwner);
if (hkOwner == nullptr) {
FSFW_LOGWT(
FSFW_FLOGWT(
"ctor: The supplied pool owner {:#08x} did not implement the correct interface "
"HasLocalDataPoolIF\n",
poolOwner);
@ -94,6 +94,6 @@ void LocalPoolObjectBase::reportReadCommitError(const char* variableType, Return
errMsg = "Unknown error code";
}
FSFW_LOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg,
objectId, lpId);
FSFW_FLOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg,
objectId, lpId);
}

View File

@ -98,7 +98,7 @@ inline T& LocalPoolVector<T, vectorSize>::operator [](size_t i) {
}
// If this happens, I have to set some value. I consider this
// a configuration error, but I wont exit here.
FSFW_LOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
FSFW_FLOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
return value[vectorSize - 1];
}
@ -109,7 +109,7 @@ inline const T& LocalPoolVector<T, vectorSize>::operator [](size_t i) const {
}
// If this happens, I have to set some value. I consider this
// a configuration error, but I wont exit here.
FSFW_LOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
FSFW_FLOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
return value[vectorSize - 1];
}

View File

@ -156,9 +156,9 @@ ReturnValue_t DeviceHandlerBase::initialize() {
printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize",
ObjectManagerIF::CHILD_INIT_FAILED,
"Raw receiver object ID set but no valid object found.");
FSFW_LOGE("{}",
"Make sure the raw receiver object is set up properly "
"and implements AcceptsDeviceResponsesIF");
FSFW_FLOGE("{}",
"Make sure the raw receiver object is set up properly "
"and implements AcceptsDeviceResponsesIF");
return ObjectManagerIF::CHILD_INIT_FAILED;
}
defaultRawReceiver = rawReceiver->getDeviceQueue();
@ -170,9 +170,9 @@ ReturnValue_t DeviceHandlerBase::initialize() {
printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize",
ObjectManagerIF::CHILD_INIT_FAILED,
"Power switcher set but no valid object found.");
FSFW_LOGE("{}",
"Make sure the power switcher object is set up "
"properly and implements PowerSwitchIF\n");
FSFW_FLOGE("{}",
"Make sure the power switcher object is set up "
"properly and implements PowerSwitchIF\n");
return ObjectManagerIF::CHILD_INIT_FAILED;
}
}
@ -755,9 +755,9 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData, size_t receivedD
printWarningOrError(sif::OutputTypes::OUT_ERROR, "parseReply",
ObjectManagerIF::CHILD_INIT_FAILED,
"Power switcher set but no valid object found.");
FSFW_LOGW("{}",
"DeviceHandlerBase::parseReply: foundLen is 0! "
"Packet parsing will be stuck\n");
FSFW_FLOGW("{}",
"DeviceHandlerBase::parseReply: foundLen is 0! "
"Packet parsing will be stuck\n");
}
break;
}
@ -1462,11 +1462,11 @@ void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType, const ch
}
if (errorType == sif::OutputTypes::OUT_WARNING) {
FSFW_LOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
errorPrint);
FSFW_FLOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
errorPrint);
} else if (errorType == sif::OutputTypes::OUT_ERROR) {
FSFW_LOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
errorPrint);
FSFW_FLOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
errorPrint);
}
}

View File

@ -163,7 +163,7 @@ void DeviceHandlerFailureIsolation::clearFaultCounters() {
ReturnValue_t DeviceHandlerFailureIsolation::initialize() {
ReturnValue_t result = FailureIsolationBase::initialize();
if (result != HasReturnvaluesIF