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_EXTRAS_MCU_QUERY_MICROCONTROLLER__H 00041 #define __JAUS_EXTRAS_MCU_QUERY_MICROCONTROLLER__H 00042 00043 #include "jaus/extras/extrascodes.h" 00044 #include "jaus/core/message.h" 00045 00046 namespace JAUS 00047 { 00058 class JAUS_EXTRAS_DLL QueryMicrocontrollerState : public Message 00059 { 00060 public: 00061 QueryMicrocontrollerState(const Address& dest = Address(), 00062 const Address& src = Address()) : Message(QUERY_MICROCONTROLLER_STATE, dest, src) 00063 { 00064 } 00065 QueryMicrocontrollerState(const QueryMicrocontrollerState& message) : Message(QUERY_MICROCONTROLLER_STATE) 00066 { 00067 *this = message; 00068 } 00069 ~QueryMicrocontrollerState() {} 00070 void SetDigitalStates(const std::set<std::string>& digital) { mDigitalDevices = digital; } 00071 void SetAnalogStates(const std::set<std::string>& analog) { mAnalogDevices = analog; } 00072 std::set<std::string>* GetDigitalStates() { return &mDigitalDevices; } 00073 const std::set<std::string>* GetDigitalStates() const { return &mDigitalDevices; } 00074 std::set<std::string>* GetAnalogStates() { return &mAnalogDevices; } 00075 const std::set<std::string>* GetAnalogStates() const { return &mAnalogDevices; } 00076 virtual bool IsCommand() const { return false; } 00077 virtual int WriteMessageBody(Packet& packet) const; 00078 virtual int ReadMessageBody(const Packet& packet); 00079 virtual Message* Clone() const { return new QueryMicrocontrollerState(*this); } 00080 virtual UInt GetPresenceVector() const { return 0; } 00081 virtual UInt GetPresenceVectorSize() const { return 0; } 00082 virtual UInt GetPresenceVectorMask() const { return 0; } 00083 virtual UShort GetMessageCodeOfResponse() const { return REPORT_MICROCONTROLLER_STATE; } 00084 virtual std::string GetMessageName() const { return "Query Microcontroller State"; } 00085 virtual void ClearMessageBody() {} 00086 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize) const; 00087 QueryMicrocontrollerState& operator=(const QueryMicrocontrollerState& message) 00088 { 00089 CopyHeaderData(&message); 00090 mDigitalDevices = message.mDigitalDevices; 00091 mAnalogDevices = message.mAnalogDevices; 00092 return *this; 00093 } 00094 protected: 00095 std::set<std::string> mDigitalDevices; 00096 std::set<std::string> mAnalogDevices; 00097 }; 00098 } 00099 00100 #endif 00101 /* End of File */