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
FindMeCommand(Cola2Session &session, uint16_t blink_time)
Constructor of the Command, takes the current session and time to blink for.
Command for method calls to the sensor.
Definition: MethodCommand.h:46
void writeDataToDataPtr(std::vector< uint8_t >::iterator data_ptr) const
bool canBeExecutedWithoutSessionID() const
Returns if the command can be executed without a session ID. Will return false for most commands exce...
std::vector< uint8_t > expandTelegram(const std::vector< uint8_t > &telegram, size_t additional_bytes) const
Definition: Command.cpp:121
std::vector< uint8_t > addTelegramData(const std::vector< uint8_t > &telegram) const
Adds the settings as data to the packetbuffer.
bool processReply()
Processes the return from the sensor.
bool processReply()
Processes the return from the sensor. Checks if the method was acknowledged by the sensor...
std::vector< uint8_t > addTelegramData(const std::vector< uint8_t > &telegram) const
Adds the data to the telegram.
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.
Establishes a cola2 session with a sensor and enables execution of commands in this session...
Definition: Cola2Session.h:72


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41