FindMeCommand.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
35 
37 
40 
41 namespace sick {
42 namespace cola2 {
43 
44 FindMeCommand::FindMeCommand(Cola2Session& session, uint16_t blink_time)
45  : MethodCommand(session, 14)
46  , m_blink_time(blink_time)
47 {
48 }
49 
50 std::vector<uint8_t> FindMeCommand::addTelegramData(const std::vector<uint8_t>& telegram) const
51 {
52  auto base_output = base_class::addTelegramData(telegram);
53  size_t base_length = base_output.size();
54  auto output = expandTelegram(base_output, 2);
55 
56  // Add new values after telegram
57  const auto new_data_offset_it = output.begin() + base_length + telegram.size();
58 
59  writeDataToDataPtr(new_data_offset_it);
60 
61  return output;
62 }
63 
64 void FindMeCommand::writeDataToDataPtr(std::vector<uint8_t>::iterator data_ptr) const
65 {
67 }
68 
70 {
71  return true;
72 }
73 
75 {
76  return (!base_class::processReply());
77 }
78 
79 
80 } // namespace cola2
81 } // namespace sick
sick::cola2::MethodCommand::processReply
bool processReply()
Processes the return from the sensor.
Definition: MethodCommand.cpp:63
sick::cola2::FindMeCommand::addTelegramData
std::vector< uint8_t > addTelegramData(const std::vector< uint8_t > &telegram) const
Adds the settings as data to the packetbuffer.
Definition: FindMeCommand.cpp:50
sick
Definition: ApplicationNameVariableCommand.h:43
sick::cola2::FindMeCommand::processReply
bool processReply()
Processes the return from the sensor. Checks if the method was acknowledged by the sensor.
Definition: FindMeCommand.cpp:74
Command.h
sick::cola2::Cola2Session
Establishes a cola2 session with a sensor and enables execution of commands in this session.
Definition: Cola2Session.h:72
sick::cola2::FindMeCommand::m_blink_time
uint16_t m_blink_time
Definition: FindMeCommand.h:95
sick::read_write_helper::writeUint16LittleEndian
void writeUint16LittleEndian(std::vector< uint8_t >::iterator it, const uint16_t v)
Writes an unsigned 16-bit integer to a buffer at offset in little endian encoding.
Definition: ReadWriteHelper.hpp:138
sick::cola2::FindMeCommand::canBeExecutedWithoutSessionID
bool canBeExecutedWithoutSessionID() const
Returns if the command can be executed without a session ID. Will return false for most commands exce...
Definition: FindMeCommand.cpp:69
Cola2Session.h
sick::cola2::FindMeCommand::writeDataToDataPtr
void writeDataToDataPtr(std::vector< uint8_t >::iterator data_ptr) const
Definition: FindMeCommand.cpp:64
sick::cola2::MethodCommand::addTelegramData
std::vector< uint8_t > addTelegramData(const std::vector< uint8_t > &telegram) const
Adds the data to the telegram.
Definition: MethodCommand.cpp:49
sick::cola2::Command::expandTelegram
std::vector< uint8_t > expandTelegram(const std::vector< uint8_t > &telegram, size_t additional_bytes) const
Definition: Command.cpp:121
sick::cola2::FindMeCommand::FindMeCommand
FindMeCommand(Cola2Session &session, uint16_t blink_time)
Constructor of the Command, takes the current session and time to blink for.
Definition: FindMeCommand.cpp:44
FindMeCommand.h
sick::cola2::MethodCommand
Command for method calls to the sensor.
Definition: MethodCommand.h:46


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Jun 21 2024 02:40:51