Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

PUSTelecommand.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // PUSTelecommand.cpp 00005 // 00006 // Version 1.0 00007 // Date 4.12.02 00008 // Author A. Pasetti (P&P Software) 00009 00010 #include "../GeneralInclude/CompilerSwitches.h" 00011 #include "../GeneralInclude/DebugSupport.h" 00012 #include "../GeneralInclude/Constants.h" 00013 #include "PUSTelecommand.h" 00014 00015 TD_PUSPacketId PUSTelecommand::packetId = 0; 00016 00017 static const TD_TelecommandAck acceptanceAck = 1; 00018 static const TD_TelecommandAck startAck = 2; 00019 static const TD_TelecommandAck progressAck = 4; 00020 static const TD_TelecommandAck completionAck = 8; 00021 00022 PUSTelecommand::PUSTelecommand(void) { 00023 tcId = 0; 00024 tcType = 0; 00025 tcSubType = 0; 00026 tcSource = 0; 00027 ackLevel = 0; // all flags set to false 00028 validityCheckCode = 0; 00029 } 00030 00031 bool PUSTelecommand::isValid(void) { 00032 return (validityCheckCode==0); 00033 } 00034 00035 TD_CheckCode PUSTelecommand::getValidityCheckCode(void) const { 00036 return validityCheckCode; 00037 } 00038 00039 void PUSTelecommand::setValidityCheckCode(TD_CheckCode c) { 00040 validityCheckCode = c; 00041 } 00042 00043 00044 TD_TelecommandId PUSTelecommand::getPacketId(void) { 00045 return packetId; 00046 } 00047 00048 void PUSTelecommand::setApplicationId(TD_APID apid) { 00049 assert( apid < (TD_APID)2048 ); 00050 packetId = 2048 + 4096; 00051 packetId = packetId + apid; 00052 } 00053 00054 TD_TelecommandId PUSTelecommand::getTelecommandId(void) const { 00055 assert(tcId>0); 00056 return tcId; 00057 } 00058 00059 void PUSTelecommand::setTelecommandId(TD_TelecommandId tcIdent) { 00060 assert(tcIdent>0); 00061 tcId = tcIdent; 00062 } 00063 00064 TD_TelecommandType PUSTelecommand::getType(void) const { 00065 assert(tcType>0); 00066 return tcType; 00067 } 00068 00069 void PUSTelecommand::setType(TD_TelecommandType tcTyp) { 00070 assert(tcTyp>0); 00071 tcType = tcTyp; 00072 } 00073 00074 TD_TelecommandSubType PUSTelecommand::getSubType(void) const { 00075 assert(tcSubType>0); 00076 return tcSubType; 00077 } 00078 00079 void PUSTelecommand::setSubType(TD_TelecommandSubType tcSubTyp) { 00080 assert(tcSubTyp>0); 00081 tcSubType = tcSubTyp; 00082 } 00083 00084 TD_TelecommandSource PUSTelecommand::getSource() const { 00085 assert(tcSource>0); 00086 return tcSource; 00087 } 00088 00089 void PUSTelecommand::setSource(TD_TelecommandSource tcSrc) { 00090 assert(tcSrc>0); 00091 tcSource = tcSrc; 00092 } 00093 00094 void PUSTelecommand::setAcknowledgeLevel(TD_TelecommandAck ackLevel) { 00095 this->ackLevel = ackLevel; 00096 } 00097 00098 TD_TelecommandAck PUSTelecommand::getAcknowledgeLevel(void) const { 00099 return ackLevel; 00100 } 00101 00102 bool PUSTelecommand::isStartAckRequired(void) const { 00103 return ((ackLevel & startAck) > 0); 00104 } 00105 00106 bool PUSTelecommand::isAcceptanceAckRequired(void) const { 00107 return ((ackLevel & acceptanceAck) > 0); 00108 } 00109 00110 bool PUSTelecommand::isProgressAckRequired(void) const { 00111 return ((ackLevel & progressAck) > 0); 00112 } 00113 00114 bool PUSTelecommand::isCompletionAckRequired(void) const { 00115 return ((ackLevel & completionAck) > 0); 00116 } 00117 00118 bool PUSTelecommand::isObjectConfigured(void) { 00119 return (Telecommand::isObjectConfigured() && 00120 (tcType>0) && 00121 (tcSubType>0) && 00122 (tcSource>0) && 00123 (tcId>0) && 00124 (packetId>0)); 00125 } 00126
Copyright 2003 P&P Software GmbH - All Rights Reserved