CMD/REPLY prefixes added

This commit is contained in:
Robin Müller 2020-10-10 18:12:22 +02:00
parent b9c7d1bd3f
commit 670e9bfa0f
4 changed files with 20 additions and 14 deletions

View File

@ -21,8 +21,8 @@ Service2DeviceAccess::~Service2DeviceAccess() {}
ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) { ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) {
switch(static_cast<Subservice>(subservice)){ switch(static_cast<Subservice>(subservice)){
case Subservice::RAW_COMMANDING: case Subservice::COMMAND_RAW_COMMANDING:
case Subservice::TOGGLE_WIRETAPPING: case Subservice::COMMAND_TOGGLE_WIRETAPPING:
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
default: default:
sif::error << "Invalid Subservice" << std::endl; 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, uint8_t subservice, const uint8_t* tcData, size_t tcDataLen,
uint32_t* state, object_id_t objectId) { uint32_t* state, object_id_t objectId) {
switch(static_cast<Subservice>(subservice)){ switch(static_cast<Subservice>(subservice)){
case Subservice::RAW_COMMANDING: { case Subservice::COMMAND_RAW_COMMANDING: {
return prepareRawCommand(message, tcData, tcDataLen); return prepareRawCommand(message, tcData, tcDataLen);
} }
break; break;
case Subservice::TOGGLE_WIRETAPPING: { case Subservice::COMMAND_TOGGLE_WIRETAPPING: {
return prepareWiretappingCommand(message, tcData, tcDataLen); return prepareWiretappingCommand(message, tcData, tcDataLen);
} }
break; break;
@ -118,11 +118,11 @@ void Service2DeviceAccess::handleUnrequestedReply(CommandMessage* reply) {
switch(reply->getCommand()) { switch(reply->getCommand()) {
case DeviceHandlerMessage::REPLY_RAW_COMMAND: case DeviceHandlerMessage::REPLY_RAW_COMMAND:
sendWiretappingTm(reply, sendWiretappingTm(reply,
static_cast<uint8_t>(Subservice::WIRETAPPING_RAW_TC)); static_cast<uint8_t>(Subservice::REPLY_WIRETAPPING_RAW_TC));
break; break;
case DeviceHandlerMessage::REPLY_RAW_REPLY: case DeviceHandlerMessage::REPLY_RAW_REPLY:
sendWiretappingTm(reply, sendWiretappingTm(reply,
static_cast<uint8_t>(Subservice::RAW_REPLY)); static_cast<uint8_t>(Subservice::REPLY_RAW));
break; break;
default: default:
sif::error << "Unknown message in Service2DeviceAccess::" sif::error << "Unknown message in Service2DeviceAccess::"

View File

@ -81,10 +81,14 @@ private:
const uint8_t* tcData, size_t tcDataLen); const uint8_t* tcData, size_t tcDataLen);
enum class Subservice { enum class Subservice {
RAW_COMMANDING = 128, //!< [EXPORT] : [COMMAND] Command in device native protocol //!< [EXPORT] : [COMMAND] Command in device native protocol
TOGGLE_WIRETAPPING = 129, //!< [EXPORT] : [COMMAND] Toggle wiretapping of raw communication COMMAND_RAW_COMMANDING = 128,
RAW_REPLY = 130, //!< [EXPORT] : [REPLY] Includes wiretapping TM and normal TM raw replies from device //!< [EXPORT] : [COMMAND] Toggle wiretapping of raw communication
WIRETAPPING_RAW_TC = 131 //!< [EXPORT] : [REPLY] Wiretapping packets of commands built by device handler 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
}; };
}; };

View File

@ -19,7 +19,7 @@ Service8FunctionManagement::~Service8FunctionManagement() {}
ReturnValue_t Service8FunctionManagement::isValidSubservice( ReturnValue_t Service8FunctionManagement::isValidSubservice(
uint8_t subservice) { uint8_t subservice) {
switch(static_cast<Subservice>(subservice)) { switch(static_cast<Subservice>(subservice)) {
case Subservice::DIRECT_COMMANDING: case Subservice::COMMAND_DIRECT_COMMANDING:
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
default: default:
return AcceptsTelecommandsIF::INVALID_SUBSERVICE; return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
@ -131,7 +131,7 @@ ReturnValue_t Service8FunctionManagement::handleDataReply(
} }
DataReply dataReply(objectId, actionId, buffer, size); DataReply dataReply(objectId, actionId, buffer, size);
result = sendTmPacket(static_cast<uint8_t>( result = sendTmPacket(static_cast<uint8_t>(
Subservice::DIRECT_COMMANDING_DATA_REPLY), &dataReply); Subservice::REPLY_DIRECT_COMMANDING_DATA), &dataReply);
auto deletionResult = IPCStore->deleteData(storeId); auto deletionResult = IPCStore->deleteData(storeId);
if(deletionResult != HasReturnvaluesIF::RETURN_OK) { if(deletionResult != HasReturnvaluesIF::RETURN_OK) {

View File

@ -52,8 +52,10 @@ protected:
private: private:
enum class Subservice { enum class Subservice {
DIRECT_COMMANDING = 128, //!< [EXPORT] : [COMMAND] Functional commanding //!< [EXPORT] : [COMMAND] Functional commanding
DIRECT_COMMANDING_DATA_REPLY = 130, //!< [EXPORT] : [REPLY] Data reply COMMAND_DIRECT_COMMANDING = 128,
//!< [EXPORT] : [REPLY] Data reply
REPLY_DIRECT_COMMANDING_DATA = 130,
}; };
ReturnValue_t checkInterfaceAndAcquireMessageQueue( ReturnValue_t checkInterfaceAndAcquireMessageQueue(