all cstdout uses wrapped in preprocessor defines
This commit is contained in:
@ -75,8 +75,10 @@ ReturnValue_t CommandingServiceBase::initialize() {
|
||||
packetSource);
|
||||
|
||||
if (packetForwarding == nullptr or distributor == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "CommandingServiceBase::intialize: Packet source or "
|
||||
"packet destination invalid!" << std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
||||
@ -88,8 +90,10 @@ ReturnValue_t CommandingServiceBase::initialize() {
|
||||
TCStore = objectManager->get<StorageManagerIF>(objects::TC_STORE);
|
||||
|
||||
if (IPCStore == nullptr or TCStore == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "CommandingServiceBase::intialize: IPC store or TC store "
|
||||
"not initialized yet!" << std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,11 @@ ReturnValue_t PusServiceBase::performOperation(uint8_t opCode) {
|
||||
handleRequestQueue();
|
||||
ReturnValue_t result = this->performService();
|
||||
if (result != RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "PusService " << (uint16_t) this->serviceId
|
||||
<< ": performService returned with " << (int16_t) result
|
||||
<< std::endl;
|
||||
#endif
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
@ -43,11 +45,13 @@ void PusServiceBase::handleRequestQueue() {
|
||||
for (uint8_t count = 0; count < PUS_SERVICE_MAX_RECEPTION; count++) {
|
||||
ReturnValue_t status = this->requestQueue->receiveMessage(&message);
|
||||
// if(status != MessageQueueIF::EMPTY) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
// sif::debug << "PusServiceBase::performOperation: Receiving from "
|
||||
// << "MQ ID: " << std::hex << "0x" << std::setw(8)
|
||||
// << std::setfill('0') << this->requestQueue->getId()
|
||||
// << std::dec << " returned: " << status << std::setfill(' ')
|
||||
// << std::endl;
|
||||
#endif
|
||||
// }
|
||||
|
||||
if (status == RETURN_OK) {
|
||||
@ -79,9 +83,11 @@ void PusServiceBase::handleRequestQueue() {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "PusServiceBase::performOperation: Service "
|
||||
<< this->serviceId << ": Error receiving packet. Code: "
|
||||
<< std::hex << status << std::dec << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,10 +110,12 @@ ReturnValue_t PusServiceBase::initialize() {
|
||||
PUSDistributorIF* distributor = objectManager->get<PUSDistributorIF>(
|
||||
packetSource);
|
||||
if (destService == nullptr or distributor == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "PusServiceBase::PusServiceBase: Service "
|
||||
<< this->serviceId << ": Configuration error. Make sure "
|
||||
<< "packetSource and packetDestination are defined correctly"
|
||||
<< std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
this->requestQueue->setDefaultDestination(
|
||||
|
@ -23,9 +23,11 @@ ReturnValue_t TmTcBridge::setNumberOfSentPacketsPerCycle(
|
||||
return RETURN_OK;
|
||||
}
|
||||
else {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "TmTcBridge::setNumberOfSentPacketsPerCycle: Number of "
|
||||
<< "packets sent per cycle exceeds limits. "
|
||||
<< "Keeping default value." << std::endl;
|
||||
#endif
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
@ -37,9 +39,11 @@ ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(
|
||||
return RETURN_OK;
|
||||
}
|
||||
else {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "TmTcBridge::setMaxNumberOfPacketsStored: Number of "
|
||||
<< "packets stored exceeds limits. "
|
||||
<< "Keeping default value." << std::endl;
|
||||
#endif
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
@ -47,21 +51,27 @@ ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(
|
||||
ReturnValue_t TmTcBridge::initialize() {
|
||||
tcStore = objectManager->get<StorageManagerIF>(tcStoreId);
|
||||
if (tcStore == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TmTcBridge::initialize: TC store invalid. Make sure"
|
||||
"it is created and set up properly." << std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
tmStore = objectManager->get<StorageManagerIF>(tmStoreId);
|
||||
if (tmStore == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TmTcBridge::initialize: TM store invalid. Make sure"
|
||||
"it is created and set up properly." << std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
AcceptsTelecommandsIF* tcDistributor =
|
||||
objectManager->get<AcceptsTelecommandsIF>(tcDestination);
|
||||
if (tcDistributor == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TmTcBridge::initialize: TC Distributor invalid"
|
||||
<< std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
||||
@ -75,13 +85,17 @@ ReturnValue_t TmTcBridge::performOperation(uint8_t operationCode) {
|
||||
ReturnValue_t result;
|
||||
result = handleTc();
|
||||
if(result != RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::debug << "TmTcBridge::performOperation: "
|
||||
<< "Error handling TCs" << std::endl;
|
||||
#endif
|
||||
}
|
||||
result = handleTm();
|
||||
if (result != RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::debug << "TmTcBridge::performOperation: "
|
||||
<< "Error handling TMs" << std::endl;
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -94,9 +108,11 @@ ReturnValue_t TmTcBridge::handleTm() {
|
||||
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = handleTmQueue();
|
||||
if(result != RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TmTcBridge::handleTm: Error handling TM queue with "
|
||||
<< "error code 0x" << std::hex << result << std::dec
|
||||
<< "!" << std::endl;
|
||||
#endif
|
||||
status = result;
|
||||
}
|
||||
|
||||
@ -104,8 +120,10 @@ ReturnValue_t TmTcBridge::handleTm() {
|
||||
(packetSentCounter < sentPacketsPerCycle)) {
|
||||
result = handleStoredTm();
|
||||
if(result != RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TmTcBridge::handleTm: Error handling stored TMs!"
|
||||
<< std::endl;
|
||||
#endif
|
||||
status = result;
|
||||
}
|
||||
}
|
||||
@ -122,7 +140,9 @@ ReturnValue_t TmTcBridge::handleTmQueue() {
|
||||
result == HasReturnvaluesIF::RETURN_OK;
|
||||
result = tmTcReceptionQueue->receiveMessage(&message))
|
||||
{
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
//sif::info << (int) packetSentCounter << std::endl;
|
||||
#endif
|
||||
if(communicationLinkUp == false or
|
||||
packetSentCounter >= sentPacketsPerCycle) {
|
||||
storeDownlinkData(&message);
|
||||
@ -151,8 +171,10 @@ ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) {
|
||||
store_address_t storeId = 0;
|
||||
|
||||
if(tmFifo->full()) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::debug << "TmTcBridge::storeDownlinkData: TM downlink max. number "
|
||||
<< "of stored packet IDs reached! " << std::endl;
|
||||
#endif
|
||||
if(overwriteOld) {
|
||||
tmFifo->retrieve(&storeId);
|
||||
tmStore->deleteData(storeId);
|
||||
@ -171,8 +193,10 @@ ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) {
|
||||
ReturnValue_t TmTcBridge::handleStoredTm() {
|
||||
ReturnValue_t status = RETURN_OK;
|
||||
while(not tmFifo->empty() and packetSentCounter < sentPacketsPerCycle) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
//sif::info << "TMTC Bridge: Sending stored TM data. There are "
|
||||
// << (int) tmFifo->size() << " left to send\r\n" << std::flush;
|
||||
#endif
|
||||
|
||||
store_address_t storeId;
|
||||
const uint8_t* data = nullptr;
|
||||
@ -185,8 +209,10 @@ ReturnValue_t TmTcBridge::handleStoredTm() {
|
||||
|
||||
result = sendTm(data,size);
|
||||
if(result != RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TMTC Bridge: Could not send stored downlink data"
|
||||
<< std::endl;
|
||||
#endif
|
||||
status = result;
|
||||
}
|
||||
packetSentCounter ++;
|
||||
@ -201,13 +227,17 @@ ReturnValue_t TmTcBridge::handleStoredTm() {
|
||||
|
||||
void TmTcBridge::registerCommConnect() {
|
||||
if(not communicationLinkUp) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
//sif::info << "TMTC Bridge: Registered Comm Link Connect" << std::endl;
|
||||
#endif
|
||||
communicationLinkUp = true;
|
||||
}
|
||||
}
|
||||
|
||||
void TmTcBridge::registerCommDisconnect() {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
//sif::info << "TMTC Bridge: Registered Comm Link Disconnect" << std::endl;
|
||||
#endif
|
||||
if(communicationLinkUp) {
|
||||
communicationLinkUp = false;
|
||||
}
|
||||
|
@ -27,9 +27,11 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||
&message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "VerificationReporter::sendSuccessReport: Error writing "
|
||||
<< "to queue. Code: " << std::hex << status << std::dec
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,9 +46,11 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||
&message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "VerificationReporter::sendSuccessReport: Error writing "
|
||||
<< "to queue. Code: " << std::hex << status << std::dec
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,9 +68,11 @@ void VerificationReporter::sendFailureReport(uint8_t report_id,
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||
&message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "VerificationReporter::sendFailureReport: Error writing "
|
||||
<< "to queue. Code: " << std::hex << "0x" << status << std::dec
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,24 +88,30 @@ void VerificationReporter::sendFailureReport(uint8_t report_id,
|
||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||
&message);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "VerificationReporter::sendFailureReport: Error writing "
|
||||
<< "to queue. Code: " << std::hex << "0x" << status << std::dec
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void VerificationReporter::initialize() {
|
||||
if(messageReceiver == objects::NO_OBJECT) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "VerificationReporter::initialize: Verification message"
|
||||
" receiver object ID not set yet in Factory!" << std::endl;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
AcceptsVerifyMessageIF* temp = objectManager->get<AcceptsVerifyMessageIF>(
|
||||
messageReceiver);
|
||||
if (temp == nullptr) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "VerificationReporter::initialize: Message "
|
||||
<< "receiver invalid. Make sure it is set up properly and "
|
||||
<< "implementsAcceptsVerifyMessageIF" << std::endl;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
this->acknowledgeQueue = temp->getVerificationQueue();
|
||||
|
Reference in New Issue
Block a user