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;
|
||||
default:
|
||||
FSFW_FLOGW("Invalid Subservice {}\n", subservice);
|
||||
FSFW_LOGW("Invalid Subservice {}\n", subservice);
|
||||
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
|
||||
}
|
||||
}
|
||||
@ -116,8 +116,8 @@ void Service2DeviceAccess::handleUnrequestedReply(CommandMessage* reply) {
|
||||
sendWiretappingTm(reply, static_cast<uint8_t>(Subservice::REPLY_RAW));
|
||||
break;
|
||||
default:
|
||||
FSFW_FLOGET("handleUnrequestedReply: Unknown message with command ID {}\n",
|
||||
reply->getCommand());
|
||||
FSFW_LOGET("handleUnrequestedReply: Unknown message with command ID {}\n",
|
||||
reply->getCommand());
|
||||
break;
|
||||
}
|
||||
// Must be reached by all cases to clear message
|
||||
|
@ -212,7 +212,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
|
||||
}
|
||||
|
||||
default:
|
||||
FSFW_FLOGW("handleReply: Invalid reply with reply command {}\n", command);
|
||||
FSFW_LOGW("handleReply: Invalid reply with reply command {}\n", command);
|
||||
return CommandingServiceBase::INVALID_REPLY;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
|
@ -95,7 +95,7 @@ ReturnValue_t SerialBufferAdapter<count_t>::deSerialize(const uint8_t** buffer,
|
||||
template <typename count_t>
|
||||
uint8_t* SerialBufferAdapter<count_t>::getBuffer() {
|
||||
if (buffer == nullptr) {
|
||||
FSFW_FLOGW("{}", "getBuffer: Wrong access function for stored type. Use getConstBuffer\n");
|
||||
FSFW_LOGW("{}", "getBuffer: Wrong access function for stored type. Use getConstBuffer\n");
|
||||
return nullptr;
|
||||
}
|
||||
return buffer;
|
||||
@ -104,7 +104,7 @@ uint8_t* SerialBufferAdapter<count_t>::getBuffer() {
|
||||
template <typename count_t>
|
||||
const uint8_t* SerialBufferAdapter<count_t>::getConstBuffer() const {
|
||||
if (constBuffer == nullptr) {
|
||||
FSFW_FLOGE("{}", "getConstBuffer: Buffers are unitialized\n");
|
||||
FSFW_LOGE("{}", "getConstBuffer: Buffers are unitialized\n");
|
||||
return nullptr;
|
||||
}
|
||||
return constBuffer;
|
||||
|
@ -213,30 +213,13 @@ void error_st(const char* file, unsigned int line, fmt::format_string<T...> fmt,
|
||||
// The macros postfixed with T are the log variant with timing information
|
||||
|
||||
#define FSFW_LOGI(...) sif::info(__VA_ARGS__)
|
||||
#define FSFW_FLOGI(format, ...) sif::info(FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGIT(...) sif::info_t(__VA_ARGS__)
|
||||
#define FSFW_FLOGIT(format, ...) sif::info_t(FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGD(...) sif::debug(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||
#define FSFW_FLOGD(format, ...) sif::debug(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGDT(...) sif::debug_t(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||
#define FSFW_FLOGDT(format, ...) \
|
||||
sif::debug_t(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGW(...) sif::warning_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||
#define FSFW_FLOGW(format, ...) \
|
||||
sif::warning_s(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGWT(...) sif::warning_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||
#define FSFW_FLOGWT(format, ...) \
|
||||
sif::warning_st(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGE(...) sif::error_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||
#define FSFW_FLOGE(format, ...) \
|
||||
sif::error_s(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||
|
||||
#define FSFW_LOGET(...) sif::error_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||
#define FSFW_FLOGET(format, ...) \
|
||||
sif::error_st(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||
|
@ -46,14 +46,14 @@ const uint8_t* ConstStorageAccessor::data() const { return constDataPointer; }
|
||||
|
||||
size_t ConstStorageAccessor::size() const {
|
||||
if (internalState == AccessState::UNINIT) {
|
||||
FSFW_FLOGW("{}", "size: Not initialized\n");
|
||||
FSFW_LOGW("{}", "size: Not initialized\n");
|
||||
}
|
||||
return size_;
|
||||
}
|
||||
|
||||
ReturnValue_t ConstStorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize) {
|
||||
if (internalState == AccessState::UNINIT) {
|
||||
FSFW_FLOGW("{}", "getDataCopy: Not initialized\n");
|
||||
FSFW_LOGW("{}", "getDataCopy: Not initialized\n");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if (size_ > maxSize) {
|
||||
|
@ -12,7 +12,7 @@ LocalPool::LocalPool(object_id_t setObjectId, const LocalPoolConfig& poolConfig,
|
||||
NUMBER_OF_SUBPOOLS(poolConfig.size()),
|
||||
spillsToHigherPools(spillsToHigherPools) {
|
||||
if (NUMBER_OF_SUBPOOLS == 0) {
|
||||
FSFW_FLOGW("{}", "ctor: Passed pool configuration is invalid, 0 subpools\n");
|
||||
FSFW_LOGW("{}", "ctor: Passed pool configuration is invalid, 0 subpools\n");
|
||||
}
|
||||
max_subpools_t index = 0;
|
||||
for (const auto& currentPoolConfig : poolConfig) {
|
||||
@ -125,8 +125,8 @@ ReturnValue_t LocalPool::deleteData(store_address_t storeId) {
|
||||
sizeLists[storeId.poolIndex][storeId.packetIndex] = STORAGE_FREE;
|
||||
} else {
|
||||
// pool_index or packet_index is too large
|
||||
FSFW_FLOGWT("Object ID {} | deleteData: Illegal store ID, no deletion\n",
|
||||
SystemObject::getObjectId());
|
||||
FSFW_LOGWT("Object ID {} | deleteData: Illegal store ID, no deletion\n",
|
||||
SystemObject::getObjectId());
|
||||
status = ILLEGAL_STORAGE_ID;
|
||||
}
|
||||
return status;
|
||||
@ -175,7 +175,7 @@ ReturnValue_t LocalPool::initialize() {
|
||||
// Check if any pool size is large than the maximum allowed.
|
||||
for (uint8_t count = 0; count < NUMBER_OF_SUBPOOLS; count++) {
|
||||
if (elementSizes[count] >= STORAGE_FREE) {
|
||||
FSFW_FLOGW(
|
||||
FSFW_LOGW(
|
||||
"LocalPool::initialize: Pool is too large- "
|
||||
"Max. allowed size is: {}\n",
|
||||
STORAGE_FREE - 1);
|
||||
@ -199,7 +199,7 @@ ReturnValue_t LocalPool::reserveSpace(const size_t size, store_address_t* storeI
|
||||
bool ignoreFault) {
|
||||
ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex);
|
||||
if (status != RETURN_OK) {
|
||||
FSFW_FLOGW("ID {:#08x} | reserveSpace: Packet too large\n", SystemObject::getObjectId());
|
||||
FSFW_LOGW("ID {:#08x} | reserveSpace: Packet too large\n", SystemObject::getObjectId());
|
||||
return status;
|
||||
}
|
||||
status = findEmpty(storeId->poolIndex, &storeId->packetIndex);
|
||||
|
@ -23,7 +23,7 @@ StorageAccessor::StorageAccessor(StorageAccessor&& other)
|
||||
|
||||
ReturnValue_t StorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize) {
|
||||
if (internalState == AccessState::UNINIT) {
|
||||
FSFW_FLOGW("{}", "getDataCopy: Not initialized\n");
|
||||
FSFW_LOGW("{}", "getDataCopy: Not initialized\n");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if (size_ > maxSize) {
|
||||
|
@ -90,7 +90,7 @@ void FixedSlotSequence::addSlot(object_id_t componentId, uint32_t slotTimeMs, in
|
||||
|
||||
ReturnValue_t FixedSlotSequence::checkSequence() const {
|
||||
if (slotList.empty()) {
|
||||
FSFW_FLOGW("{}", "FixedSlotSequence::checkSequence: Slot list is empty\n");
|
||||
FSFW_LOGW("{}", "FixedSlotSequence::checkSequence: Slot list is empty\n");
|
||||
return FixedTimeslotTaskIF::SLOT_LIST_EMPTY;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ ReturnValue_t FixedSlotSequence::checkSequence() const {
|
||||
ReturnValue_t result = customCheckFunction(slotList);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
// Continue for now but print error output.
|
||||
FSFW_FLOGW("FixedSlotSequence::checkSequence: Custom check failed with result {}", result);
|
||||
FSFW_LOGW("FixedSlotSequence::checkSequence: Custom check failed with result {}", result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,8 +108,8 @@ ReturnValue_t FixedSlotSequence::checkSequence() const {
|
||||
if (slot.executableObject == nullptr) {
|
||||
errorCount++;
|
||||
} else if (slot.pollingTimeMs < time) {
|
||||
FSFW_FLOGET("FixedSlotSequence::checkSequence: Time {} is smaller than previous with {}\n",
|
||||
slot.pollingTimeMs, time);
|
||||
FSFW_LOGET("FixedSlotSequence::checkSequence: Time {} is smaller than previous with {}\n",
|
||||
slot.pollingTimeMs, time);
|
||||
errorCount++;
|
||||
} else {
|
||||
// All ok, print slot.
|
||||
@ -144,7 +144,7 @@ ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const {
|
||||
}
|
||||
}
|
||||
if (count > 0) {
|
||||
FSFW_FLOGE(
|
||||
FSFW_LOGE(
|
||||
"FixedSlotSequence::intializeSequenceAfterTaskCreation: Counted {} "
|
||||
"failed initializations\n",
|
||||
count);
|
||||
|
@ -27,7 +27,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
|
||||
size_t size = 0;
|
||||
ReturnValue_t result = this->tcStore->getData(currentMessage.getStorageId(), &packet, &size);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGWT("{}", "selectDestination: Getting data from store failed");
|
||||
FSFW_LOGWT("{}", "selectDestination: Getting data from store failed");
|
||||
}
|
||||
SpacePacketBase currentPacket(packet);
|
||||
|
||||
|
@ -22,8 +22,8 @@ CFDPDistributor::~CFDPDistributor() {}
|
||||
CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() {
|
||||
#if FSFW_CFDP_DISTRIBUTOR_DEBUGGING == 1
|
||||
store_address_t storeId = this->currentMessage.getStorageId();
|
||||
FSFW_FLOGI("selectDestination was called with pool index {} and packet index {}\n",
|
||||
storeId.poolIndex, storeId.packetIndex);
|
||||
FSFW_LOGI("selectDestination was called with pool index {} and packet index {}\n",
|
||||
storeId.poolIndex, storeId.packetIndex);
|
||||
#endif
|
||||
TcMqMapIter queueMapIt = this->queueMap.end();
|
||||
if (this->currentPacket == nullptr) {
|
||||
@ -33,8 +33,7 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() {
|
||||
if (currentPacket->getWholeData() != nullptr) {
|
||||
tcStatus = checker.checkPacket(currentPacket);
|
||||
if (tcStatus != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGWT("selectDestination: Packet format invalid, code {}\n",
|
||||
static_cast<int>(tcStatus));
|
||||
FSFW_LOGWT("selectDestination: Packet format invalid, code {}\n", static_cast<int>(tcStatus));
|
||||
}
|
||||
queueMapIt = this->queueMap.find(0);
|
||||
} else {
|
||||
@ -43,7 +42,7 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() {
|
||||
|
||||
if (queueMapIt == this->queueMap.end()) {
|
||||
tcStatus = DESTINATION_NOT_FOUND;
|
||||
FSFW_FLOGWT("{}", "handlePacket: Destination not found\n");
|
||||
FSFW_LOGWT("{}", "handlePacket: Destination not found\n");
|
||||
}
|
||||
|
||||
if (tcStatus != RETURN_OK) {
|
||||
@ -56,11 +55,11 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() {
|
||||
ReturnValue_t CFDPDistributor::registerHandler(AcceptsTelecommandsIF* handler) {
|
||||
uint16_t handlerId =
|
||||
handler->getIdentifier(); // should be 0, because CFDPHandler does not set a set a service-ID
|
||||
FSFW_FLOGIT("CFDPDistributor::registerHandler: Handler ID {}\n", static_cast<int>(handlerId));
|
||||
FSFW_LOGIT("CFDPDistributor::registerHandler: Handler ID {}\n", static_cast<int>(handlerId));
|
||||
MessageQueueId_t queue = handler->getRequestQueue();
|
||||
auto returnPair = queueMap.emplace(handlerId, queue);
|
||||
if (not returnPair.second) {
|
||||
FSFW_FLOGE("{}", "CFDPDistributor::registerHandler: Service ID already exists in map\n");
|
||||
FSFW_LOGE("{}", "CFDPDistributor::registerHandler: Service ID already exists in map\n");
|
||||
return SERVICE_ID_ALREADY_EXISTS;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
@ -97,7 +96,7 @@ ReturnValue_t CFDPDistributor::initialize() {
|
||||
|
||||
auto* ccsdsDistributor = ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource);
|
||||
if (ccsdsDistributor == nullptr) {
|
||||
FSFW_FLOGE("{}", "initialize: Packet source invalid. Does it implement CCSDSDistributorIF?\n");
|
||||
FSFW_LOGE("{}", "initialize: Packet source invalid. Does it implement CCSDSDistributorIF?\n");
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
return ccsdsDistributor->registerApplication(this);
|
||||
|
@ -44,7 +44,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
|
||||
} else if (tcStatus == TcPacketCheckPUS::INCOMPLETE_PACKET) {
|
||||
keyword = "incomplete packet";
|
||||
}
|
||||
FSFW_FLOGWT("selectDestination: Packet format invalid, {} error\n", keyword);
|
||||
FSFW_LOGWT("selectDestination: Packet format invalid, {} error\n", keyword);
|
||||
#endif
|
||||
}
|
||||
uint32_t queue_id = currentPacket->getService();
|
||||
|
@ -33,9 +33,9 @@ ReturnValue_t TcDistributor::handlePacket() {
|
||||
}
|
||||
|
||||
void TcDistributor::print() {
|
||||
FSFW_FLOGI("{}", "Distributor content is:\nID\t| Message Queue ID");
|
||||
FSFW_LOGI("{}", "Distributor content is:\nID\t| Message Queue ID");
|
||||
for (const auto& queueMapIter : queueMap) {
|
||||
FSFW_FLOGI("{} \t| {:#08x}", queueMapIter.first, queueMapIter.second);
|
||||
FSFW_LOGI("{} \t| {:#08x}", queueMapIter.first, queueMapIter.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,10 @@ void Stopwatch::display() {
|
||||
if (displayMode == StopwatchDisplayMode::MILLIS) {
|
||||
auto timeMillis =
|
||||
static_cast<dur_millis_t>(elapsedTime.tv_sec * 1000 + elapsedTime.tv_usec / 1000);
|
||||
FSFW_FLOGIT("Stopwatch::display: {} ms elapsed\n", timeMillis);
|
||||
FSFW_LOGIT("Stopwatch::display: {} ms elapsed\n", timeMillis);
|
||||
} else if (displayMode == StopwatchDisplayMode::SECONDS) {
|
||||
FSFW_FLOGIT("Stopwatch::display: {} seconds elapsed\n",
|
||||
static_cast<float>(timevalOperations::toDouble(elapsedTime)));
|
||||
FSFW_LOGIT("Stopwatch::display: {} seconds elapsed\n",
|
||||
static_cast<float>(timevalOperations::toDouble(elapsedTime)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ uint8_t SpacePacketBase::getPacketVersionNumber(void) {
|
||||
ReturnValue_t SpacePacketBase::initSpacePacketHeader(bool isTelecommand, bool hasSecondaryHeader,
|
||||
uint16_t apid, uint16_t sequenceCount) {
|
||||
if (data == nullptr) {
|
||||
FSFW_FLOGWT("{}", "initSpacePacketHeader: Data pointer is invalid\n");
|
||||
FSFW_LOGWT("{}", "initSpacePacketHeader: Data pointer is invalid\n");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
// reset header to zero:
|
||||
|
@ -11,6 +11,6 @@ CFDPPacket::CFDPPacket(const uint8_t* setData) : SpacePacketBase(setData) {}
|
||||
CFDPPacket::~CFDPPacket() {}
|
||||
|
||||
void CFDPPacket::print() {
|
||||
FSFW_FLOGI("{}", "CFDPPacket::print:\n");
|
||||
FSFW_LOGI("{}", "CFDPPacket::print:\n");
|
||||
arrayprinter::print(getWholeData(), getFullSize());
|
||||
}
|
||||
|
@ -89,13 +89,13 @@ void TmPacketStoredBase::handleStoreFailure(const char *const packetType, Return
|
||||
switch (result) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
case (StorageManagerIF::DATA_STORAGE_FULL): {
|
||||
FSFW_FLOGWT("handleStoreFailure: {} | Store full for packet with size {}\n", packetType,
|
||||
sizeToReserve);
|
||||
FSFW_LOGWT("handleStoreFailure: {} | Store full for packet with size {}\n", packetType,
|
||||
sizeToReserve);
|
||||
break;
|
||||
}
|
||||
case (StorageManagerIF::DATA_TOO_LARGE): {
|
||||
FSFW_FLOGWT("handleStoreFailure: {} | Data with size {} too large\n", packetType,
|
||||
sizeToReserve);
|
||||
FSFW_LOGWT("handleStoreFailure: {} | Data with size {} too large\n", packetType,
|
||||
sizeToReserve);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
|
@ -95,7 +95,7 @@ void CommandingServiceBase::handleCommandQueue() {
|
||||
} else if (result == MessageQueueIF::EMPTY) {
|
||||
break;
|
||||
} else {
|
||||
FSFW_FLOGWT(
|
||||
FSFW_LOGWT(
|
||||
"CommandingServiceBase::handleCommandQueue: Receiving message failed"
|
||||
"with code {}",
|
||||
result);
|
||||
|
@ -22,7 +22,7 @@ ReturnValue_t PusServiceBase::performOperation(uint8_t opCode) {
|
||||
handleRequestQueue();
|
||||
ReturnValue_t result = this->performService();
|
||||
if (result != RETURN_OK) {
|
||||
FSFW_FLOGWT("performOperation: PUS service {} return with error {}\n", serviceId, result);
|
||||
FSFW_LOGWT("performOperation: PUS service {} return with error {}\n", serviceId, result);
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
@ -71,8 +71,8 @@ void PusServiceBase::handleRequestQueue() {
|
||||
// ": no new packet." << std::endl;
|
||||
break;
|
||||
} else {
|
||||
FSFW_FLOGWT("performOperation: Service {}. Error receiving packed, code {}\n", serviceId,
|
||||
status);
|
||||
FSFW_LOGWT("performOperation: Service {}. Error receiving packed, code {}\n", serviceId,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ ReturnValue_t PusServiceBase::initialize() {
|
||||
auto* destService = ObjectManager::instance()->get<AcceptsTelemetryIF>(packetDestination);
|
||||
auto* distributor = ObjectManager::instance()->get<PUSDistributorIF>(packetSource);
|
||||
if (destService == nullptr or distributor == nullptr) {
|
||||
FSFW_FLOGWT(
|
||||
FSFW_LOGWT(
|
||||
"ctor: Service {} | Make sure static packetSource and packetDestination "
|
||||
"are defined correctly\n",
|
||||
serviceId);
|
||||
|
@ -37,7 +37,7 @@ ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(uint8_t maxNumberOfPackets
|
||||
this->maxNumberOfPacketsStored = maxNumberOfPacketsStored_;
|
||||
return RETURN_OK;
|
||||
} else {
|
||||
FSFW_FLOGW(
|
||||
FSFW_LOGW(
|
||||
"setMaxNumberOfPacketsStored: Passed number of packets {} stored exceeds "
|
||||
"limit {}\nKeeping default value\n",
|
||||
maxNumberOfPacketsStored_, LIMIT_DOWNLINK_PACKETS_STORED);
|
||||
@ -87,7 +87,7 @@ ReturnValue_t TmTcBridge::handleTm() {
|
||||
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = handleTmQueue();
|
||||
if (result != RETURN_OK) {
|
||||
FSFW_FLOGET("handleTm: Error handling TM queue with error code {:#04x}\n", result);
|
||||
FSFW_LOGET("handleTm: Error handling TM queue with error code {:#04x}\n", result);
|
||||
status = result;
|
||||
}
|
||||
|
||||
|
@ -26,8 +26,8 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id, TcPacketPusB
|
||||
currentPacket->getPacketSequenceControl(), 0, set_step);
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGET("VerificationReporter::sendSuccessReport: Error writing to queue. Code: {}\n",
|
||||
status);
|
||||
FSFW_LOGET("VerificationReporter::sendSuccessReport: Error writing to queue. Code: {}\n",
|
||||
status);
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id, uint8_t ackF
|
||||
set_step);
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGET(
|
||||
FSFW_LOGET(
|
||||
"VerificationReporter::sendSuccessReport: Error writing "
|
||||
"to queue. Code: {}\n",
|
||||
status);
|
||||
@ -62,7 +62,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id, TcPacketPusBase*
|
||||
currentPacket->getPacketSequenceControl(), error_code, step, parameter1, parameter2);
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
FSFW_FLOGET(
|
||||
FSFW_LOGET(
|
||||
"VerificationReporter::sendFailureReport: Error writing "
|
||||
"to queue. Code: {}\n",
|
||||
status);
|
||||
|
@ -17,7 +17,7 @@ TestDevice::~TestDevice() {}
|
||||
|
||||
void TestDevice::performOperationHook() {
|
||||
if (periodicPrintout) {
|
||||
FSFW_FLOGI("TestDevice {} | performOperationHook: Alive!\n", deviceIdx);
|
||||
FSFW_LOGI("TestDevice {} | performOperationHook: Alive!\n", deviceIdx);
|
||||
}
|
||||
|
||||
if (oneShot) {
|
||||
@ -27,7 +27,7 @@ void TestDevice::performOperationHook() {
|
||||
|
||||
void TestDevice::doStartUp() {
|
||||
if (fullInfoPrintout) {
|
||||
FSFW_FLOGI("TestDevice {} | doStartUp: Switching On\n", deviceIdx);
|
||||
FSFW_LOGI("TestDevice {} | doStartUp: Switching On\n", deviceIdx);
|
||||
}
|
||||
|
||||
setMode(_MODE_TO_ON);
|
||||
@ -35,7 +35,7 @@ void TestDevice::doStartUp() {
|
||||
|
||||
void TestDevice::doShutDown() {
|
||||
if (fullInfoPrintout) {
|
||||
FSFW_FLOGI("TestDevice {} | doShutDown: Switching Off\n", deviceIdx);
|
||||
FSFW_LOGI("TestDevice {} | doShutDown: Switching Off\n", deviceIdx);
|
||||
}
|
||||
|
||||
setMode(_MODE_SHUT_DOWN);
|
||||
@ -53,7 +53,7 @@ ReturnValue_t TestDevice::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||
ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
if (mode == _MODE_TO_ON) {
|
||||
if (fullInfoPrintout) {
|
||||
FSFW_FLOGI(
|
||||
FSFW_LOGI(
|
||||
"TestDevice {} | buildTransitionDeviceCommand: Was called"
|
||||
" from _MODE_TO_ON mode\n",
|
||||
deviceIdx);
|
||||
@ -61,7 +61,7 @@ ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
}
|
||||
if (mode == _MODE_TO_NORMAL) {
|
||||
if (fullInfoPrintout) {
|
||||
FSFW_FLOGI(
|
||||
FSFW_LOGI(
|
||||
"TestDevice {} | buildTransitionDeviceCommand: Was called "
|
||||
"from _MODE_TO_NORMAL mode\n",
|
||||
deviceIdx);
|
||||
@ -71,7 +71,7 @@ ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
}
|
||||
if (mode == _MODE_SHUT_DOWN) {
|
||||
if (fullInfoPrintout) {
|
||||
FSFW_FLOGI(
|
||||
FSFW_LOGI(
|
||||
"TestDevice {} | buildTransitionDeviceCommand: Was called "
|
||||
"from _MODE_SHUT_DOWN mode\n",
|
||||
deviceIdx);
|
||||
@ -85,7 +85,7 @@ ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
void TestDevice::doTransition(Mode_t modeFrom, Submode_t submodeFrom) {
|
||||
if (mode == _MODE_TO_NORMAL) {
|
||||
if (fullInfoPrintout) {
|
||||
FSFW_FLOGI(
|
||||
FSFW_LOGI(
|
||||
"TestDevice {} | doTransition: Custom transition to "
|
||||
"normal mode\n",
|
||||
deviceIdx);
|
||||
|
@ -3,6 +3,6 @@
|
||||
#include "fsfw/serviceinterface.h"
|
||||
|
||||
ReturnValue_t unitt::put_error(const std::string& errorId) {
|
||||
FSFW_FLOGET("Unit Tester error: Failed at test ID {}\n", errorId);
|
||||
FSFW_LOGET("Unit Tester error: Failed at test ID {}\n", errorId);
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user