replace FLOG with LOG variants
This commit is contained in:
parent
83a2882f9d
commit
b45b6b3758
@ -199,7 +199,7 @@ ReturnValue_t MgmLIS3MDLHandler::scanForReply(const uint8_t *start, size_t len,
|
||||
*foundId = getPendingCommand();
|
||||
if (*foundId == MGMLIS3MDL::IDENTIFY_DEVICE) {
|
||||
if (start[1] != MGMLIS3MDL::DEVICE_ID) {
|
||||
FSFW_FLOGW(
|
||||
FSFW_LOGW(
|
||||
"scanForReply: Device identification failed, found ID {} not equal to expected {}\n",
|
||||
start[1], MGMLIS3MDL::DEVICE_ID);
|
||||
return DeviceHandlerIF::INVALID_DATA;
|
||||
|
@ -61,7 +61,7 @@ ReturnValue_t CommandExecutor::close() {
|
||||
|
||||
void CommandExecutor::printLastError(const std::string& funcName) const {
|
||||
if (lastError != 0) {
|
||||
FSFW_FLOGW("{} | pclose failed with code {} | {}\n", funcName, lastError, strerror(lastError));
|
||||
FSFW_LOGW("{} | pclose failed with code {} | {}\n", funcName, lastError, strerror(lastError));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) {
|
||||
std::string deviceFile;
|
||||
|
||||
if (cookie == nullptr) {
|
||||
FSFW_FLOGE("{}", "initializeInterface: Invalid cookie\n");
|
||||
FSFW_LOGE("{}", "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_FLOGW("initializeInterface: Failed to insert device with address {} to I2C device map\n",
|
||||
i2cAddress);
|
||||
FSFW_LOGW("initializeInterface: Failed to insert device with address {} to I2C device map\n",
|
||||
i2cAddress);
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
FSFW_FLOGE("initializeInterface: Device with address {} already in use\n", i2cAddress);
|
||||
FSFW_LOGE("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_FLOGW("{}", "sendMessage: Send Data is nullptr\n");
|
||||
FSFW_LOGW("{}", "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_FLOGWT("{}", "sendMessage: Invalid I2C Cookie\n");
|
||||
FSFW_LOGWT("{}", "sendMessage: Invalid I2C Cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
|
||||
address_t i2cAddress = i2cCookie->getAddress();
|
||||
i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
|
||||
if (i2cDeviceMapIter == i2cDeviceMap.end()) {
|
||||
FSFW_FLOGWT("{}", "sendMessage: I2C address of cookie not registered in I2C device map\n");
|
||||
FSFW_LOGWT("{}", "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_FLOGE("sendMessage: Failed to send data to I2C device with error code {} | {}\n", errno,
|
||||
strerror(errno));
|
||||
FSFW_LOGE("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_FLOGWT("{}", "requestReceiveMessage: Invalid I2C Cookie\n");
|
||||
FSFW_LOGWT("{}", "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_FLOGW("requestReceiveMessage: I2C address {} of Cookie not registered in i2cDeviceMap",
|
||||
i2cAddress);
|
||||
FSFW_LOGW("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_FLOGWT(
|
||||
FSFW_LOGWT(
|
||||
"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_FLOGW("{}", "readReceivedMessage: Invalid I2C Cookie\n");
|
||||
FSFW_LOGW("{}", "readReceivedMessage: Invalid I2C Cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
|
||||
address_t i2cAddress = i2cCookie->getAddress();
|
||||
i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
|
||||
if (i2cDeviceMapIter == i2cDeviceMap.end()) {
|
||||
FSFW_FLOGE("readReceivedMessage: I2C address {} of cookie not found in I2C device map\n",
|
||||
i2cAddress);
|
||||
FSFW_LOGE("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_FLOGWT("openDevice: Specifying target device failed with error code {} | {}\n", errno,
|
||||
strerror(errno));
|
||||
FSFW_LOGWT("openDevice: Specifying target device failed with error code {} | {}\n", errno,
|
||||
strerror(errno));
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
|
@ -19,7 +19,7 @@
|
||||
SpiComIF::SpiComIF(object_id_t objectId, GpioIF* gpioComIF)
|
||||
: SystemObject(objectId), gpioComIF(gpioComIF) {
|
||||
if (gpioComIF == nullptr) {
|
||||
FSFW_FLOGET("{}", "SpiComIF::SpiComIF: GPIO communication interface invalid\n");
|
||||
FSFW_LOGET("{}", "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_FLOGWT(
|
||||
FSFW_LOGWT(
|
||||
"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_FLOGWT("{}", "initializeInterface: SPI address already exists\n");
|
||||
FSFW_LOGWT("{}", "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_FLOGW(
|
||||
FSFW_LOGW(
|
||||
"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_FLOGET("{}", "sendMessage: Failed to lock mutex\n");
|
||||
FSFW_LOGET("{}", "sendMessage: Failed to lock mutex\n");
|
||||
return result;
|
||||
}
|
||||
result = gpioComIF->pullLow(gpioId);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGW("{}", "sendMessage: Pulling low CS pin failed\n");
|
||||
FSFW_LOGW("{}", "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_FLOGET("{}", "sendMessage: Half-Duplex write operation failed\n");
|
||||
FSFW_LOGET("{}", "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_FLOGWT("{}", "sendMessage: Failed to unlock mutex\n");
|
||||
FSFW_LOGWT("{}", "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_FLOGW("{}", "getSendSuccess: Failed to lock mutex\n");
|
||||
FSFW_LOGW("{}", "getSendSuccess: Failed to lock mutex\n");
|
||||
return result;
|
||||
}
|
||||
gpioComIF->pullLow(gpioId);
|
||||
}
|
||||
|
||||
if (read(fileDescriptor, rxBuf, readSize) != static_cast<ssize_t>(readSize)) {
|
||||
FSFW_FLOGW("{}", "sendMessage: Half-Duplex read operation failed\n");
|
||||
FSFW_LOGW("{}", "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_FLOGW("{}", "getSendSuccess: Failed to unlock mutex\n");
|
||||
FSFW_LOGW("{}", "getSendSuccess: Failed to unlock mutex\n");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) {
|
||||
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGE("{}", "initializeInterface: Invalid UART Cookie\n");
|
||||
FSFW_LOGE("{}", "initializeInterface: Invalid UART Cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
|
||||
@ -41,12 +41,11 @@ 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_FLOGW("initializeInterface: Failed to insert device {} to UART device map\n",
|
||||
deviceFile);
|
||||
FSFW_LOGW("initializeInterface: Failed to insert device {} to UART device map\n", deviceFile);
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
} else {
|
||||
FSFW_FLOGW("initializeInterface: UART device {} already in use\n", deviceFile);
|
||||
FSFW_LOGW("initializeInterface: UART device {} already in use\n", deviceFile);
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
|
||||
@ -66,14 +65,14 @@ int UartComIF::configureUartPort(UartCookie* uartCookie) {
|
||||
int fd = open(deviceFile.c_str(), flags);
|
||||
|
||||
if (fd < 0) {
|
||||
FSFW_FLOGW("configureUartPort: Failed to open UART {} with error code {} | {}\n", deviceFile,
|
||||
errno, strerror(errno));
|
||||
FSFW_LOGW("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_FLOGW("configureUartPort: Error {} from tcgetattr: {}\n", errno, strerror(errno));
|
||||
FSFW_LOGW("configureUartPort: Error {} from tcgetattr: {}\n", errno, strerror(errno));
|
||||
return fd;
|
||||
}
|
||||
|
||||
@ -94,8 +93,8 @@ int UartComIF::configureUartPort(UartCookie* uartCookie) {
|
||||
|
||||
/* Save option settings */
|
||||
if (tcsetattr(fd, TCSANOW, &options) != 0) {
|
||||
FSFW_FLOGW("configureUartPort: Failed to set options with error {} | {}\n", errno,
|
||||
strerror(errno));
|
||||
FSFW_LOGW("configureUartPort: Failed to set options with error {} | {}\n", errno,
|
||||
strerror(errno));
|
||||
return fd;
|
||||
}
|
||||
return fd;
|
||||
@ -147,8 +146,8 @@ void UartComIF::setDatasizeOptions(struct termios* options, UartCookie* uartCook
|
||||
options->c_cflag |= CS8;
|
||||
break;
|
||||
default:
|
||||
FSFW_FLOGW("setDatasizeOptions: Invalid size {} specified\n",
|
||||
static_cast<unsigned int>(uartCookie->getBitsPerWord()));
|
||||
FSFW_LOGW("setDatasizeOptions: Invalid size {} specified\n",
|
||||
static_cast<unsigned int>(uartCookie->getBitsPerWord()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -301,7 +300,7 @@ void UartComIF::configureBaudrate(struct termios* options, UartCookie* uartCooki
|
||||
break;
|
||||
#endif // ! __APPLE__
|
||||
default:
|
||||
FSFW_FLOGW("{}", "UartComIF::configureBaudrate: Baudrate not supported\n");
|
||||
FSFW_LOGW("{}", "UartComIF::configureBaudrate: Baudrate not supported\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -316,27 +315,27 @@ ReturnValue_t UartComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData,
|
||||
}
|
||||
|
||||
if (sendData == nullptr) {
|
||||
FSFW_FLOGWT("{}", "sendMessage: Send data is nullptr");
|
||||
FSFW_LOGWT("{}", "sendMessage: Send data is nullptr");
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGWT("{}", "sendMessage: Invalid UART Cookie\n");
|
||||
FSFW_LOGWT("{}", "sendMessage: Invalid UART Cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
|
||||
deviceFile = uartCookie->getDeviceFile();
|
||||
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||
if (uartDeviceMapIter == uartDeviceMap.end()) {
|
||||
FSFW_FLOGWT("{}", "sendMessage: Device file {} not in UART map\n", deviceFile);
|
||||
FSFW_LOGWT("{}", "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_FLOGE("sendMessage: Failed to send data with error code {} | {}", errno, strerror(errno));
|
||||
FSFW_LOGE("sendMessage: Failed to send data with error code {} | {}", errno, strerror(errno));
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
|
||||
@ -351,7 +350,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL
|
||||
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGWT("{}", "requestReceiveMessage: Invalid UART Cookie\n");
|
||||
FSFW_LOGWT("{}", "requestReceiveMessage: Invalid UART Cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
|
||||
@ -364,7 +363,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL
|
||||
}
|
||||
|
||||
if (uartDeviceMapIter == uartDeviceMap.end()) {
|
||||
FSFW_FLOGW("requestReceiveMessage: Device file {} not in UART map\n", deviceFile);
|
||||
FSFW_LOGW("requestReceiveMessage: Device file {} not in UART map\n", deviceFile);
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
|
||||
@ -393,7 +392,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_FLOGWT("{}", "requestReceiveMessage: Next read would cause overflow\n");
|
||||
FSFW_LOGWT("{}", "requestReceiveMessage: Next read would cause overflow\n");
|
||||
result = UART_RX_BUFFER_TOO_SMALL;
|
||||
break;
|
||||
} else {
|
||||
@ -404,7 +403,7 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM
|
||||
if (bytesRead < 0) {
|
||||
// EAGAIN: No data available in non-blocking mode
|
||||
if (errno != EAGAIN) {
|
||||
FSFW_FLOGWT("handleCanonicalRead: read failed with code {} | {}\n", errno, strerror(errno));
|
||||
FSFW_LOGWT("handleCanonicalRead: read failed with code {} | {}\n", errno, strerror(errno));
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
|
||||
@ -424,7 +423,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_FLOGW("{}", "requestReceiveMessage: Next read would cause overflow\n");
|
||||
FSFW_LOGW("{}", "requestReceiveMessage: Next read would cause overflow\n");
|
||||
return UART_RX_BUFFER_TOO_SMALL;
|
||||
}
|
||||
ssize_t bytesRead = read(fd, bufferPtr, requestLen);
|
||||
@ -432,8 +431,8 @@ ReturnValue_t UartComIF::handleNoncanonicalRead(UartCookie& uartCookie, UartDevi
|
||||
return RETURN_FAILED;
|
||||
} else if (bytesRead != static_cast<int>(requestLen)) {
|
||||
if (uartCookie.isReplySizeFixed()) {
|
||||
FSFW_FLOGWT("UartComIF::requestReceiveMessage: Only read {} of {} bytes\n", bytesRead,
|
||||
requestLen);
|
||||
FSFW_LOGWT("UartComIF::requestReceiveMessage: Only read {} of {} bytes\n", bytesRead,
|
||||
requestLen);
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
@ -447,14 +446,14 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer,
|
||||
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGWT("{}", "readReceivedMessage: Invalid uart cookie");
|
||||
FSFW_LOGWT("{}", "readReceivedMessage: Invalid uart cookie");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
|
||||
deviceFile = uartCookie->getDeviceFile();
|
||||
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||
if (uartDeviceMapIter == uartDeviceMap.end()) {
|
||||
FSFW_FLOGW("UartComIF::readReceivedMessage: Device file {} not in UART map\n", deviceFile);
|
||||
FSFW_LOGW("UartComIF::readReceivedMessage: Device file {} not in UART map\n", deviceFile);
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
|
||||
@ -472,7 +471,7 @@ ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF* cookie) {
|
||||
UartDeviceMapIter uartDeviceMapIter;
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGWT("{}", "flushUartRxBuffer: Invalid UART cookie\n");
|
||||
FSFW_LOGWT("{}", "flushUartRxBuffer: Invalid UART cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
deviceFile = uartCookie->getDeviceFile();
|
||||
@ -490,7 +489,7 @@ ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF* cookie) {
|
||||
UartDeviceMapIter uartDeviceMapIter;
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGWT("{}", "flushUartTxBuffer: Invalid uart cookie\n");
|
||||
FSFW_LOGWT("{}", "flushUartTxBuffer: Invalid uart cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
deviceFile = uartCookie->getDeviceFile();
|
||||
@ -508,7 +507,7 @@ ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF* cookie) {
|
||||
UartDeviceMapIter uartDeviceMapIter;
|
||||
auto* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
FSFW_FLOGWT("{}", "flushUartTxAndRxBuf: Invalid UART cookie\n");
|
||||
FSFW_LOGWT("{}", "flushUartTxAndRxBuf: Invalid UART cookie\n");
|
||||
return NULLPOINTER;
|
||||
}
|
||||
deviceFile = uartCookie->getDeviceFile();
|
||||
|
@ -28,7 +28,7 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
||||
}
|
||||
|
||||
if (queueToUse == nullptr) {
|
||||
FSFW_FLOGW("{}", "initialize: No queue set\n");
|
||||
FSFW_LOGW("{}", "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_FLOGWT("{}", "reportData: Getting free element from IPC store failed\n");
|
||||
FSFW_LOGWT("{}", "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_FLOGWT("{}", "reportData: Adding data to IPC store failed\n");
|
||||
FSFW_LOGWT("{}", "reportData: Adding data to IPC store failed\n");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ ReturnValue_t CFDPHandler::initialize() {
|
||||
}
|
||||
|
||||
ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) {
|
||||
FSFW_FLOGDT("{}", "CFDPHandler::handleRequest\n");
|
||||
FSFW_LOGDT("{}", "CFDPHandler::handleRequest\n");
|
||||
|
||||
// TODO read out packet from store using storeId
|
||||
|
||||
|
@ -50,9 +50,9 @@ ReturnValue_t EofPduDeserializer::parseData() {
|
||||
if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) {
|
||||
EntityIdTlv* tlvPtr = info.getFaultLoc();
|
||||
if (tlvPtr == nullptr) {
|
||||
FSFW_FLOGW("{}",
|
||||
"parseData: Ca not deserialize fault location,"
|
||||
" given TLV pointer invalid\n");
|
||||
FSFW_LOGW("{}",
|
||||
"parseData: Ca not deserialize fault location,"
|
||||
" given TLV pointer invalid\n");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness);
|
||||
|
@ -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_FLOGW("{}", "cfdp::VarLenField: Setting value failed\n");
|
||||
FSFW_LOGW("{}", "cfdp::VarLenField: Setting value failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ class FilestoreTlvBase : public TlvIF {
|
||||
}
|
||||
|
||||
void secondFileNameMissing() const {
|
||||
FSFW_FLOGWT("{}", "secondFileNameMissing: Second file name required but TLV pointer not set\n");
|
||||
FSFW_LOGWT("{}", "secondFileNameMissing: Second file name required but TLV pointer not set\n");
|
||||
}
|
||||
|
||||
FilestoreActionCode getActionCode() const { return actionCode; }
|
||||
|
@ -17,15 +17,15 @@ ReturnValue_t PoolDataSetBase::registerVariable(PoolVariableIF* variable) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if (state != States::STATE_SET_UNINITIALISED) {
|
||||
FSFW_FLOGW("{}", "registerVariable: Call made in wrong position\n");
|
||||
FSFW_LOGW("{}", "registerVariable: Call made in wrong position\n");
|
||||
return DataSetIF::DATA_SET_UNINITIALISED;
|
||||
}
|
||||
if (variable == nullptr) {
|
||||
FSFW_FLOGW("{}", "registerVariable: Pool variable is nullptr\n");
|
||||
FSFW_LOGW("{}", "registerVariable: Pool variable is nullptr\n");
|
||||
return DataSetIF::POOL_VAR_NULL;
|
||||
}
|
||||
if (fillCount >= maxFillCount) {
|
||||
FSFW_FLOGW("{}", "registerVariable: DataSet is full\n");
|
||||
FSFW_LOGW("{}", "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_FLOGWT("{}", "read: Call made in wrong position. commit call might be missing\n");
|
||||
FSFW_LOGWT("{}", "read: Call made in wrong position. commit call might be missing\n");
|
||||
result = SET_WAS_ALREADY_READ;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ void PoolEntry<T>::print() {
|
||||
} else {
|
||||
validString = "Invalid";
|
||||
}
|
||||
FSFW_FLOGI("PoolEntry Info. Validity {}\n", validString);
|
||||
FSFW_LOGI("PoolEntry Info. Validity {}\n", validString);
|
||||
arrayprinter::print(reinterpret_cast<uint8_t*>(address), getByteSize());
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class PoolReadGuard {
|
||||
if (readObject != nullptr) {
|
||||
readResult = readObject->read(timeoutType, mutexTimeout);
|
||||
if (readResult != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGW("{}", "ctor: Read failed\n");
|
||||
FSFW_LOGW("{}", "ctor: Read failed\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ class HasLocalDataPoolIF {
|
||||
* @return
|
||||
*/
|
||||
virtual LocalPoolObjectBase* getPoolObjectHandle(lp_id_t localPoolId) {
|
||||
FSFW_FLOGW("{}", "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden. Returning nullptr\n");
|
||||
FSFW_LOGW("{}", "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden. Returning nullptr\n");
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
@ -695,7 +695,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
|
||||
ReturnValue_t result = generateHousekeepingPacket(sid, dataSet, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
/* Configuration error */
|
||||
FSFW_FLOGWT("{}", "performHkOperation: HK generation failed");
|
||||
FSFW_LOGWT("{}", "performHkOperation: HK generation failed");
|
||||
}
|
||||
}
|
||||
|
||||
@ -852,9 +852,9 @@ void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType,
|
||||
}
|
||||
|
||||
if (outputType == sif::OutputTypes::OUT_WARNING) {
|
||||
FSFW_FLOGWT("{} | Object ID {} | {}\n", functionName, objectId, errorPrint);
|
||||
FSFW_LOGWT("{} | Object ID {} | {}\n", functionName, objectId, errorPrint);
|
||||
} else if (outputType == sif::OutputTypes::OUT_ERROR) {
|
||||
FSFW_FLOGET("{} | Object ID {} | {}\n", functionName, objectId, errorPrint);
|
||||
FSFW_LOGET("{} | Object ID {} | {}\n", functionName, objectId, errorPrint);
|
||||
}
|
||||
#endif /* #if FSFW_VERBOSE_LEVEL >= 1 */
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner, uint32_t
|
||||
: PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) {
|
||||
if (hkOwner == nullptr) {
|
||||
// Configuration error.
|
||||
FSFW_FLOGW("{}", "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner invalid\n");
|
||||
FSFW_LOGW("{}", "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(¤tPoolId, buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGW("{}", "serializeLocalPoolIds: Serialization error\n");
|
||||
FSFW_LOGW("{}", "serializeLocalPoolIds: Serialization error\n");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -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_FLOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
|
||||
FSFW_LOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
|
||||
}
|
||||
if (hkOwner == nullptr) {
|
||||
FSFW_FLOGET("{}", "ctor: Supplied pool owner is a invalid\n");
|
||||
FSFW_LOGET("{}", "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_FLOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
|
||||
FSFW_LOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n");
|
||||
}
|
||||
auto* hkOwner = ObjectManager::instance()->get<HasLocalDataPoolIF>(poolOwner);
|
||||
if (hkOwner == nullptr) {
|
||||
FSFW_FLOGWT(
|
||||
FSFW_LOGWT(
|
||||
"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_FLOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg,
|
||||
objectId, lpId);
|
||||
FSFW_LOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg,
|
||||
objectId, lpId);
|
||||
}
|
||||
|
@ -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_FLOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
|
||||
FSFW_LOGWT("{}", "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_FLOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
|
||||
FSFW_LOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n");
|
||||
return value[vectorSize - 1];
|
||||
}
|
||||
|
||||
|
@ -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_FLOGE("{}",
|
||||
"Make sure the raw receiver object is set up properly "
|
||||
"and implements AcceptsDeviceResponsesIF");
|
||||
FSFW_LOGE("{}",
|
||||
"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_FLOGE("{}",
|
||||
"Make sure the power switcher object is set up "
|
||||
"properly and implements PowerSwitchIF\n");
|
||||
FSFW_LOGE("{}",
|
||||
"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_FLOGW("{}",
|
||||
"DeviceHandlerBase::parseReply: foundLen is 0! "
|
||||
"Packet parsing will be stuck\n");
|
||||
FSFW_LOGW("{}",
|
||||
"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_FLOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
|
||||
errorPrint);
|
||||
FSFW_LOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
|
||||
errorPrint);
|
||||
} else if (errorType == sif::OutputTypes::OUT_ERROR) {
|
||||
FSFW_FLOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
|
||||
errorPrint);
|
||||
FSFW_LOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
|
||||
errorPrint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ void DeviceHandlerFailureIsolation::clearFaultCounters() {
|
||||
ReturnValue_t DeviceHandlerFailureIsolation::initialize() {
|
||||
ReturnValue_t result = FailureIsolationBase::initialize();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGE("{}", "initialize: Could not initialize FailureIsolationBase\n");
|
||||
FSFW_LOGE("{}", "initialize: Could not initialize FailureIsolationBase\n");
|
||||
return result;
|
||||
}
|
||||
auto* power = ObjectManager::instance()->get<ConfirmsFailuresIF>(powerConfirmationId);
|
||||
|
@ -41,7 +41,7 @@ class EventManagerIF {
|
||||
if (eventmanagerQueue == MessageQueueIF::NO_QUEUE) {
|
||||
auto* eventmanager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
|
||||
if (eventmanager == nullptr) {
|
||||
FSFW_FLOGW("{}", "EventManagerIF::triggerEvent: EventManager invalid or not found\n");
|
||||
FSFW_LOGW("{}", "EventManagerIF::triggerEvent: EventManager invalid or not found\n");
|
||||
return;
|
||||
}
|
||||
eventmanagerQueue = eventmanager->getEventReportQueue();
|
||||
|
@ -20,7 +20,7 @@ FailureIsolationBase::~FailureIsolationBase() {
|
||||
ReturnValue_t FailureIsolationBase::initialize() {
|
||||
auto* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
|
||||
if (manager == nullptr) {
|
||||
FSFW_FLOGE("{}", "initialize: Event Manager has not been initialized\n");
|
||||
FSFW_LOGE("{}", "initialize: Event Manager has not been initialized\n");
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
ReturnValue_t result = manager->registerListener(eventQueue->getId());
|
||||
@ -34,7 +34,7 @@ ReturnValue_t FailureIsolationBase::initialize() {
|
||||
}
|
||||
owner = ObjectManager::instance()->get<HasHealthIF>(ownerId);
|
||||
if (owner == nullptr) {
|
||||
FSFW_FLOGE(
|
||||
FSFW_LOGE(
|
||||
"FailureIsolationBase::intialize: Owner object {:#08x} invalid. "
|
||||
"Does it implement HasHealthIF?\n",
|
||||
ownerId);
|
||||
@ -44,9 +44,8 @@ ReturnValue_t FailureIsolationBase::initialize() {
|
||||
if (faultTreeParent != objects::NO_OBJECT) {
|
||||
auto* parentIF = ObjectManager::instance()->get<ConfirmsFailuresIF>(faultTreeParent);
|
||||
if (parentIF == nullptr) {
|
||||
FSFW_FLOGW(
|
||||
"intialize: Parent object {:#08x} invalid. Does it implement ConfirmsFailuresIF?\n",
|
||||
faultTreeParent);
|
||||
FSFW_LOGW("intialize: Parent object {:#08x} invalid. Does it implement ConfirmsFailuresIF?\n",
|
||||
faultTreeParent);
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
eventQueue->setDefaultDestination(parentIF->getEventReceptionQueue());
|
||||
|
@ -8,11 +8,11 @@
|
||||
void arrayprinter::print(const uint8_t *data, size_t size, OutputType type, bool printInfo,
|
||||
size_t maxCharPerLine) {
|
||||
if (size == 0) {
|
||||
FSFW_FLOGI("{}", "Size is zero, nothing to print\n");
|
||||
FSFW_LOGI("{}", "Size is zero, nothing to print\n");
|
||||
return;
|
||||
}
|
||||
|
||||
FSFW_FLOGI("Printing data with size {}:\n", size);
|
||||
FSFW_LOGI("Printing data with size {}:\n", size);
|
||||
if (type == OutputType::HEX) {
|
||||
arrayprinter::printHex(data, size, maxCharPerLine);
|
||||
} else if (type == OutputType::DEC) {
|
||||
|
@ -35,12 +35,12 @@ ReturnValue_t HealthHelper::initialize() {
|
||||
eventSender = ObjectManager::instance()->get<EventReportingProxyIF>(objectId);
|
||||
|
||||
if (healthTable == nullptr) {
|
||||
FSFW_FLOGE("{}", "initialize: Health table object needs to be created in factory\n");
|
||||
FSFW_LOGE("{}", "initialize: Health table object needs to be created in factory\n");
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
||||
if (eventSender == nullptr) {
|
||||
FSFW_FLOGE("{}", "initialize: Owner has to implement ReportingProxyIF\n");
|
||||
FSFW_LOGE("{}", "initialize: Owner has to implement ReportingProxyIF\n");
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ void HealthHelper::informParent(HasHealthIF::HealthState health,
|
||||
HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO, health, oldHealth);
|
||||
if (MessageQueueSenderIF::sendMessage(parentQueue, &information, owner->getCommandQueue()) !=
|
||||
HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGWT("informParent: Object ID {:#08x} | Sending health reply failed\n", objectId);
|
||||
FSFW_LOGWT("informParent: Object ID {:#08x} | Sending health reply failed\n", objectId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ void HealthHelper::handleSetHealthCommand(CommandMessage* command) {
|
||||
}
|
||||
if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply, owner->getCommandQueue()) !=
|
||||
HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGWT("handleSetHealthCommand: Object ID {:#08x} | Sending health reply failed\n",
|
||||
objectId);
|
||||
FSFW_LOGWT("handleSetHealthCommand: Object ID {:#08x} | Sending health reply failed\n",
|
||||
objectId);
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void HealthTable::printAll(uint8_t* pointer, size_t maxSize) {
|
||||
ReturnValue_t result =
|
||||
SerializeAdapter::serialize(&count, &pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGW("{}", "printAll: Serialization of health table failed\n");
|
||||
FSFW_LOGW("{}", "printAll: Serialization of health table failed\n");
|
||||
return;
|
||||
}
|
||||
for (const auto& health : healthMap) {
|
||||
|
@ -15,7 +15,7 @@ MessageQueueMessage::MessageQueueMessage(uint8_t* data, size_t size)
|
||||
memcpy(this->getData(), data, size);
|
||||
this->messageSize = this->HEADER_SIZE + size;
|
||||
} else {
|
||||
FSFW_FLOGW("{}", "ctor: Passed size larger than maximum allowed size! Setting content to 0\n");
|
||||
FSFW_LOGW("{}", "ctor: Passed size larger than maximum allowed size! Setting content to 0\n");
|
||||
memset(this->internalBuffer, 0, sizeof(this->internalBuffer));
|
||||
this->messageSize = this->HEADER_SIZE;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ ReturnValue_t MemoryHelper::handleMemoryCommand(CommandMessage* message) {
|
||||
lastSender = message->getSender();
|
||||
lastCommand = message->getCommand();
|
||||
if (busy) {
|
||||
FSFW_FLOGW("{}", "MemoryHelper: Busy\n");
|
||||
FSFW_LOGW("{}", "MemoryHelper: Busy\n");
|
||||
}
|
||||
switch (lastCommand) {
|
||||
case MemoryMessage::CMD_MEMORY_DUMP:
|
||||
|
@ -81,7 +81,7 @@ class MonitoringReportContent : public SerialLinkedListAdapter<SerializeIF> {
|
||||
if (timeStamper == nullptr) {
|
||||
timeStamper = ObjectManager::instance()->get<TimeStamperIF>(timeStamperId);
|
||||
if (timeStamper == nullptr) {
|
||||
FSFW_FLOGET("{}", "checkAndSetStamper: Stamper not found\n");
|
||||
FSFW_LOGET("{}", "checkAndSetStamper: Stamper not found\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ ReturnValue_t ObjectManager::insert(object_id_t id, SystemObjectIF* object) {
|
||||
#endif
|
||||
return this->RETURN_OK;
|
||||
} else {
|
||||
FSFW_FLOGET("ObjectManager::insert: Object ID {:#08x} is already in use\nTerminating program\n",
|
||||
static_cast<uint32_t>(id));
|
||||
FSFW_LOGET("ObjectManager::insert: Object ID {:#08x} is already in use\nTerminating program\n",
|
||||
static_cast<uint32_t>(id));
|
||||
// This is very severe and difficult to handle in other places.
|
||||
std::exit(INSERTION_FAILED);
|
||||
}
|
||||
@ -54,7 +54,7 @@ ReturnValue_t ObjectManager::remove(object_id_t id) {
|
||||
#endif
|
||||
return RETURN_OK;
|
||||
} else {
|
||||
FSFW_FLOGW("removeObject: Requested object {:#08x} not found\n", id);
|
||||
FSFW_LOGW("removeObject: Requested object {:#08x} not found\n", id);
|
||||
return NOT_FOUND;
|
||||
}
|
||||
}
|
||||
@ -78,27 +78,27 @@ void ObjectManager::initialize() {
|
||||
result = it.second->initialize();
|
||||
if (result != RETURN_OK) {
|
||||
object_id_t var = it.first;
|
||||
FSFW_FLOGWT("initialize: Object {:#08x} failed to initialize with code {:#04x}\n", var,
|
||||
result);
|
||||
FSFW_LOGWT("initialize: Object {:#08x} failed to initialize with code {:#04x}\n", var,
|
||||
result);
|
||||
errorCount++;
|
||||
}
|
||||
}
|
||||
if (errorCount > 0) {
|
||||
FSFW_FLOGWT("{}", "initialize: Counted failed initializations\n");
|
||||
FSFW_LOGWT("{}", "initialize: Counted failed initializations\n");
|
||||
}
|
||||
// Init was successful. Now check successful interconnections.
|
||||
errorCount = 0;
|
||||
for (auto const& it : objectList) {
|
||||
result = it.second->checkObjectConnections();
|
||||
if (result != RETURN_OK) {
|
||||
FSFW_FLOGE("initialize: Object {:#08x} connection check failed with code {:#04x}\n", it.first,
|
||||
result);
|
||||
FSFW_LOGE("initialize: Object {:#08x} connection check failed with code {:#04x}\n", it.first,
|
||||
result);
|
||||
errorCount++;
|
||||
}
|
||||
}
|
||||
if (errorCount > 0) {
|
||||
FSFW_FLOGE("{}", "ObjectManager::ObjectManager: Counted {} failed connection checks\n",
|
||||
errorCount);
|
||||
FSFW_LOGE("{}", "ObjectManager::ObjectManager: Counted {} failed connection checks\n",
|
||||
errorCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ ReturnValue_t TcpTmTcServer::handleTcReception(uint8_t* spacePacket, size_t pack
|
||||
store_address_t storeId;
|
||||
ReturnValue_t result = tcStore->addData(&storeId, spacePacket, packetSize);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGWT("handleTcReception: Data storage with packet size {} failed\n", packetSize);
|
||||
FSFW_LOGWT("handleTcReception: Data storage with packet size {} failed\n", packetSize);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,9 @@ void tcpip::printAddress(struct sockaddr *addr) {
|
||||
}
|
||||
}
|
||||
if (stringPtr == nullptr) {
|
||||
FSFW_FLOGDT("Could not convert IP address to text representation, error code {} | {}", errno,
|
||||
strerror(errno));
|
||||
FSFW_LOGDT("Could not convert IP address to text representation, error code {} | {}", errno,
|
||||
strerror(errno));
|
||||
} else {
|
||||
FSFW_FLOGDT("IP Address Sender {}\n", ipAddress);
|
||||
FSFW_LOGDT("IP Address Sender {}\n", ipAddress);
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId, uint32_t slotT
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
FSFW_FLOGE("addSlot: Component {:#08x} not found, not adding it to PST\n", componentId);
|
||||
FSFW_LOGE("addSlot: Component {:#08x} not found, not adding it to PST\n", componentId);
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ void tcpip::handleError(Protocol protocol, ErrorSources errorSrc, dur_millis_t s
|
||||
}
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
FSFW_FLOGWT("tcpip::handleError: {} | {} | {}\n", protocolString, errorSrcString, infoString);
|
||||
FSFW_LOGWT("tcpip::handleError: {} | {} | {}\n", protocolString, errorSrcString, infoString);
|
||||
#else
|
||||
sif::printWarning("tcpip::handleError: %s | %s | %s\n", protocolString.c_str(),
|
||||
errorSrcString.c_str(), infoString.c_str());
|
||||
|
@ -44,9 +44,9 @@ ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) {
|
||||
ConstStorageAccessor accessor(storeId);
|
||||
result = storage->getData(storeId, accessor);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGE("{}",
|
||||
"ParameterHelper::handleParameterMessage: Getting store data failed for "
|
||||
"load command\n");
|
||||
FSFW_LOGE("{}",
|
||||
"ParameterHelper::handleParameterMessage: Getting store data failed for "
|
||||
"load command\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -209,23 +209,23 @@ ReturnValue_t ParameterWrapper::set(const uint8_t *stream, size_t streamSize,
|
||||
ReturnValue_t ParameterWrapper::copyFrom(const ParameterWrapper *from,
|
||||
uint16_t startWritingAtIndex) {
|
||||
if (data == nullptr) {
|
||||
FSFW_FLOGWT("{}", "copyFrom: Called on read-only variable\n");
|
||||
FSFW_LOGWT("{}", "copyFrom: Called on read-only variable\n");
|
||||
return READONLY;
|
||||
}
|
||||
|
||||
if (from->readonlyData == nullptr) {
|
||||
FSFW_FLOGWT("{}", "copyFrom: Source not set\n");
|
||||
FSFW_LOGWT("{}", "copyFrom: Source not set\n");
|
||||
return SOURCE_NOT_SET;
|
||||
}
|
||||
|
||||
if (type != from->type) {
|
||||
FSFW_FLOGW("{}", "copyFrom: Datatype missmatch\n");
|
||||
FSFW_LOGW("{}", "copyFrom: Datatype missmatch\n");
|
||||
return DATATYPE_MISSMATCH;
|
||||
}
|
||||
|
||||
// The smallest allowed value for rows and columns is one.
|
||||
if (rows == 0 or columns == 0) {
|
||||
FSFW_FLOGW("{}", "ParameterWrapper::copyFrom: Columns or rows zero\n");
|
||||
FSFW_LOGW("{}", "ParameterWrapper::copyFrom: Columns or rows zero\n");
|
||||
return COLUMN_OR_ROWS_ZERO;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ ReturnValue_t Service20ParameterManagement::isValidSubservice(uint8_t subservice
|
||||
case Subservice::PARAMETER_DUMP:
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
default:
|
||||
FSFW_FLOGE("Invalid Subservice {} for Service 20\n", subservice);
|
||||
FSFW_LOGE("Invalid Subservice {} for Service 20\n", subservice);
|
||||
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,7 @@ ReturnValue_t Service20ParameterManagement::checkInterfaceAndAcquireMessageQueue
|
||||
// check ReceivesParameterMessagesIF property of target
|
||||
auto* possibleTarget = ObjectManager::instance()->get<ReceivesParameterMessagesIF>(*objectId);
|
||||
if (possibleTarget == nullptr) {
|
||||
FSFW_FLOGE(
|
||||
FSFW_LOGE(
|
||||
"checkInterfaceAndAcquire: Can't retrieve message queue | Object ID {:#08x}\n"
|
||||
"Does it implement ReceivesParameterMessagesIF?\n",
|
||||
*objectId);
|
||||
|
@ -25,7 +25,7 @@ ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) {
|
||||
case Subservice::COMMAND_TOGGLE_WIRETAPPING:
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||