From 670e9bfa0f4fa55fddfd3cbcd7669987e65aa3f5 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sat, 10 Oct 2020 18:12:22 +0200 Subject: [PATCH] CMD/REPLY prefixes added --- pus/Service2DeviceAccess.cpp | 12 ++++++------ pus/Service2DeviceAccess.h | 12 ++++++++---- pus/Service8FunctionManagement.cpp | 4 ++-- pus/Service8FunctionManagement.h | 6 ++++-- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/pus/Service2DeviceAccess.cpp b/pus/Service2DeviceAccess.cpp index 878a13b0..3648b7eb 100644 --- a/pus/Service2DeviceAccess.cpp +++ b/pus/Service2DeviceAccess.cpp @@ -21,8 +21,8 @@ Service2DeviceAccess::~Service2DeviceAccess() {} ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) { switch(static_cast(subservice)){ - case Subservice::RAW_COMMANDING: - case Subservice::TOGGLE_WIRETAPPING: + case Subservice::COMMAND_RAW_COMMANDING: + case Subservice::COMMAND_TOGGLE_WIRETAPPING: return HasReturnvaluesIF::RETURN_OK; default: sif::error << "Invalid Subservice" << std::endl; @@ -58,11 +58,11 @@ ReturnValue_t Service2DeviceAccess::prepareCommand(CommandMessage* message, uint8_t subservice, const uint8_t* tcData, size_t tcDataLen, uint32_t* state, object_id_t objectId) { switch(static_cast(subservice)){ - case Subservice::RAW_COMMANDING: { + case Subservice::COMMAND_RAW_COMMANDING: { return prepareRawCommand(message, tcData, tcDataLen); } break; - case Subservice::TOGGLE_WIRETAPPING: { + case Subservice::COMMAND_TOGGLE_WIRETAPPING: { return prepareWiretappingCommand(message, tcData, tcDataLen); } break; @@ -118,11 +118,11 @@ void Service2DeviceAccess::handleUnrequestedReply(CommandMessage* reply) { switch(reply->getCommand()) { case DeviceHandlerMessage::REPLY_RAW_COMMAND: sendWiretappingTm(reply, - static_cast(Subservice::WIRETAPPING_RAW_TC)); + static_cast(Subservice::REPLY_WIRETAPPING_RAW_TC)); break; case DeviceHandlerMessage::REPLY_RAW_REPLY: sendWiretappingTm(reply, - static_cast(Subservice::RAW_REPLY)); + static_cast(Subservice::REPLY_RAW)); break; default: sif::error << "Unknown message in Service2DeviceAccess::" diff --git a/pus/Service2DeviceAccess.h b/pus/Service2DeviceAccess.h index fa2ea75c..b62e6854 100644 --- a/pus/Service2DeviceAccess.h +++ b/pus/Service2DeviceAccess.h @@ -81,10 +81,14 @@ private: const uint8_t* tcData, size_t tcDataLen); enum class Subservice { - RAW_COMMANDING = 128, //!< [EXPORT] : [COMMAND] Command in device native protocol - TOGGLE_WIRETAPPING = 129, //!< [EXPORT] : [COMMAND] Toggle wiretapping of raw communication - RAW_REPLY = 130, //!< [EXPORT] : [REPLY] Includes wiretapping TM and normal TM raw replies from device - WIRETAPPING_RAW_TC = 131 //!< [EXPORT] : [REPLY] Wiretapping packets of commands built by device handler + //!< [EXPORT] : [COMMAND] Command in device native protocol + COMMAND_RAW_COMMANDING = 128, + //!< [EXPORT] : [COMMAND] Toggle wiretapping of raw communication + COMMAND_TOGGLE_WIRETAPPING = 129, + //!< [EXPORT] : [REPLY] Includes wiretapping TM and normal TM raw replies from device + REPLY_RAW = 130, + //!< [EXPORT] : [REPLY] Wiretapping packets of commands built by device handler + REPLY_WIRETAPPING_RAW_TC = 131 }; }; diff --git a/pus/Service8FunctionManagement.cpp b/pus/Service8FunctionManagement.cpp index c1c88a50..d710c56e 100644 --- a/pus/Service8FunctionManagement.cpp +++ b/pus/Service8FunctionManagement.cpp @@ -19,7 +19,7 @@ Service8FunctionManagement::~Service8FunctionManagement() {} ReturnValue_t Service8FunctionManagement::isValidSubservice( uint8_t subservice) { switch(static_cast(subservice)) { - case Subservice::DIRECT_COMMANDING: + case Subservice::COMMAND_DIRECT_COMMANDING: return HasReturnvaluesIF::RETURN_OK; default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; @@ -131,7 +131,7 @@ ReturnValue_t Service8FunctionManagement::handleDataReply( } DataReply dataReply(objectId, actionId, buffer, size); result = sendTmPacket(static_cast( - Subservice::DIRECT_COMMANDING_DATA_REPLY), &dataReply); + Subservice::REPLY_DIRECT_COMMANDING_DATA), &dataReply); auto deletionResult = IPCStore->deleteData(storeId); if(deletionResult != HasReturnvaluesIF::RETURN_OK) { diff --git a/pus/Service8FunctionManagement.h b/pus/Service8FunctionManagement.h index 292a5e36..00153cfb 100644 --- a/pus/Service8FunctionManagement.h +++ b/pus/Service8FunctionManagement.h @@ -52,8 +52,10 @@ protected: private: enum class Subservice { - DIRECT_COMMANDING = 128, //!< [EXPORT] : [COMMAND] Functional commanding - DIRECT_COMMANDING_DATA_REPLY = 130, //!< [EXPORT] : [REPLY] Data reply + //!< [EXPORT] : [COMMAND] Functional commanding + COMMAND_DIRECT_COMMANDING = 128, + //!< [EXPORT] : [REPLY] Data reply + REPLY_DIRECT_COMMANDING_DATA = 130, }; ReturnValue_t checkInterfaceAndAcquireMessageQueue(