00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 #ifndef __JAUS_MOBILITY_QUERY_VELOCITY_COMMAND__H 00041 #define __JAUS_MOBILITY_QUERY_VELOCITY_COMMAND__H 00042 00043 #include "jaus/core/message.h" 00044 #include "jaus/mobility/mobilitycodes.h" 00045 00046 namespace JAUS 00047 { 00057 class JAUS_MOBILITY_DLL QueryVelocityCommand : public Message 00058 { 00059 public: 00067 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00068 { 00069 public: 00070 const static Byte VelocityX = 0x01; 00071 const static Byte VelocityY = 0x02; 00072 const static Byte VelocityZ = 0x04; 00073 const static Byte RollRate = 0x08; 00074 const static Byte PitchRate = 0x10; 00075 const static Byte YawRate = 0x20; 00076 }; 00077 // Command types when issuing commands. 00078 enum Command 00079 { 00080 SetCurrentCommand = 0, 00081 SetMaximumAllowedValues, 00082 SetMinimumAllowedValues, 00083 SetDefaultCommand 00084 }; 00085 QueryVelocityCommand(const Address& dest = Address(), const Address& src = Address()); 00086 QueryVelocityCommand(const QueryVelocityCommand& message); 00087 ~QueryVelocityCommand(); 00088 void SetPresenceVector(const Byte presenceVector) { mPresenceVector = presenceVector; } 00089 inline Byte SetCommandType(const Command type) { return mCommandType = type; } 00090 inline Byte GetCommandType() const { return mCommandType; } 00091 virtual bool IsCommand() const { return false; } 00092 virtual int WriteMessageBody(Packet& packet) const; 00093 virtual int ReadMessageBody(const Packet& packet); 00094 virtual Message* Clone() const { return new QueryVelocityCommand(*this); } 00095 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00096 virtual UInt GetPresenceVectorSize() const { return BYTE_SIZE; } 00097 virtual UInt GetPresenceVectorMask() const { return 0x3F; } 00098 virtual UShort GetMessageCodeOfResponse() const { return REPORT_VELOCITY_COMMAND; } 00099 virtual std::string GetMessageName() const { return "Query Velocity Command"; } 00100 virtual void ClearMessageBody(); 00101 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00102 virtual int RunTestCase() const; 00103 QueryVelocityCommand& operator=(const QueryVelocityCommand& message); 00104 protected: 00105 Byte mPresenceVector; 00106 Command mCommandType; 00107 }; 00108 } 00109 00110 #endif 00111 /* End of File */