Merge remote-tracking branch 'upstream/mueller/master' into mueller/master
This commit is contained in:
commit
3242264a77
@ -73,8 +73,8 @@ void PoolEntry<T>::print() {
|
|||||||
sif::info << "PoolEntry information." << std::endl;
|
sif::info << "PoolEntry information." << std::endl;
|
||||||
sif::info << "PoolEntry validity: " << validString << std::endl;
|
sif::info << "PoolEntry validity: " << validString << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printInfo("PoolEntry information.\n");
|
sif::printInfo("PoolEntry information.\n");
|
||||||
fsfw::printInfo("PoolEntry validity: %s\n", validString);
|
sif::printInfo("PoolEntry validity: %s\n", validString);
|
||||||
#endif
|
#endif
|
||||||
arrayprinter::print(reinterpret_cast<uint8_t*>(address), getByteSize());
|
arrayprinter::print(reinterpret_cast<uint8_t*>(address), getByteSize());
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ protected:
|
|||||||
sif::warning << "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden"
|
sif::warning << "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden"
|
||||||
<< ". Returning nullptr!" << std::endl;
|
<< ". Returning nullptr!" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("HasLocalDataPoolIF::getPoolObjectHandle: "
|
sif::printWarning("HasLocalDataPoolIF::getPoolObjectHandle: "
|
||||||
"Not overriden. Returning nullptr!\n");
|
"Not overriden. Returning nullptr!\n");
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -21,7 +21,7 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner, MessageQue
|
|||||||
bool appendValidityBuffer):
|
bool appendValidityBuffer):
|
||||||
appendValidityBuffer(appendValidityBuffer) {
|
appendValidityBuffer(appendValidityBuffer) {
|
||||||
if(owner == nullptr) {
|
if(owner == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"LocalDataPoolManager", HasReturnvaluesIF::RETURN_FAILED,
|
"LocalDataPoolManager", HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"Invalid supplied owner");
|
"Invalid supplied owner");
|
||||||
return;
|
return;
|
||||||
@ -29,7 +29,7 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner, MessageQue
|
|||||||
this->owner = owner;
|
this->owner = owner;
|
||||||
mutex = MutexFactory::instance()->createMutex();
|
mutex = MutexFactory::instance()->createMutex();
|
||||||
if(mutex == nullptr) {
|
if(mutex == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"LocalDataPoolManager", HasReturnvaluesIF::RETURN_FAILED,
|
"LocalDataPoolManager", HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"Could not create mutex");
|
"Could not create mutex");
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ LocalDataPoolManager::~LocalDataPoolManager() {}
|
|||||||
ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) {
|
ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) {
|
||||||
if(queueToUse == nullptr) {
|
if(queueToUse == nullptr) {
|
||||||
// error, all destinations invalid
|
// error, all destinations invalid
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"initialize", QUEUE_OR_DESTINATION_INVALID);
|
"initialize", QUEUE_OR_DESTINATION_INVALID);
|
||||||
}
|
}
|
||||||
hkQueue = queueToUse;
|
hkQueue = queueToUse;
|
||||||
@ -50,7 +50,7 @@ ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) {
|
|||||||
ipcStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
ipcStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
if(ipcStore == nullptr) {
|
if(ipcStore == nullptr) {
|
||||||
// error, all destinations invalid
|
// error, all destinations invalid
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"initialize", HasReturnvaluesIF::RETURN_FAILED,
|
"initialize", HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"Could not set IPC store.");
|
"Could not set IPC store.");
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
@ -64,7 +64,7 @@ ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) {
|
|||||||
hkDestinationId = hkPacketReceiver->getHkQueue();
|
hkDestinationId = hkPacketReceiver->getHkQueue();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"initialize", QUEUE_OR_DESTINATION_INVALID);
|
"initialize", QUEUE_OR_DESTINATION_INVALID);
|
||||||
return QUEUE_OR_DESTINATION_INVALID;
|
return QUEUE_OR_DESTINATION_INVALID;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ ReturnValue_t LocalDataPoolManager::initializeHousekeepingPoolEntriesOnce() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"initialize", HasReturnvaluesIF::RETURN_FAILED,
|
"initialize", HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"The map should only be initialized once");
|
"The map should only be initialized once");
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
@ -157,7 +157,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receive
|
|||||||
receiver.dataId.localPoolId);
|
receiver.dataId.localPoolId);
|
||||||
//LocalPoolObjectBase* poolObj = owner->getPoolObjectHandle(receiver.dataId.localPoolId);
|
//LocalPoolObjectBase* poolObj = owner->getPoolObjectHandle(receiver.dataId.localPoolId);
|
||||||
if(poolObj == nullptr) {
|
if(poolObj == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"handleNotificationUpdate", POOLOBJECT_NOT_FOUND);
|
"handleNotificationUpdate", POOLOBJECT_NOT_FOUND);
|
||||||
return POOLOBJECT_NOT_FOUND;
|
return POOLOBJECT_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@ -179,7 +179,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receive
|
|||||||
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner,
|
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner,
|
||||||
receiver.dataId.sid);
|
receiver.dataId.sid);
|
||||||
if(dataSet == nullptr) {
|
if(dataSet == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"handleNotificationUpdate", DATASET_NOT_FOUND);
|
"handleNotificationUpdate", DATASET_NOT_FOUND);
|
||||||
return DATASET_NOT_FOUND;
|
return DATASET_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
|
|||||||
LocalPoolObjectBase* poolObj = HasLocalDpIFManagerAttorney::getPoolObjectHandle(owner,
|
LocalPoolObjectBase* poolObj = HasLocalDpIFManagerAttorney::getPoolObjectHandle(owner,
|
||||||
receiver.dataId.localPoolId);
|
receiver.dataId.localPoolId);
|
||||||
if(poolObj == nullptr) {
|
if(poolObj == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"handleNotificationSnapshot", POOLOBJECT_NOT_FOUND);
|
"handleNotificationSnapshot", POOLOBJECT_NOT_FOUND);
|
||||||
return POOLOBJECT_NOT_FOUND;
|
return POOLOBJECT_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
|
|||||||
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner,
|
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner,
|
||||||
receiver.dataId.sid);
|
receiver.dataId.sid);
|
||||||
if(dataSet == nullptr) {
|
if(dataSet == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"handleNotificationSnapshot", DATASET_NOT_FOUND);
|
"handleNotificationSnapshot", DATASET_NOT_FOUND);
|
||||||
return DATASET_NOT_FOUND;
|
return DATASET_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForPeriodicPacket(sid_t sid,
|
|||||||
AcceptsHkPacketsIF* hkReceiverObject =
|
AcceptsHkPacketsIF* hkReceiverObject =
|
||||||
objectManager->get<AcceptsHkPacketsIF>(packetDestination);
|
objectManager->get<AcceptsHkPacketsIF>(packetDestination);
|
||||||
if(hkReceiverObject == nullptr) {
|
if(hkReceiverObject == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"subscribeForPeriodicPacket", QUEUE_OR_DESTINATION_INVALID);
|
"subscribeForPeriodicPacket", QUEUE_OR_DESTINATION_INVALID);
|
||||||
return QUEUE_OR_DESTINATION_INVALID;
|
return QUEUE_OR_DESTINATION_INVALID;
|
||||||
}
|
}
|
||||||
@ -389,7 +389,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForUpdatePackets(sid_t sid,
|
|||||||
AcceptsHkPacketsIF* hkReceiverObject =
|
AcceptsHkPacketsIF* hkReceiverObject =
|
||||||
objectManager->get<AcceptsHkPacketsIF>(packetDestination);
|
objectManager->get<AcceptsHkPacketsIF>(packetDestination);
|
||||||
if(hkReceiverObject == nullptr) {
|
if(hkReceiverObject == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"subscribeForPeriodicPacket", QUEUE_OR_DESTINATION_INVALID);
|
"subscribeForPeriodicPacket", QUEUE_OR_DESTINATION_INVALID);
|
||||||
return QUEUE_OR_DESTINATION_INVALID;
|
return QUEUE_OR_DESTINATION_INVALID;
|
||||||
}
|
}
|
||||||
@ -600,7 +600,7 @@ ReturnValue_t LocalDataPoolManager::printPoolEntry(
|
|||||||
lp_id_t localPoolId) {
|
lp_id_t localPoolId) {
|
||||||
auto poolIter = localPoolMap.find(localPoolId);
|
auto poolIter = localPoolMap.find(localPoolId);
|
||||||
if (poolIter == localPoolMap.end()) {
|
if (poolIter == localPoolMap.end()) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING, "printPoolEntry",
|
printWarningOrError(sif::OutputTypes::OUT_WARNING, "printPoolEntry",
|
||||||
HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND);
|
HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND);
|
||||||
return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND;
|
return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@ -621,7 +621,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
|
|||||||
MessageQueueId_t destination) {
|
MessageQueueId_t destination) {
|
||||||
if(dataSet == nullptr) {
|
if(dataSet == nullptr) {
|
||||||
// Configuration error.
|
// Configuration error.
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"generateHousekeepingPacket",
|
"generateHousekeepingPacket",
|
||||||
DATASET_NOT_FOUND);
|
DATASET_NOT_FOUND);
|
||||||
return DATASET_NOT_FOUND;
|
return DATASET_NOT_FOUND;
|
||||||
@ -647,7 +647,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
|
|||||||
|
|
||||||
if(hkQueue == nullptr) {
|
if(hkQueue == nullptr) {
|
||||||
// error, no queue available to send packet with.
|
// error, no queue available to send packet with.
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"generateHousekeepingPacket",
|
"generateHousekeepingPacket",
|
||||||
QUEUE_OR_DESTINATION_INVALID);
|
QUEUE_OR_DESTINATION_INVALID);
|
||||||
return QUEUE_OR_DESTINATION_INVALID;
|
return QUEUE_OR_DESTINATION_INVALID;
|
||||||
@ -655,7 +655,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
|
|||||||
if(destination == MessageQueueIF::NO_QUEUE) {
|
if(destination == MessageQueueIF::NO_QUEUE) {
|
||||||
if(hkDestinationId == MessageQueueIF::NO_QUEUE) {
|
if(hkDestinationId == MessageQueueIF::NO_QUEUE) {
|
||||||
// error, all destinations invalid
|
// error, all destinations invalid
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"generateHousekeepingPacket",
|
"generateHousekeepingPacket",
|
||||||
QUEUE_OR_DESTINATION_INVALID);
|
QUEUE_OR_DESTINATION_INVALID);
|
||||||
}
|
}
|
||||||
@ -695,7 +695,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
|
|||||||
//LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(sid);
|
//LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(sid);
|
||||||
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, sid);
|
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, sid);
|
||||||
if(dataSet == nullptr) {
|
if(dataSet == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"performPeriodicHkGeneration",
|
"performPeriodicHkGeneration",
|
||||||
DATASET_NOT_FOUND);
|
DATASET_NOT_FOUND);
|
||||||
return;
|
return;
|
||||||
@ -725,7 +725,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
|
|||||||
sif::warning << "LocalDataPoolManager::performHkOperation: "
|
sif::warning << "LocalDataPoolManager::performHkOperation: "
|
||||||
<< "HK generation failed." << std::endl;
|
<< "HK generation failed." << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalDataPoolManager::performHkOperation: "
|
sif::printWarning("LocalDataPoolManager::performHkOperation: "
|
||||||
"HK generation failed.\n");
|
"HK generation failed.\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -778,7 +778,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
|
|||||||
//LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(sid);
|
//LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(sid);
|
||||||
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, sid);
|
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, sid);
|
||||||
if(dataSet == nullptr) {
|
if(dataSet == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"performPeriodicHkGeneration",
|
"performPeriodicHkGeneration",
|
||||||
DATASET_NOT_FOUND);
|
DATASET_NOT_FOUND);
|
||||||
return DATASET_NOT_FOUND;
|
return DATASET_NOT_FOUND;
|
||||||
@ -805,7 +805,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
|
|||||||
ReturnValue_t result = ipcStore->getFreeElement(&storeId,
|
ReturnValue_t result = ipcStore->getFreeElement(&storeId,
|
||||||
expectedSize,&storePtr);
|
expectedSize,&storePtr);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"generateSetStructurePacket", HasReturnvaluesIF::RETURN_FAILED,
|
"generateSetStructurePacket", HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"Could not get free element from IPC store.");
|
"Could not get free element from IPC store.");
|
||||||
return result;
|
return result;
|
||||||
@ -816,7 +816,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
|
|||||||
result = setPacket.serialize(&storePtr, &size, expectedSize,
|
result = setPacket.serialize(&storePtr, &size, expectedSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
if(expectedSize != size) {
|
if(expectedSize != size) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"generateSetStructurePacket", HasReturnvaluesIF::RETURN_FAILED,
|
"generateSetStructurePacket", HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"Expected size is not equal to serialized size");
|
"Expected size is not equal to serialized size");
|
||||||
}
|
}
|
||||||
@ -850,7 +850,7 @@ object_id_t LocalDataPoolManager::getCreatorObjectId() const {
|
|||||||
//return owner->getObjectId();
|
//return owner->getObjectId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType,
|
||||||
const char* functionName, ReturnValue_t error, const char* errorPrint) {
|
const char* functionName, ReturnValue_t error, const char* errorPrint) {
|
||||||
if(errorPrint == nullptr) {
|
if(errorPrint == nullptr) {
|
||||||
if(error == DATASET_NOT_FOUND) {
|
if(error == DATASET_NOT_FOUND) {
|
||||||
@ -860,7 +860,7 @@ void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
|||||||
errorPrint = "Pool Object not found";
|
errorPrint = "Pool Object not found";
|
||||||
}
|
}
|
||||||
else if(error == HasReturnvaluesIF::RETURN_FAILED) {
|
else if(error == HasReturnvaluesIF::RETURN_FAILED) {
|
||||||
if(outputType == fsfw::OutputTypes::OUT_WARNING) {
|
if(outputType == sif::OutputTypes::OUT_WARNING) {
|
||||||
errorPrint = "Generic Warning";
|
errorPrint = "Generic Warning";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -881,25 +881,25 @@ void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(outputType == fsfw::OutputTypes::OUT_WARNING) {
|
if(outputType == sif::OutputTypes::OUT_WARNING) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "LocalDataPoolManager::" << functionName
|
sif::warning << "LocalDataPoolManager::" << functionName
|
||||||
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
||||||
<< std::hex << owner->getObjectId() << " | " << errorPrint
|
<< std::hex << owner->getObjectId() << " | " << errorPrint
|
||||||
<< std::dec << std::setfill(' ') << std::endl;
|
<< std::dec << std::setfill(' ') << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
sif::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
||||||
owner->getObjectId(), errorPrint);
|
owner->getObjectId(), errorPrint);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if(outputType == fsfw::OutputTypes::OUT_ERROR) {
|
else if(outputType == sif::OutputTypes::OUT_ERROR) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "LocalDataPoolManager::" << functionName
|
sif::error << "LocalDataPoolManager::" << functionName
|
||||||
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
||||||
<< std::hex << owner->getObjectId() << " | " << errorPrint
|
<< std::hex << owner->getObjectId() << " | " << errorPrint
|
||||||
<< std::dec << std::setfill(' ') << std::endl;
|
<< std::dec << std::setfill(' ') << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
sif::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
||||||
owner->getObjectId(), errorPrint);
|
owner->getObjectId(), errorPrint);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ private:
|
|||||||
ReturnValue_t addUpdateToStore(HousekeepingPacketUpdate& updatePacket,
|
ReturnValue_t addUpdateToStore(HousekeepingPacketUpdate& updatePacket,
|
||||||
store_address_t& storeId);
|
store_address_t& storeId);
|
||||||
|
|
||||||
void printWarningOrError(fsfw::OutputTypes outputType,
|
void printWarningOrError(sif::OutputTypes outputType,
|
||||||
const char* functionName,
|
const char* functionName,
|
||||||
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
|
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
|
||||||
const char* errorPrint = nullptr);
|
const char* errorPrint = nullptr);
|
||||||
@ -399,14 +399,14 @@ ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId,
|
|||||||
PoolEntry<T> **poolEntry) {
|
PoolEntry<T> **poolEntry) {
|
||||||
auto poolIter = localPoolMap.find(localPoolId);
|
auto poolIter = localPoolMap.find(localPoolId);
|
||||||
if (poolIter == localPoolMap.end()) {
|
if (poolIter == localPoolMap.end()) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "fetchPoolEntry",
|
printWarningOrError(sif::OutputTypes::OUT_ERROR, "fetchPoolEntry",
|
||||||
HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND);
|
HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND);
|
||||||
return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND;
|
return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
*poolEntry = dynamic_cast< PoolEntry<T>* >(poolIter->second);
|
*poolEntry = dynamic_cast< PoolEntry<T>* >(poolIter->second);
|
||||||
if(*poolEntry == nullptr) {
|
if(*poolEntry == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "fetchPoolEntry",
|
printWarningOrError(sif::OutputTypes::OUT_ERROR, "fetchPoolEntry",
|
||||||
HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT);
|
HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT);
|
||||||
return HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT;
|
return HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT;
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner,
|
|||||||
sif::error << "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
|
sif::error << "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
|
||||||
<< "invalid!" << std::endl;
|
<< "invalid!" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
|
sif::printError("LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
|
||||||
"invalid!\n");
|
"invalid!\n\r");
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t** buffer,
|
|||||||
sif::warning << "LocalPoolDataSetBase::serializeLocalPoolIds: "
|
sif::warning << "LocalPoolDataSetBase::serializeLocalPoolIds: "
|
||||||
<< "Serialization error!" << std::endl;
|
<< "Serialization error!" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalPoolDataSetBase::serializeLocalPoolIds: "
|
sif::printWarning("LocalPoolDataSetBase::serializeLocalPoolIds: "
|
||||||
"Serialization error!\n\r");
|
"Serialization error!\n\r");
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||||
return result;
|
return result;
|
||||||
@ -240,7 +240,7 @@ void LocalPoolDataSetBase::bitSetter(uint8_t* byte, uint8_t position) const {
|
|||||||
sif::warning << "LocalPoolDataSetBase::bitSetter: Invalid position!"
|
sif::warning << "LocalPoolDataSetBase::bitSetter: Invalid position!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalPoolDataSetBase::bitSetter: "
|
sif::printWarning("LocalPoolDataSetBase::bitSetter: "
|
||||||
"Invalid position!\n\r");
|
"Invalid position!\n\r");
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
|
@ -118,7 +118,7 @@ void LocalPoolObjectBase::reportReadCommitError(const char* variableType,
|
|||||||
<< std::hex << std::setw(8) << std::setfill('0') << objectId << std::dec
|
<< std::hex << std::setw(8) << std::setfill('0') << objectId << std::dec
|
||||||
<< " LPID: " << lpId << std::endl;
|
<< " LPID: " << lpId << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("%s: %s call | %s | Owner: 0x%08x LPID: %lu\n",
|
sif::printWarning("%s: %s call | %s | Owner: 0x%08x LPID: %lu\n",
|
||||||
variableType, type, errMsg, objectId, lpId);
|
variableType, type, errMsg, objectId, lpId);
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||||
#endif /* FSFW_DISABLE_PRINTOUT == 0 */
|
#endif /* FSFW_DISABLE_PRINTOUT == 0 */
|
||||||
|
@ -103,7 +103,7 @@ inline T& LocalPoolVector<T, vectorSize>::operator [](size_t i) {
|
|||||||
sif::warning << "LocalPoolVector: Invalid index. Setting or returning"
|
sif::warning << "LocalPoolVector: Invalid index. Setting or returning"
|
||||||
" last value!" << std::endl;
|
" last value!" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalPoolVector: Invalid index. Setting or returning"
|
sif::printWarning("LocalPoolVector: Invalid index. Setting or returning"
|
||||||
" last value!\n");
|
" last value!\n");
|
||||||
#endif
|
#endif
|
||||||
return value[vectorSize - 1];
|
return value[vectorSize - 1];
|
||||||
@ -120,7 +120,7 @@ inline const T& LocalPoolVector<T, vectorSize>::operator [](size_t i) const {
|
|||||||
sif::warning << "LocalPoolVector: Invalid index. Setting or returning"
|
sif::warning << "LocalPoolVector: Invalid index. Setting or returning"
|
||||||
" last value!" << std::endl;
|
" last value!" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalPoolVector: Invalid index. Setting or returning"
|
sif::printWarning("LocalPoolVector: Invalid index. Setting or returning"
|
||||||
" last value!\n");
|
" last value!\n");
|
||||||
#endif
|
#endif
|
||||||
return value[vectorSize - 1];
|
return value[vectorSize - 1];
|
||||||
|
@ -36,7 +36,7 @@ DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId,
|
|||||||
cookieInfo.state = COOKIE_UNUSED;
|
cookieInfo.state = COOKIE_UNUSED;
|
||||||
cookieInfo.pendingCommand = deviceCommandMap.end();
|
cookieInfo.pendingCommand = deviceCommandMap.end();
|
||||||
if (comCookie == nullptr) {
|
if (comCookie == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "DeviceHandlerBase",
|
printWarningOrError(sif::OutputTypes::OUT_ERROR, "DeviceHandlerBase",
|
||||||
HasReturnvaluesIF::RETURN_FAILED, "Invalid cookie");
|
HasReturnvaluesIF::RETURN_FAILED, "Invalid cookie");
|
||||||
}
|
}
|
||||||
if (this->fdirInstance == nullptr) {
|
if (this->fdirInstance == nullptr) {
|
||||||
@ -124,7 +124,7 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
communicationInterface = objectManager->get<DeviceCommunicationIF>(
|
communicationInterface = objectManager->get<DeviceCommunicationIF>(
|
||||||
deviceCommunicationId);
|
deviceCommunicationId);
|
||||||
if (communicationInterface == nullptr) {
|
if (communicationInterface == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "initialize",
|
printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize",
|
||||||
ObjectManagerIF::CHILD_INIT_FAILED,
|
ObjectManagerIF::CHILD_INIT_FAILED,
|
||||||
"Passed communication IF invalid");
|
"Passed communication IF invalid");
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
@ -132,7 +132,7 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
|
|
||||||
result = communicationInterface->initializeInterface(comCookie);
|
result = communicationInterface->initializeInterface(comCookie);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "initialize",
|
printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize",
|
||||||
ObjectManagerIF::CHILD_INIT_FAILED,
|
ObjectManagerIF::CHILD_INIT_FAILED,
|
||||||
"ComIF initialization failed");
|
"ComIF initialization failed");
|
||||||
return result;
|
return result;
|
||||||
@ -140,7 +140,7 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
|
|
||||||
IPCStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
IPCStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
if (IPCStore == nullptr) {
|
if (IPCStore == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR, "initialize",
|
printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize",
|
||||||
ObjectManagerIF::CHILD_INIT_FAILED, "IPC Store not set up");
|
ObjectManagerIF::CHILD_INIT_FAILED, "IPC Store not set up");
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
@ -150,14 +150,14 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
AcceptsDeviceResponsesIF>(rawDataReceiverId);
|
AcceptsDeviceResponsesIF>(rawDataReceiverId);
|
||||||
|
|
||||||
if (rawReceiver == nullptr) {
|
if (rawReceiver == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"initialize", ObjectManagerIF::CHILD_INIT_FAILED,
|
"initialize", ObjectManagerIF::CHILD_INIT_FAILED,
|
||||||
"Raw receiver object ID set but no valid object found.");
|
"Raw receiver object ID set but no valid object found.");
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "Make sure the raw receiver object is set up properly"
|
sif::error << "Make sure the raw receiver object is set up properly"
|
||||||
" and implements AcceptsDeviceResponsesIF" << std::endl;
|
" and implements AcceptsDeviceResponsesIF" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("Make sure the raw receiver object is set up "
|
sif::printError("Make sure the raw receiver object is set up "
|
||||||
"properly and implements AcceptsDeviceResponsesIF\n");
|
"properly and implements AcceptsDeviceResponsesIF\n");
|
||||||
#endif
|
#endif
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
@ -168,14 +168,14 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
if(powerSwitcherId != objects::NO_OBJECT) {
|
if(powerSwitcherId != objects::NO_OBJECT) {
|
||||||
powerSwitcher = objectManager->get<PowerSwitchIF>(powerSwitcherId);
|
powerSwitcher = objectManager->get<PowerSwitchIF>(powerSwitcherId);
|
||||||
if (powerSwitcher == nullptr) {
|
if (powerSwitcher == nullptr) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"initialize", ObjectManagerIF::CHILD_INIT_FAILED,
|
"initialize", ObjectManagerIF::CHILD_INIT_FAILED,
|
||||||
"Power switcher set but no valid object found.");
|
"Power switcher set but no valid object found.");
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "Make sure the power switcher object is set up "
|
sif::error << "Make sure the power switcher object is set up "
|
||||||
<< "properly and implements PowerSwitchIF" << std::endl;
|
<< "properly and implements PowerSwitchIF" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("Make sure the power switcher object is set up "
|
sif::printError("Make sure the power switcher object is set up "
|
||||||
"properly and implements PowerSwitchIF\n");
|
"properly and implements PowerSwitchIF\n");
|
||||||
#endif
|
#endif
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
@ -717,7 +717,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData,
|
|||||||
case RETURN_OK:
|
case RETURN_OK:
|
||||||
handleReply(receivedData, foundId, foundLen);
|
handleReply(receivedData, foundId, foundLen);
|
||||||
if(foundLen == 0) {
|
if(foundLen == 0) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"parseReply", ObjectManagerIF::CHILD_INIT_FAILED,
|
"parseReply", ObjectManagerIF::CHILD_INIT_FAILED,
|
||||||
"Found length is one, parsing might be stuck");
|
"Found length is one, parsing might be stuck");
|
||||||
}
|
}
|
||||||
@ -730,7 +730,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData,
|
|||||||
foundId);
|
foundId);
|
||||||
}
|
}
|
||||||
if(foundLen == 0) {
|
if(foundLen == 0) {
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_ERROR,
|
printWarningOrError(sif::OutputTypes::OUT_ERROR,
|
||||||
"parseReply", ObjectManagerIF::CHILD_INIT_FAILED,
|
"parseReply", ObjectManagerIF::CHILD_INIT_FAILED,
|
||||||
"Power switcher set but no valid object found.");
|
"Power switcher set but no valid object found.");
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
@ -1292,7 +1292,7 @@ void DeviceHandlerBase::buildInternalCommand(void) {
|
|||||||
result = buildNormalDeviceCommand(&deviceCommandId);
|
result = buildNormalDeviceCommand(&deviceCommandId);
|
||||||
if (result == BUSY) {
|
if (result == BUSY) {
|
||||||
// so we can track misconfigurations
|
// so we can track misconfigurations
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"buildInternalCommand",
|
"buildInternalCommand",
|
||||||
HasReturnvaluesIF::RETURN_FAILED,
|
HasReturnvaluesIF::RETURN_FAILED,
|
||||||
"Busy.");
|
"Busy.");
|
||||||
@ -1324,7 +1324,7 @@ void DeviceHandlerBase::buildInternalCommand(void) {
|
|||||||
sprintf(output, "Command 0x%08x is executing",
|
sprintf(output, "Command 0x%08x is executing",
|
||||||
static_cast<unsigned int>(deviceCommandId));
|
static_cast<unsigned int>(deviceCommandId));
|
||||||
// so we can track misconfigurations
|
// so we can track misconfigurations
|
||||||
printWarningOrError(fsfw::OutputTypes::OUT_WARNING,
|
printWarningOrError(sif::OutputTypes::OUT_WARNING,
|
||||||
"buildInternalCommand",
|
"buildInternalCommand",
|
||||||
HasReturnvaluesIF::RETURN_FAILED,
|
HasReturnvaluesIF::RETURN_FAILED,
|
||||||
output);
|
output);
|
||||||
@ -1487,7 +1487,7 @@ AccessPoolManagerIF* DeviceHandlerBase::getAccessorHandle() {
|
|||||||
return &hkManager;
|
return &hkManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType,
|
void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType,
|
||||||
const char *functionName, ReturnValue_t errorCode,
|
const char *functionName, ReturnValue_t errorCode,
|
||||||
const char *errorPrint) {
|
const char *errorPrint) {
|
||||||
if(errorPrint == nullptr) {
|
if(errorPrint == nullptr) {
|
||||||
@ -1495,7 +1495,7 @@ void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType,
|
|||||||
errorPrint = "Initialization error";
|
errorPrint = "Initialization error";
|
||||||
}
|
}
|
||||||
if(errorCode == HasReturnvaluesIF::RETURN_FAILED) {
|
if(errorCode == HasReturnvaluesIF::RETURN_FAILED) {
|
||||||
if(errorType == fsfw::OutputTypes::OUT_WARNING) {
|
if(errorType == sif::OutputTypes::OUT_WARNING) {
|
||||||
errorPrint = "Generic Warning";
|
errorPrint = "Generic Warning";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1507,25 +1507,25 @@ void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(errorType == fsfw::OutputTypes::OUT_WARNING) {
|
if(errorType == sif::OutputTypes::OUT_WARNING) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "DeviceHandlerBase::" << functionName << ": Object ID "
|
sif::warning << "DeviceHandlerBase::" << functionName << ": Object ID "
|
||||||
<< std::hex << std::setw(8) << std::setfill('0')
|
<< std::hex << std::setw(8) << std::setfill('0')
|
||||||
<< this->getObjectId() << " | " << errorPrint << std::dec
|
<< this->getObjectId() << " | " << errorPrint << std::dec
|
||||||
<< std::setfill(' ') << std::endl;
|
<< std::setfill(' ') << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n",
|
sif::printWarning("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n",
|
||||||
this->getObjectId(), errorPrint);
|
this->getObjectId(), errorPrint);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if(errorType == fsfw::OutputTypes::OUT_ERROR) {
|
else if(errorType == sif::OutputTypes::OUT_ERROR) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "DeviceHandlerBase::" << functionName << ": Object ID "
|
sif::error << "DeviceHandlerBase::" << functionName << ": Object ID "
|
||||||
<< std::hex << std::setw(8) << std::setfill('0')
|
<< std::hex << std::setw(8) << std::setfill('0')
|
||||||
<< this->getObjectId() << " | " << errorPrint << std::dec
|
<< this->getObjectId() << " | " << errorPrint << std::dec
|
||||||
<< std::setfill(' ') << std::endl;
|
<< std::setfill(' ') << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n",
|
sif::printError("DeviceHandlerBase::%s: Object ID 0x%08x | %s\n",
|
||||||
this->getObjectId(), errorPrint);
|
this->getObjectId(), errorPrint);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1256,7 +1256,7 @@ private:
|
|||||||
void handleTransitionToOnMode(Mode_t commandedMode,
|
void handleTransitionToOnMode(Mode_t commandedMode,
|
||||||
Submode_t commandedSubmode);
|
Submode_t commandedSubmode);
|
||||||
|
|
||||||
void printWarningOrError(fsfw::OutputTypes errorType,
|
void printWarningOrError(sif::OutputTypes errorType,
|
||||||
const char* functionName,
|
const char* functionName,
|
||||||
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
|
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
|
||||||
const char* errorPrint = nullptr);
|
const char* errorPrint = nullptr);
|
||||||
|
@ -10,7 +10,7 @@ void arrayprinter::print(const uint8_t *data, size_t size, OutputType type,
|
|||||||
}
|
}
|
||||||
sif::info << "[";
|
sif::info << "[";
|
||||||
#else
|
#else
|
||||||
fsfw::printInfo("Printing data with size %zu: [", size);
|
sif::printInfo("Printing data with size %zu: [", size);
|
||||||
#endif
|
#endif
|
||||||
if(type == OutputType::HEX) {
|
if(type == OutputType::HEX) {
|
||||||
arrayprinter::printHex(data, size, maxCharPerLine);
|
arrayprinter::printHex(data, size, maxCharPerLine);
|
||||||
|
@ -114,7 +114,7 @@ uint8_t BinarySemaphore::getSemaphoreCounter(sem_t *handle) {
|
|||||||
}
|
}
|
||||||
else if(result != 0 and errno == EINVAL) {
|
else if(result != 0 and errno == EINVAL) {
|
||||||
// Could be called from interrupt, use lightweight printf
|
// Could be called from interrupt, use lightweight printf
|
||||||
fsfw::printError("BinarySemaphore::getSemaphoreCounter: "
|
sif::printError("BinarySemaphore::getSemaphoreCounter: "
|
||||||
"Invalid semaphore\n");
|
"Invalid semaphore\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ void BinarySemaphore::initSemaphore(uint8_t initCount) {
|
|||||||
sif::error << "BinarySemaphore: Init failed with "
|
sif::error << "BinarySemaphore: Init failed with "
|
||||||
<< strerror(errno) << std::endl;
|
<< strerror(errno) << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("BinarySemaphore: Init failed with %s\n",
|
sif::printError("BinarySemaphore: Init failed with %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ ReturnValue_t MessageQueue::handleError(mq_attr* attributes,
|
|||||||
sif::error << "MessageQueue::MessageQueue: Creating Queue " << name
|
sif::error << "MessageQueue::MessageQueue: Creating Queue " << name
|
||||||
<< " failed with status: " << strerror(errno) << std::endl;
|
<< " failed with status: " << strerror(errno) << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("MessageQueue::MessageQueue: Creating Queue %s"
|
sif::printError("MessageQueue::MessageQueue: Creating Queue %s"
|
||||||
" failed with status: %s\n", name, strerror(errno));
|
" failed with status: %s\n", name, strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
|
|||||||
sif::error << "PosixThread::createTask: Insufficient memory for"
|
sif::error << "PosixThread::createTask: Insufficient memory for"
|
||||||
" the requested " << stackMb << " MB" << std::endl;
|
" the requested " << stackMb << " MB" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("PosixThread::createTask: Insufficient memory for "
|
sif::printError("PosixThread::createTask: Insufficient memory for "
|
||||||
"the requested %zu MB\n", stackMb);
|
"the requested %zu MB\n", stackMb);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
|
|||||||
sif::error << "PosixThread::createTask: Wrong alignment argument!"
|
sif::error << "PosixThread::createTask: Wrong alignment argument!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("PosixThread::createTask: "
|
sif::printError("PosixThread::createTask: "
|
||||||
"Wrong alignment argument!\n");
|
"Wrong alignment argument!\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ void TmTcUnixUdpBridge::handleSendError() {
|
|||||||
sif::error << "TmTcUnixBridge::handleSendError: "
|
sif::error << "TmTcUnixBridge::handleSendError: "
|
||||||
<< strerror(errno) << std::endl;
|
<< strerror(errno) << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("TmTcUnixBridge::handleSendError: %s\n",
|
sif::printError("TmTcUnixBridge::handleSendError: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -29,19 +29,19 @@ ServiceInterfaceBuffer::ServiceInterfaceBuffer(std::string setMessage,
|
|||||||
|
|
||||||
#if FSFW_COLORED_OUTPUT == 1
|
#if FSFW_COLORED_OUTPUT == 1
|
||||||
if(setMessage.find("DEBUG") != std::string::npos) {
|
if(setMessage.find("DEBUG") != std::string::npos) {
|
||||||
colorPrefix = fsfw::ANSI_COLOR_MAGENTA;
|
colorPrefix = sif::ANSI_COLOR_MAGENTA;
|
||||||
}
|
}
|
||||||
else if(setMessage.find("INFO") != std::string::npos) {
|
else if(setMessage.find("INFO") != std::string::npos) {
|
||||||
colorPrefix = fsfw::ANSI_COLOR_GREEN;
|
colorPrefix = sif::ANSI_COLOR_GREEN;
|
||||||
}
|
}
|
||||||
else if(setMessage.find("WARNING") != std::string::npos) {
|
else if(setMessage.find("WARNING") != std::string::npos) {
|
||||||
colorPrefix = fsfw::ANSI_COLOR_YELLOW;
|
colorPrefix = sif::ANSI_COLOR_YELLOW;
|
||||||
}
|
}
|
||||||
else if(setMessage.find("ERROR") != std::string::npos) {
|
else if(setMessage.find("ERROR") != std::string::npos) {
|
||||||
colorPrefix = fsfw::ANSI_COLOR_RED;
|
colorPrefix = sif::ANSI_COLOR_RED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
colorPrefix = fsfw::ANSI_COLOR_RESET;
|
colorPrefix = sif::ANSI_COLOR_RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
@ -6,16 +6,18 @@
|
|||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
static fsfw::PrintLevel printLevel = fsfw::PrintLevel::DEBUG_LEVEL;
|
static sif::PrintLevel printLevel = sif::PrintLevel::DEBUG_LEVEL;
|
||||||
#if defined(WIN32) && FSFW_COLORED_OUTPUT == 1
|
#if defined(WIN32) && FSFW_COLORED_OUTPUT == 1
|
||||||
static bool consoleInitialized = false;
|
static bool consoleInitialized = false;
|
||||||
#endif /* defined(WIN32) && FSFW_COLORED_OUTPUT == 1 */
|
#endif /* defined(WIN32) && FSFW_COLORED_OUTPUT == 1 */
|
||||||
static bool addCrAtEnd = false;
|
|
||||||
|
|
||||||
#if FSFW_DISABLE_PRINTOUT == 0
|
#if FSFW_DISABLE_PRINTOUT == 0
|
||||||
|
|
||||||
|
static bool addCrAtEnd = false;
|
||||||
|
|
||||||
uint8_t printBuffer[fsfwconfig::FSFW_PRINT_BUFFER_SIZE];
|
uint8_t printBuffer[fsfwconfig::FSFW_PRINT_BUFFER_SIZE];
|
||||||
|
|
||||||
void fsfwPrint(fsfw::PrintLevel printType, const char* fmt, va_list arg) {
|
void fsfwPrint(sif::PrintLevel printType, const char* fmt, va_list arg) {
|
||||||
|
|
||||||
#if defined(WIN32) && FSFW_COLORED_OUTPUT == 1
|
#if defined(WIN32) && FSFW_COLORED_OUTPUT == 1
|
||||||
if(not consoleInitialized) {
|
if(not consoleInitialized) {
|
||||||
@ -32,38 +34,38 @@ void fsfwPrint(fsfw::PrintLevel printType, const char* fmt, va_list arg) {
|
|||||||
char* bufferPosition = reinterpret_cast<char*>(printBuffer);
|
char* bufferPosition = reinterpret_cast<char*>(printBuffer);
|
||||||
|
|
||||||
/* Check logger level */
|
/* Check logger level */
|
||||||
if(printType == fsfw::PrintLevel::NONE or printType > printLevel) {
|
if(printType == sif::PrintLevel::NONE or printType > printLevel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Log message to terminal */
|
/* Log message to terminal */
|
||||||
|
|
||||||
#if FSFW_COLORED_OUTPUT == 1
|
#if FSFW_COLORED_OUTPUT == 1
|
||||||
if(printType == fsfw::PrintLevel::INFO_LEVEL) {
|
if(printType == sif::PrintLevel::INFO_LEVEL) {
|
||||||
len += sprintf(bufferPosition, fsfw::ANSI_COLOR_GREEN);
|
len += sprintf(bufferPosition, sif::ANSI_COLOR_GREEN);
|
||||||
}
|
}
|
||||||
else if(printType == fsfw::PrintLevel::DEBUG_LEVEL) {
|
else if(printType == sif::PrintLevel::DEBUG_LEVEL) {
|
||||||
len += sprintf(bufferPosition, fsfw::ANSI_COLOR_MAGENTA);
|
len += sprintf(bufferPosition, sif::ANSI_COLOR_MAGENTA);
|
||||||
}
|
}
|
||||||
else if(printType == fsfw::PrintLevel::WARNING_LEVEL) {
|
else if(printType == sif::PrintLevel::WARNING_LEVEL) {
|
||||||
len += sprintf(bufferPosition, fsfw::ANSI_COLOR_YELLOW);
|
len += sprintf(bufferPosition, sif::ANSI_COLOR_YELLOW);
|
||||||
}
|
}
|
||||||
else if(printType == fsfw::PrintLevel::ERROR_LEVEL) {
|
else if(printType == sif::PrintLevel::ERROR_LEVEL) {
|
||||||
len += sprintf(bufferPosition, fsfw::ANSI_COLOR_RED);
|
len += sprintf(bufferPosition, sif::ANSI_COLOR_RED);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (printType == fsfw::PrintLevel::INFO_LEVEL) {
|
if (printType == sif::PrintLevel::INFO_LEVEL) {
|
||||||
len += sprintf(bufferPosition + len, "INFO: ");
|
len += sprintf(bufferPosition + len, "INFO: ");
|
||||||
}
|
}
|
||||||
if(printType == fsfw::PrintLevel::DEBUG_LEVEL) {
|
if(printType == sif::PrintLevel::DEBUG_LEVEL) {
|
||||||
len += sprintf(bufferPosition + len, "DEBUG: ");
|
len += sprintf(bufferPosition + len, "DEBUG: ");
|
||||||
}
|
}
|
||||||
if(printType == fsfw::PrintLevel::WARNING_LEVEL) {
|
if(printType == sif::PrintLevel::WARNING_LEVEL) {
|
||||||
len += sprintf(bufferPosition + len, "WARNING: ");
|
len += sprintf(bufferPosition + len, "WARNING: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(printType == fsfw::PrintLevel::ERROR_LEVEL) {
|
if(printType == sif::PrintLevel::ERROR_LEVEL) {
|
||||||
len += sprintf(bufferPosition + len, "ERROR: ");
|
len += sprintf(bufferPosition + len, "ERROR: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,51 +90,51 @@ void fsfwPrint(fsfw::PrintLevel printType, const char* fmt, va_list arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void fsfw::printInfo(const char *fmt, ...) {
|
void sif::printInfo(const char *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
fsfwPrint(fsfw::PrintLevel::INFO_LEVEL, fmt, args);
|
fsfwPrint(sif::PrintLevel::INFO_LEVEL, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsfw::printWarning(const char *fmt, ...) {
|
void sif::printWarning(const char *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
fsfwPrint(fsfw::PrintLevel::WARNING_LEVEL, fmt, args);
|
fsfwPrint(sif::PrintLevel::WARNING_LEVEL, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsfw::printDebug(const char *fmt, ...) {
|
void sif::printDebug(const char *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
fsfwPrint(fsfw::PrintLevel::DEBUG_LEVEL, fmt, args);
|
fsfwPrint(sif::PrintLevel::DEBUG_LEVEL, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsfw::setToAddCrAtEnd(bool addCrAtEnd_) {
|
void sif::setToAddCrAtEnd(bool addCrAtEnd_) {
|
||||||
addCrAtEnd = addCrAtEnd_;
|
addCrAtEnd = addCrAtEnd_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsfw::printError(const char *fmt, ...) {
|
void sif::printError(const char *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
fsfwPrint(fsfw::PrintLevel::ERROR_LEVEL, fmt, args);
|
fsfwPrint(sif::PrintLevel::ERROR_LEVEL, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
void fsfw::printInfo(const char *fmt, ...) {}
|
void sif::printInfo(const char *fmt, ...) {}
|
||||||
void fsfw::printWarning(const char *fmt, ...) {}
|
void sif::printWarning(const char *fmt, ...) {}
|
||||||
void fsfw::printDebug(const char *fmt, ...) {}
|
void sif::printDebug(const char *fmt, ...) {}
|
||||||
void fsfw::printError(const char *fmt, ...) {}
|
void sif::printError(const char *fmt, ...) {}
|
||||||
|
|
||||||
#endif /* FSFW_DISABLE_PRINTOUT == 0 */
|
#endif /* FSFW_DISABLE_PRINTOUT == 0 */
|
||||||
|
|
||||||
void fsfw::setPrintLevel(PrintLevel printLevel_) {
|
void sif::setPrintLevel(PrintLevel printLevel_) {
|
||||||
printLevel = printLevel_;
|
printLevel = printLevel_;
|
||||||
}
|
}
|
||||||
|
|
||||||
fsfw::PrintLevel fsfw::getPrintLevel() {
|
sif::PrintLevel sif::getPrintLevel() {
|
||||||
return printLevel;
|
return printLevel;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace fsfw {
|
namespace sif {
|
||||||
|
|
||||||
enum PrintLevel {
|
enum PrintLevel {
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef FSFW_SERVICEINTERFACE_SERVICEINTERFACEDEFINTIONS_H_
|
#ifndef FSFW_SERVICEINTERFACE_SERVICEINTERFACEDEFINTIONS_H_
|
||||||
#define FSFW_SERVICEINTERFACE_SERVICEINTERFACEDEFINTIONS_H_
|
#define FSFW_SERVICEINTERFACE_SERVICEINTERFACEDEFINTIONS_H_
|
||||||
|
|
||||||
namespace fsfw {
|
namespace sif {
|
||||||
|
|
||||||
enum class OutputTypes {
|
enum class OutputTypes {
|
||||||
OUT_INFO,
|
OUT_INFO,
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
sif::error << "Unit Tester error: Failed at test ID "
|
sif::error << "Unit Tester error: Failed at test ID "
|
||||||
<< errorId << std::endl;
|
<< errorId << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("Unit Tester error: Failed at test ID 0x%08x", errorId);
|
sif::printError("Unit Tester error: Failed at test ID 0x%08x", errorId);
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ StorageManagerIF* tglob::getIpcStoreHandle() {
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "Global object manager uninitialized" << std::endl;
|
sif::error << "Global object manager uninitialized" << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("Global object manager uninitialized\n\r");
|
sif::printError("Global object manager uninitialized\n\r");
|
||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user