00001 00026 #ifndef ODVA_ETHERNETIP_IDENTITY_ITEM_DATA_H 00027 #define ODVA_ETHERNETIP_IDENTITY_ITEM_DATA_H 00028 00029 #include <string> 00030 00031 #include "odva_ethernetip/eip_types.h" 00032 #include "odva_ethernetip/serialization/reader.h" 00033 #include "odva_ethernetip/serialization/writer.h" 00034 #include "odva_ethernetip/serialization/serializable.h" 00035 00036 namespace eip { 00037 00038 using std::string; 00039 using serialization::Serializable; 00040 using serialization::Reader; 00041 using serialization::Writer; 00042 00046 class IdentityItemData : public Serializable 00047 { 00048 public: 00049 EIP_UINT encap_protocol_version; 00050 sockaddr_in sockaddr; 00051 EIP_UINT vendor_id; 00052 EIP_UINT device_type; 00053 EIP_UINT product_code; 00054 EIP_USINT revision[2]; 00055 EIP_WORD status; 00056 EIP_UDINT serial_number; 00057 string product_name; 00058 EIP_USINT state; 00059 00064 virtual size_t getLength() const; 00065 00072 virtual Writer& serialize(Writer& writer) const; 00073 00077 virtual Reader& deserialize(Reader& reader, size_t length) 00078 { 00079 deserialize(reader); 00080 return reader; 00081 } 00082 00089 virtual Reader& deserialize(Reader& reader); 00090 }; 00091 00092 } // namespace eip 00093 00094 #endif // ODVA_ETHERNETIP_IDENTITY_ITEM_DATA_H