complete iostream log replacements
This commit is contained in:
parent
0e619e3327
commit
b7fda13b4b
@ -27,7 +27,7 @@ ReturnValue_t pst::pollingSequenceExamples(FixedTimeslotTaskIF* thisSequence) {
|
|||||||
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "pst::pollingSequenceInitFunction: Initialization errors!" << std::endl;
|
FSFW_LOGE("pst::pollingSequenceInitFunction: Initialization errors\n");
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,11 +53,7 @@ ReturnValue_t pst::pollingSequenceDevices(FixedTimeslotTaskIF* thisSequence) {
|
|||||||
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
} else {
|
} else {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
FSFW_LOGE("pst::pollingSequenceTestFunction: Initialization errors\n");
|
||||||
std::cerr << "pst::pollingSequenceTestFunction: Initialization errors!" << std::endl;
|
|
||||||
#else
|
|
||||||
sif::printError("pst::pollingSequenceTestFunction: Initialization errors!\n");
|
|
||||||
#endif
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@ void FsfwTestController::performControlOperation() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PoolReadGuard readHelper(&deviceDataset0.testUint8Var);
|
PoolReadGuard readHelper(&deviceDataset0.testUint8Var);
|
||||||
FSFW_FLOGI("Tracing device 0 variable 0 (UINT8), current value: {}",
|
FSFW_LOGI("Tracing device 0 variable 0 (UINT8), current value: {}",
|
||||||
static_cast<int>(deviceDataset0.testUint8Var.value));
|
static_cast<int>(deviceDataset0.testUint8Var.value));
|
||||||
traceCounter--;
|
traceCounter--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -108,8 +108,8 @@ void FsfwTestController::handleChangedDataset(sid_t sid, store_address_t storeId
|
|||||||
} else {
|
} else {
|
||||||
printout = "Snapshot";
|
printout = "Snapshot";
|
||||||
}
|
}
|
||||||
FSFW_FLOGI("handleChangedDataset: {} update from object ID {:#08x} and set ID {}\n", printout,
|
FSFW_LOGI("handleChangedDataset: {} update from object ID {:#08x} and set ID {}\n", printout,
|
||||||
sid.objectId, sid.ownerSetId);
|
sid.objectId, sid.ownerSetId);
|
||||||
|
|
||||||
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
||||||
if (sid.objectId == device0Id) {
|
if (sid.objectId == device0Id) {
|
||||||
@ -118,13 +118,8 @@ void FsfwTestController::handleChangedDataset(sid_t sid, store_address_t storeId
|
|||||||
floatVec[0] = deviceDataset0.testFloat3Vec.value[0];
|
floatVec[0] = deviceDataset0.testFloat3Vec.value[0];
|
||||||
floatVec[1] = deviceDataset0.testFloat3Vec.value[1];
|
floatVec[1] = deviceDataset0.testFloat3Vec.value[1];
|
||||||
floatVec[2] = deviceDataset0.testFloat3Vec.value[2];
|
floatVec[2] = deviceDataset0.testFloat3Vec.value[2];
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
FSFW_LOGI("Current float vector (3) values: [{},{},{}]\n", floatVec[0], floatVec[1],
|
||||||
std::cout << "Current float vector (3) values: [" << floatVec[0] << ", " << floatVec[1]
|
floatVec[2]);
|
||||||
<< ", " << floatVec[2] << "]" << std::endl;
|
|
||||||
#else
|
|
||||||
sif::printInfo("Current float vector (3) values: [%f, %f, %f]\n", floatVec[0], floatVec[1],
|
|
||||||
floatVec[2]);
|
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,29 +144,16 @@ void FsfwTestController::handleChangedPoolVariable(gp_id_t globPoolId, store_add
|
|||||||
printout = "Snapshot";
|
printout = "Snapshot";
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
FSFW_LOGI(
|
||||||
std::cout << "TestController::handleChangedPoolVariable: " << printout
|
"TestController::handleChangedPoolVariable: {} update from object "
|
||||||
<< " update from object "
|
"ID {:#010x} and LPID {}\n",
|
||||||
"ID 0x"
|
|
||||||
<< setw(8) << setfill('0') << hex << globPoolId.objectId << " and local pool ID "
|
|
||||||
<< globPoolId.localPoolId << dec << setfill(' ') << endl;
|
|
||||||
#else
|
|
||||||
sif::printInfo(
|
|
||||||
"TestController::handleChangedPoolVariable: %s update from object ID 0x%08x and "
|
|
||||||
"local pool ID %lu\n",
|
|
||||||
printout, globPoolId.objectId, globPoolId.localPoolId);
|
printout, globPoolId.objectId, globPoolId.localPoolId);
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
|
||||||
|
|
||||||
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
||||||
if (globPoolId.objectId == device0Id) {
|
if (globPoolId.objectId == device0Id) {
|
||||||
PoolReadGuard readHelper(&deviceDataset0.testUint8Var);
|
PoolReadGuard readHelper(&deviceDataset0.testUint8Var);
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
FSFW_LOGI("Current test variable 0 (UINT8) value: {}",
|
||||||
std::cout << "Current test variable 0 (UINT8) value: "
|
static_cast<int>(deviceDataset0.testUint8Var.value));
|
||||||
<< static_cast<int>(deviceDataset0.testUint8Var.value) << std::endl;
|
|
||||||
#else
|
|
||||||
sif::printInfo("Current test variable 0 (UINT8) value %d\n",
|
|
||||||
deviceDataset0.testUint8Var.value);
|
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <fsfw/ipc/CommandMessage.h>
|
#include <fsfw/ipc/CommandMessage.h>
|
||||||
#include <fsfw/ipc/QueueFactory.h>
|
#include <fsfw/ipc/QueueFactory.h>
|
||||||
#include <fsfw/objectmanager/ObjectManager.h>
|
#include <fsfw/objectmanager/ObjectManager.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
#include <fsfw/serviceinterface.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
@ -82,14 +82,14 @@ ReturnValue_t FsfwExampleTask::initialize() {
|
|||||||
object_id_t sender = getSender();
|
object_id_t sender = getSender();
|
||||||
auto* senderIF = ObjectManager::instance()->get<HasLocalDataPoolIF>(sender);
|
auto* senderIF = ObjectManager::instance()->get<HasLocalDataPoolIF>(sender);
|
||||||
if (senderIF == nullptr) {
|
if (senderIF == nullptr) {
|
||||||
std::cerr << "FsfwDemoTask::initialize: Sender object invalid!" << std::endl;
|
FSFW_LOGE("initialize: Sender object invalid\n");
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need a private copy of the previous dataset.. or we use the shared dataset.
|
// we need a private copy of the previous dataset.. or we use the shared dataset.
|
||||||
senderSet = new FsfwDemoSet(senderIF);
|
senderSet = new FsfwDemoSet(senderIF);
|
||||||
if (senderSet == nullptr) {
|
if (senderSet == nullptr) {
|
||||||
std::cerr << "FsfwDemoTask::initialize: Sender dataset invalid!" << std::endl;
|
FSFW_LOGE("initialize: Sender dataset invalid\n");
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
return poolManager.initialize(commandQueue);
|
return poolManager.initialize(commandQueue);
|
||||||
@ -120,7 +120,7 @@ ReturnValue_t FsfwExampleTask::performMonitoringDemo() {
|
|||||||
ReturnValue_t result = demoSet.variableLimit.read(MutexIF::TimeoutType::WAITING, 20);
|
ReturnValue_t result = demoSet.variableLimit.read(MutexIF::TimeoutType::WAITING, 20);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
/* Configuration error */
|
/* Configuration error */
|
||||||
std::cerr << "DummyObject::performOperation: Could not read variableLimit!" << std::endl;
|
FSFW_LOGE("DummyObject::performOperation: Could not read variableLimit\n");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (this->getObjectId() == objects::TEST_DUMMY_5) {
|
if (this->getObjectId() == objects::TEST_DUMMY_5) {
|
||||||
@ -128,7 +128,7 @@ ReturnValue_t FsfwExampleTask::performMonitoringDemo() {
|
|||||||
demoSet.variableLimit.value = 0;
|
demoSet.variableLimit.value = 0;
|
||||||
}
|
}
|
||||||
demoSet.variableLimit.value++;
|
demoSet.variableLimit.value++;
|
||||||
demoSet.variableLimit.commit(20);
|
demoSet.variableLimit.commit(true);
|
||||||
monitor.check();
|
monitor.check();
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
@ -136,10 +136,10 @@ ReturnValue_t FsfwExampleTask::performMonitoringDemo() {
|
|||||||
|
|
||||||
ReturnValue_t FsfwExampleTask::performSendOperation() {
|
ReturnValue_t FsfwExampleTask::performSendOperation() {
|
||||||
object_id_t nextRecipient = getNextRecipient();
|
object_id_t nextRecipient = getNextRecipient();
|
||||||
FsfwExampleTask* target = ObjectManager::instance()->get<FsfwExampleTask>(nextRecipient);
|
auto* target = ObjectManager::instance()->get<FsfwExampleTask>(nextRecipient);
|
||||||
if (target == nullptr) {
|
if (target == nullptr) {
|
||||||
/* Configuration error */
|
/* Configuration error */
|
||||||
std::cerr << "DummyObject::performOperation: Next recipient does not exist!" << std::endl;
|
FSFW_LOGE("performSendOperation: Next recipient does not exist\n");
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,18 +151,18 @@ ReturnValue_t FsfwExampleTask::performSendOperation() {
|
|||||||
/* Send message using own message queue */
|
/* Send message using own message queue */
|
||||||
ReturnValue_t result = commandQueue->sendMessage(target->getMessageQueueId(), &message);
|
ReturnValue_t result = commandQueue->sendMessage(target->getMessageQueueId(), &message);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK && result != MessageQueueIF::FULL) {
|
if (result != HasReturnvaluesIF::RETURN_OK && result != MessageQueueIF::FULL) {
|
||||||
std::cerr << "FsfwDemoTask::performSendOperation: Send failed with " << result << std::endl;
|
FSFW_LOGE("performSendOperation: Send failed with {:#06x}\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send message without via MessageQueueSenderIF */
|
/* Send message without via MessageQueueSenderIF */
|
||||||
result = MessageQueueSenderIF::sendMessage(target->getMessageQueueId(), &message,
|
result = MessageQueueSenderIF::sendMessage(target->getMessageQueueId(), &message,
|
||||||
commandQueue->getId());
|
commandQueue->getId());
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK && result != MessageQueueIF::FULL) {
|
if (result != HasReturnvaluesIF::RETURN_OK && result != MessageQueueIF::FULL) {
|
||||||
std::cerr << "FsfwDemoTask::performSendOperation: Send failed with " << result << std::endl;
|
FSFW_LOGE("performSendOperation: Send failed with {:#06x}\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
demoSet.variableWrite.value = randomNumber;
|
demoSet.variableWrite.value = randomNumber;
|
||||||
result = demoSet.variableWrite.commit(20);
|
result = demoSet.variableWrite.commit(true);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ ReturnValue_t FsfwExampleTask::performReceiveOperation() {
|
|||||||
CommandMessage receivedMessage;
|
CommandMessage receivedMessage;
|
||||||
result = commandQueue->receiveMessage(&receivedMessage);
|
result = commandQueue->receiveMessage(&receivedMessage);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK && result != MessageQueueIF::EMPTY) {
|
if (result != HasReturnvaluesIF::RETURN_OK && result != MessageQueueIF::EMPTY) {
|
||||||
FSFW_FLOGD("performReceiveOperation: Receive failed with {}\n", result);
|
FSFW_LOGD("performReceiveOperation: Receive failed with {}\n", result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (result != MessageQueueIF::EMPTY) {
|
if (result != MessageQueueIF::EMPTY) {
|
||||||
@ -194,13 +194,10 @@ ReturnValue_t FsfwExampleTask::performReceiveOperation() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (senderSet->variableRead.value != receivedMessage.getParameter()) {
|
if (senderSet->variableRead.value != receivedMessage.getParameter()) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
FSFW_LOGE(
|
||||||
std::cerr << "FsfwDemoTask::performReceiveOperation: Variable " << std::hex << "0x"
|
"FsfwDemoTask::performReceiveOperation: Variable {} has wrong value {}, expected {}\n",
|
||||||
<< senderSet->variableRead.getDataPoolId() << std::dec << " has wrong value."
|
senderSet->variableRead.getDataPoolId(), demoSet.variableRead.value,
|
||||||
<< std::endl;
|
receivedMessage.getParameter());
|
||||||
std::cerr << "Value: " << demoSet.variableRead.value
|
|
||||||
<< ", expected: " << receivedMessage.getParameter() << std::endl;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <OBSWConfig.h>
|
#include <OBSWConfig.h>
|
||||||
#include <fsfw/datapool/PoolReadGuard.h>
|
#include <fsfw/datapool/PoolReadGuard.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
#include <fsfw/serviceinterface.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
#include <fsfw/timemanager/Stopwatch.h>
|
#include <fsfw/timemanager/Stopwatch.h>
|
||||||
|
|
||||||
@ -32,23 +32,11 @@ ReturnValue_t FsfwReaderTask::performOperation(uint8_t operationCode) {
|
|||||||
uint32_t variable2 = readSet.variable2.value;
|
uint32_t variable2 = readSet.variable2.value;
|
||||||
uint32_t variable3 = readSet.variable3.value;
|
uint32_t variable3 = readSet.variable3.value;
|
||||||
|
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
|
||||||
if (opDivider.checkAndIncrement() and printoutEnabled) {
|
if (opDivider.checkAndIncrement() and printoutEnabled) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
FSFW_LOGI(
|
||||||
std::cout << "FsfwPeriodicTask::performOperation: Reading variables." << std::endl;
|
"FsfwPeriodicTask::performOperation: Reading variables from Demo "
|
||||||
std::cout << "Variable read from demo object 1: " << variable1 << std::endl;
|
"Object 1,2,3\n1 {} | 2 {} | 3 {}\n",
|
||||||
std::cout << "Variable read from demo object 2: " << variable2 << std::endl;
|
variable1, variable2, variable3);
|
||||||
std::cout << "Variable read from demo object 3: " << variable3 << std::endl;
|
|
||||||
#else
|
|
||||||
sif::printInfo("FsfwPeriodicTask::performOperation: Reading variables.\n\r");
|
|
||||||
sif::printInfo("Variable read from demo object 1: %d\n\r", variable1);
|
|
||||||
sif::printInfo("Variable read from demo object 2: %d\n\r", variable2);
|
|
||||||
sif::printInfo("Variable read from demo object 3: %d\n\r", variable3);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (variable1 and variable2 and variable3) {
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
FsfwTestTask::FsfwTestTask(object_id_t objectId, bool periodicEvent)
|
FsfwTestTask::FsfwTestTask(object_id_t objectId, bool periodicEvent)
|
||||||
: TestTask(objectId), periodicEvent(periodicEvent) {
|
: TestTask(objectId), periodicEvent(periodicEvent) {
|
||||||
#if FSFW_ADD_FMT_TESTS == 1
|
#if FSFW_ADD_FMT_TESTS == 1
|
||||||
fmtTests();
|
// fmtTests();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,21 +9,21 @@ void MutexExample::example() {
|
|||||||
|
|
||||||
ReturnValue_t result = mutex->lockMutex(MutexIF::TimeoutType::WAITING, 2 * 60 * 1000);
|
ReturnValue_t result = mutex->lockMutex(MutexIF::TimeoutType::WAITING, 2 * 60 * 1000);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_FLOGET("MutexExample::example: Lock Failed with {}\n", result);
|
FSFW_LOGET("MutexExample::example: Lock Failed with {}\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = mutex2->lockMutex(MutexIF::TimeoutType::BLOCKING);
|
result = mutex2->lockMutex(MutexIF::TimeoutType::BLOCKING);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_FLOGET("MutexExample::example: Lock Failed with {}\n", result);
|
FSFW_LOGET("MutexExample::example: Lock Failed with {}\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = mutex->unlockMutex();
|
result = mutex->unlockMutex();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_FLOGET("MutexExample::example: Unlock Failed with {}\n", result);
|
FSFW_LOGET("MutexExample::example: Unlock Failed with {}\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = mutex2->unlockMutex();
|
result = mutex2->unlockMutex();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_FLOGET("MutexExample::example: Unlock Failed with {}\n", result);
|
FSFW_LOGET("MutexExample::example: Unlock Failed with {}\n", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,17 @@ void fmtTests() {
|
|||||||
sif::initialize();
|
sif::initialize();
|
||||||
sif::debug(__FILENAME__, __LINE__, "Hello {}", "World\n");
|
sif::debug(__FILENAME__, __LINE__, "Hello {}", "World\n");
|
||||||
sif::debug_t(__FILENAME__, __LINE__, "Hallo\n");
|
sif::debug_t(__FILENAME__, __LINE__, "Hallo\n");
|
||||||
FSFW_FLOGD("{}", "Hallo\n");
|
FSFW_LOGD("{}", "Hallo\n");
|
||||||
sif::info_t("Hallo\n");
|
sif::info_t("Hallo\n");
|
||||||
sif::info("Hallo\n");
|
sif::info("Hallo\n");
|
||||||
sif::warning_s(__FILENAME__, __LINE__, "Hello\n");
|
sif::warning_s(__FILENAME__, __LINE__, "Hello\n");
|
||||||
sif::warning_st(__FILENAME__, __LINE__, "Hello\n");
|
sif::warning_st(__FILENAME__, __LINE__, "Hello\n");
|
||||||
|
FSFW_LOGW("Hello World\n");
|
||||||
|
FSFW_LOGW("{} World\n", "Hello");
|
||||||
|
uint8_t test0 = 5;
|
||||||
|
float test1 = 12.0;
|
||||||
|
uint32_t test2 = 0x00ff11ff;
|
||||||
|
FSFW_LOGW("Test 0 {} | Test 1 {:.3f} | Test 2 {:#010x}\n", test0, test1, test2);
|
||||||
sif::error_s(__FILENAME__, __LINE__, "Hello\n");
|
sif::error_s(__FILENAME__, __LINE__, "Hello\n");
|
||||||
sif::error_st(__FILENAME__, __LINE__, "Hello\n");
|
sif::error_st(__FILENAME__, __LINE__, "Hello\n");
|
||||||
}
|
}
|
@ -164,10 +164,10 @@ void fmtTests();
|
|||||||
//
|
//
|
||||||
//#define FSFW_FLOGIT(format, ...) finfo_t(FMT_STRING(format), __VA_ARGS__)
|
//#define FSFW_FLOGIT(format, ...) finfo_t(FMT_STRING(format), __VA_ARGS__)
|
||||||
//
|
//
|
||||||
//#define FSFW_FLOGD(format, ...) sif::fdebug(__FILENAME__, __LINE__, FMT_STRING(format),
|
//#define FSFW_LOGD(format, ...) sif::fdebug(__FILENAME__, __LINE__, FMT_STRING(format),
|
||||||
//__VA_ARGS__)
|
//__VA_ARGS__)
|
||||||
//
|
//
|
||||||
//#define FSFW_FLOGDT(format, ...) fdebug_t(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
//#define FSFW_LOGDT(format, ...) fdebug_t(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||||
//
|
//
|
||||||
//#define FSFW_FLOGW(format, ...) fdebug(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
//#define FSFW_FLOGW(format, ...) fdebug(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__)
|
||||||
//
|
//
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
namespace task {
|
namespace task {
|
||||||
|
|
||||||
void printInitError(const char* objName, object_id_t objectId) {
|
void printInitError(const char* objName, object_id_t objectId) {
|
||||||
FSFW_FLOGW("InitMission: Adding object {} ({:#08x}) failed\n", objName, objectId);
|
FSFW_LOGW("InitMission: Adding object {} ({:#08x}) failed\n", objName, objectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace task
|
} // namespace task
|
||||||
|
@ -56,7 +56,7 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) {
|
|||||||
result = tmQueue->sendToDefault(message);
|
result = tmQueue->sendToDefault(message);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
tmPool->deleteData(message->getStorageId());
|
tmPool->deleteData(message->getStorageId());
|
||||||
FSFW_FLOGET("{}", "handlePacket: Error sending to downlink handler\n");
|
FSFW_LOGET("{}", "handlePacket: Error sending to downlink handler\n");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) {
|
|||||||
result = storageQueue->sendToDefault(message);
|
result = storageQueue->sendToDefault(message);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
tmPool->deleteData(message->getStorageId());
|
tmPool->deleteData(message->getStorageId());
|
||||||
FSFW_FLOGET("{}", "handlePacket: Error sending to storage handler\n");
|
FSFW_LOGET("{}", "handlePacket: Error sending to storage handler\n");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,18 +74,18 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) {
|
|||||||
ReturnValue_t TmFunnel::initialize() {
|
ReturnValue_t TmFunnel::initialize() {
|
||||||
tmPool = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
|
tmPool = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
|
||||||
if (tmPool == nullptr) {
|
if (tmPool == nullptr) {
|
||||||
FSFW_FLOGE("{}",
|
FSFW_LOGE("{}",
|
||||||
"initialize: TM store not set\n"
|
"initialize: TM store not set\n"
|
||||||
"Make sure the tm store is set up properly and implements StorageManagerIF");
|
"Make sure the tm store is set up properly and implements StorageManagerIF");
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* tmTarget = ObjectManager::instance()->get<AcceptsTelemetryIF>(downlinkDestination);
|
auto* tmTarget = ObjectManager::instance()->get<AcceptsTelemetryIF>(downlinkDestination);
|
||||||
if (tmTarget == nullptr) {
|
if (tmTarget == nullptr) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
FSFW_FLOGE("{}",
|
FSFW_LOGE("{}",
|
||||||
"initialize: Downlink Destination not set. Make sure the downlink destination "
|
"initialize: Downlink Destination not set. Make sure the downlink destination "
|
||||||
"object is set up properly and implements AcceptsTelemetryIF\n");
|
"object is set up properly and implements AcceptsTelemetryIF\n");
|
||||||
#endif
|
#endif
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
|
|
||||||
#include <FSFWConfig.h>
|
|
||||||
#include <OBSWVersion.h>
|
#include <OBSWVersion.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
|
||||||
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
void utility::commonInitPrint(const char* const os, const char* const board) {
|
void utility::commonInitPrint(const char* const os, const char* const board) {
|
||||||
if (os == nullptr or board == nullptr) {
|
if (os == nullptr or board == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
fmt::print("-- FSFW Example ({}) v{}.{}.{} --\n", os, FSFW_EXAMPLE_VERSION,
|
||||||
std::cout << "-- FSFW Example (" << os << ") v" << FSFW_EXAMPLE_VERSION << "."
|
FSFW_EXAMPLE_SUBVERSION, FSFW_EXAMPLE_REVISION);
|
||||||
<< FSFW_EXAMPLE_SUBVERSION << "." << FSFW_EXAMPLE_REVISION << " --" << std::endl;
|
fmt::print("-- Compiled for {}\n", board);
|
||||||
std::cout << "-- Compiled for " << board << " --" << std::endl;
|
fmt::print("-- Compiled on {} {}\n", __DATE__, __TIME__);
|
||||||
std::cout << "-- Compiled on " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
sif::initialize();
|
||||||
#else
|
|
||||||
printf("\n\r-- FSFW Example (%s) v%d.%d.%d --\n", os, FSFW_EXAMPLE_VERSION,
|
|
||||||
FSFW_EXAMPLE_SUBVERSION, FSFW_EXAMPLE_REVISION);
|
|
||||||
printf("-- Compiled for %s --\n", board);
|
|
||||||
printf("-- Compiled on %s %s --\n", __DATE__, __TIME__);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user