srv8 improved

This commit is contained in:
Robin Müller 2020-07-10 14:28:36 +02:00
parent a7d68f8c52
commit e29226c9bb
2 changed files with 29 additions and 21 deletions

View File

@ -59,8 +59,15 @@ ReturnValue_t Service8FunctionManagement::prepareCommand(
ReturnValue_t Service8FunctionManagement::prepareDirectCommand( ReturnValue_t Service8FunctionManagement::prepareDirectCommand(
CommandMessage *message, const uint8_t *tcData, size_t tcDataLen) { CommandMessage *message, const uint8_t *tcData, size_t tcDataLen) {
if(tcDataLen < sizeof(object_id_t) + sizeof(ActionId_t)) {
sif::debug << "Service8FunctionManagement::prepareDirectCommand:"
<< " TC size smaller thant minimum size of direct command."
<< std::endl;
return CommandingServiceBase::INVALID_TC;
}
// Create direct command instance by extracting data from Telecommand // Create direct command instance by extracting data from Telecommand
DirectCommand command(tcData,tcDataLen); DirectCommand command(tcData, tcDataLen);
// store additional parameters into the IPC Store // store additional parameters into the IPC Store
store_address_t parameterAddress; store_address_t parameterAddress;

View File

@ -8,10 +8,7 @@
* 3. Return Code * 3. Return Code
* 4. Optional step number for step replies * 4. Optional step number for step replies
* *
* Data reply (subservice 132) consists of
* 1. Target Object ID
* 2. Action ID
* 3. Data
* *
* \date 01.07.2019 * \date 01.07.2019
* \author R. Mueller * \author R. Mueller
@ -29,23 +26,21 @@
/** /**
* \brief Subservice 128 * @brief Subservice 128
* \ingroup spacepackets * @ingroup spacepackets
*/ */
class DirectCommand: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 128 class DirectCommand: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 128
public: public:
//typedef uint16_t typeOfMaxData;
//static const typeOfMaxData MAX_DATA = 256; DirectCommand(const uint8_t* tcData, size_t size) {
DirectCommand(const uint8_t* dataBuffer_, uint32_t size_) { SerializeAdapter::deSerialize(&objectId, &tcData, &size,
size_t size = sizeof(objectId);
SerializeAdapter::deSerialize(&objectId,&dataBuffer_,&size,
SerializeIF::Endianness::BIG); SerializeIF::Endianness::BIG);
size = sizeof(actionId); SerializeAdapter::deSerialize(&actionId, &tcData, &size,
SerializeAdapter::deSerialize(&actionId,&dataBuffer_,&size,
SerializeIF::Endianness::BIG); SerializeIF::Endianness::BIG);
parameterBuffer = dataBuffer_; parameterBuffer = tcData;
parametersSize = size_ - sizeof(objectId) - sizeof(actionId); parametersSize = size;
} }
ActionId_t getActionId() const { ActionId_t getActionId() const {
return actionId; return actionId;
} }
@ -73,8 +68,12 @@ private:
/** /**
* \brief Subservice 130 * @brief Subservice 130
* \ingroup spacepackets * Data reply (subservice 130) consists of
* 1. Target Object ID
* 2. Action ID
* 3. Data
* @ingroup spacepackets
*/ */
class DataReply: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 130 class DataReply: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 130
public: public:
@ -100,8 +99,10 @@ private:
/** /**
* \brief Subservice 132 * @brief Subservice 132
* \ingroup spacepackets * @details
* Not used yet. Telecommand Verification takes care of this.
* @ingroup spacepackets
*/ */
class DirectReply: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 132 class DirectReply: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 132
public: public:
@ -124,7 +125,7 @@ private:
returnCode.setNext(&step); returnCode.setNext(&step);
} }
} }
bool isDataReply; //!< [EXPORT] : [IGNORE]
bool isStep; //!< [EXPORT] : [IGNORE] bool isStep; //!< [EXPORT] : [IGNORE]
SerializeElement<object_id_t> objectId; //!< [EXPORT] : [IGNORE] SerializeElement<object_id_t> objectId; //!< [EXPORT] : [IGNORE]
SerializeElement<ActionId_t> actionId; //!< [EXPORT] : [IGNORE] SerializeElement<ActionId_t> actionId; //!< [EXPORT] : [IGNORE]