add printf support
This commit is contained in:
parent
f42a16748d
commit
cb6eed134b
@ -109,13 +109,15 @@ void ObjectManager::initialize() {
|
|||||||
for (auto const& it : objectList) {
|
for (auto const& it : objectList) {
|
||||||
result = it.second->initialize();
|
result = it.second->initialize();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
|
||||||
object_id_t var = it.first;
|
object_id_t var = it.first;
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "ObjectManager::initialize: Object 0x" << std::hex << std::setw(8)
|
sif::error << "ObjectManager::initialize: Object 0x" << std::hex << std::setw(8)
|
||||||
<< std::setfill('0') << var
|
<< std::setfill('0') << var
|
||||||
<< " failed to "
|
<< " failed to "
|
||||||
"initialize with code 0x"
|
"initialize with code 0x"
|
||||||
<< result << std::dec << std::setfill(' ') << std::endl;
|
<< result << std::dec << std::setfill(' ') << std::endl;
|
||||||
|
#else
|
||||||
|
sif::printError("ObjectManager::initialize: Object 0x%08x failed to initialize with code 0x%04x\n", var, result);
|
||||||
#endif
|
#endif
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
@ -124,6 +126,8 @@ void ObjectManager::initialize() {
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "ObjectManager::ObjectManager: Counted " << errorCount
|
sif::error << "ObjectManager::ObjectManager: Counted " << errorCount
|
||||||
<< " failed initializations." << std::endl;
|
<< " failed initializations." << std::endl;
|
||||||
|
#else
|
||||||
|
sif::printError("ObjectManager: Counted %d\n", errorCount);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// Init was successful. Now check successful interconnections.
|
// Init was successful. Now check successful interconnections.
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
|
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
|
||||||
|
|
||||||
#define CCSDS_DISTRIBUTOR_DEBUGGING 0
|
#define CCSDS_DISTRIBUTOR_DEBUGGING 1
|
||||||
|
|
||||||
CcsdsDistributor::CcsdsDistributor(uint16_t setDefaultApid, object_id_t setObjectId,
|
CcsdsDistributor::CcsdsDistributor(uint16_t setDefaultApid, object_id_t setObjectId,
|
||||||
StorageManagerIF* tcStore, MessageQueueIF* queue,
|
StorageManagerIF* tcStore, MessageQueueIF* queue,
|
||||||
@ -68,9 +68,13 @@ ReturnValue_t CcsdsDistributor::selectDestination(MessageQueueId_t& destId) {
|
|||||||
handlePacketCheckFailure(result);
|
handlePacketCheckFailure(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1 && CCSDS_DISTRIBUTOR_DEBUGGING == 1
|
#if CCSDS_DISTRIBUTOR_DEBUGGING == 1
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::info << "CCSDSDistributor::selectDestination has packet with APID 0x" << std::hex
|
sif::info << "CCSDSDistributor::selectDestination has packet with APID 0x" << std::hex
|
||||||
<< currentPacket.getApid() << std::dec << std::endl;
|
<< currentPacket.getApid() << std::dec << std::endl;
|
||||||
|
#else
|
||||||
|
sif::printDebug("CCSDS Distributor: Packet with APID 0x%04x detected\n", currentPacket.getApid());
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
auto iter = receiverMap.find(currentPacket.getApid());
|
auto iter = receiverMap.find(currentPacket.getApid());
|
||||||
if (iter != receiverMap.end()) {
|
if (iter != receiverMap.end()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user