00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 00024 // -- END LICENSE BLOCK ------------------------------------------------ 00025 00026 //---------------------------------------------------------------------- 00033 //---------------------------------------------------------------------- 00034 00035 #include <sick_safetyscanners/cola2/TypeCodeVariableCommand.h> 00036 00037 #include <sick_safetyscanners/cola2/Cola2Session.h> 00038 #include <sick_safetyscanners/cola2/Command.h> 00039 00040 namespace sick { 00041 namespace cola2 { 00042 00043 TypeCodeVariableCommand::TypeCodeVariableCommand(Cola2Session& session, 00044 sick::datastructure::TypeCode& type_code) 00045 : VariableCommand(session, 0x000d) 00046 , m_type_code(type_code) 00047 { 00048 m_writer_ptr = std::make_shared<sick::data_processing::ReadWriteHelper>(); 00049 m_type_code_parser_ptr = std::make_shared<sick::data_processing::ParseTypeCodeData>(); 00050 } 00051 00052 void TypeCodeVariableCommand::addTelegramData( 00053 sick::datastructure::PacketBuffer::VectorBuffer& telegram) const 00054 { 00055 base_class::addTelegramData(telegram); 00056 } 00057 00058 bool TypeCodeVariableCommand::canBeExecutedWithoutSessionID() const 00059 { 00060 return true; 00061 } 00062 00063 bool TypeCodeVariableCommand::processReply() 00064 { 00065 if (!base_class::processReply()) 00066 { 00067 return false; 00068 } 00069 m_type_code_parser_ptr->parseTCPSequence(getDataVector(), m_type_code); 00070 return true; 00071 } 00072 00073 00074 } // namespace cola2 00075 } // namespace sick