PusServiceBase bufix + doc
Bugfix for error parameter 2 (wrong type). Some formatting and doc improvements
This commit is contained in:
parent
cd7e47ccbb
commit
47b588c429
@ -23,14 +23,14 @@ ReturnValue_t PusServiceBase::performOperation(uint8_t opCode) {
|
|||||||
TmTcMessage message;
|
TmTcMessage message;
|
||||||
for (uint8_t count = 0; count < PUS_SERVICE_MAX_RECEPTION; count++) {
|
for (uint8_t count = 0; count < PUS_SERVICE_MAX_RECEPTION; count++) {
|
||||||
ReturnValue_t status = this->requestQueue->receiveMessage(&message);
|
ReturnValue_t status = this->requestQueue->receiveMessage(&message);
|
||||||
// debug << "PusServiceBase::performOperation: Receiving from MQ ID: " << std::hex << this->requestQueue.getId() << std::dec << " returned: " << status << std::endl;
|
// debug << "PusServiceBase::performOperation: Receiving from MQ ID: " << std::hex << this->requestQueue.getId()
|
||||||
|
// << std::dec << " returned: " << status << std::endl;
|
||||||
if (status == RETURN_OK) {
|
if (status == RETURN_OK) {
|
||||||
this->currentPacket.setStoreAddress(message.getStorageId());
|
this->currentPacket.setStoreAddress(message.getStorageId());
|
||||||
// info << "Service " << (uint16_t) this->serviceId << ": new packet!"
|
// info << "Service " << (uint16_t) this->serviceId << ": new packet!" << std::endl;
|
||||||
// << std::endl;
|
|
||||||
|
|
||||||
ReturnValue_t return_code = this->handleRequest();
|
ReturnValue_t return_code = this->handleRequest();
|
||||||
// debug << "Service " << (uint16_t)this->serviceId << ": handleRequest returned: " << (int)return_code << std::endl;
|
// debug << "Service " << (uint16_t)this->serviceId << ": handleRequest returned: " << (int)return_code << std::endl;
|
||||||
if (return_code == RETURN_OK) {
|
if (return_code == RETURN_OK) {
|
||||||
this->verifyReporter.sendSuccessReport(
|
this->verifyReporter.sendSuccessReport(
|
||||||
TC_VERIFY::COMPLETION_SUCCESS, &this->currentPacket);
|
TC_VERIFY::COMPLETION_SUCCESS, &this->currentPacket);
|
||||||
@ -44,7 +44,7 @@ ReturnValue_t PusServiceBase::performOperation(uint8_t opCode) {
|
|||||||
errorParameter2 = 0;
|
errorParameter2 = 0;
|
||||||
} else if (status == MessageQueueIF::EMPTY) {
|
} else if (status == MessageQueueIF::EMPTY) {
|
||||||
status = RETURN_OK;
|
status = RETURN_OK;
|
||||||
// debug << "PusService " << (uint16_t)this->serviceId << ": no new packet." << std::endl;
|
// debug << "PusService " << (uint16_t)this->serviceId << ": no new packet." << std::endl;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -46,13 +46,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual ~PusServiceBase();
|
virtual ~PusServiceBase();
|
||||||
/**
|
/**
|
||||||
* The handleRequest method shall handle any kind of Telecommand Request immediately.
|
* @brief The handleRequest method shall handle any kind of Telecommand Request immediately.
|
||||||
|
* @details
|
||||||
* Implemetations can take the Telecommand in currentPacket and perform any kind of operation.
|
* Implemetations can take the Telecommand in currentPacket and perform any kind of operation.
|
||||||
* They may send additional "Start Success (1,3)" messages with the verifyReporter, but Completion
|
* They may send additional "Start Success (1,3)" messages with the verifyReporter, but Completion
|
||||||
* Success or Failure Reports are generated automatically after execution of this method.
|
* Success or Failure Reports are generated automatically after execution of this method.
|
||||||
* If a Telecommand can not be executed within one call cycle, this Base class is not the right parent.
|
*
|
||||||
* The child class may add additional error information in #errorParameters which are attached to the generated
|
* If a Telecommand can not be executed within one call cycle,
|
||||||
* verification message.
|
* this Base class is not the right parent.
|
||||||
|
*
|
||||||
|
* The child class may add additional error information by setting #errorParameters which are
|
||||||
|
* attached to the generated verification message.
|
||||||
|
*
|
||||||
|
* Subservice checking should be implemented in this method.
|
||||||
|
*
|
||||||
* @return The returned status_code is directly taken as main error code in the Verification Report.
|
* @return The returned status_code is directly taken as main error code in the Verification Report.
|
||||||
* On success, RETURN_OK shall be returned.
|
* On success, RETURN_OK shall be returned.
|
||||||
*/
|
*/
|
||||||
@ -68,8 +75,8 @@ public:
|
|||||||
* It checks for new requests, and, if found, calls handleRequest, sends completion verification messages and deletes
|
* It checks for new requests, and, if found, calls handleRequest, sends completion verification messages and deletes
|
||||||
* the TC requests afterwards.
|
* the TC requests afterwards.
|
||||||
* performService is always executed afterwards.
|
* performService is always executed afterwards.
|
||||||
* @return - \c RETURN_OK if the periodic performService was successful.
|
* @return \c RETURN_OK if the periodic performService was successful.
|
||||||
* - \c RETURN_FAILED else.
|
* \c RETURN_FAILED else.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t performOperation(uint8_t opCode);
|
ReturnValue_t performOperation(uint8_t opCode);
|
||||||
virtual uint16_t getIdentifier();
|
virtual uint16_t getIdentifier();
|
||||||
@ -91,7 +98,8 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* One of two error parameters for additional error information.
|
* One of two error parameters for additional error information.
|
||||||
*/
|
*/
|
||||||
uint8_t errorParameter2;
|
// shouldn't this be uint32_t ? The PUS Verification Message structure param2 has the size 4
|
||||||
|
uint32_t errorParameter2;
|
||||||
/**
|
/**
|
||||||
* This is a complete instance of the Telecommand reception queue of the class.
|
* This is a complete instance of the Telecommand reception queue of the class.
|
||||||
* It is initialized on construction of the class.
|
* It is initialized on construction of the class.
|
||||||
|
Loading…
Reference in New Issue
Block a user