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) {
switch(static_cast<Subservice>(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>(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<uint8_t>(Subservice::WIRETAPPING_RAW_TC));
static_cast<uint8_t>(Subservice::REPLY_WIRETAPPING_RAW_TC));
break;
case DeviceHandlerMessage::REPLY_RAW_REPLY:
sendWiretappingTm(reply,
static_cast<uint8_t>(Subservice::RAW_REPLY));
static_cast<uint8_t>(Subservice::REPLY_RAW));
break;
default:
sif::error << "Unknown message in Service2DeviceAccess::"

View File

@ -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
};
};

View File

@ -19,7 +19,7 @@ Service8FunctionManagement::~Service8FunctionManagement() {}
ReturnValue_t Service8FunctionManagement::isValidSubservice(
uint8_t subservice) {
switch(static_cast<Subservice>(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<uint8_t>(
Subservice::DIRECT_COMMANDING_DATA_REPLY), &dataReply);
Subservice::REPLY_DIRECT_COMMANDING_DATA), &dataReply);
auto deletionResult = IPCStore->deleteData(storeId);
if(deletionResult != HasReturnvaluesIF::RETURN_OK) {

View File

@ -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(