Method command class for changing the settings in the sensor. Such as which data packages to enable. More...
#include <ChangeCommSettingsCommand.h>
Public Types | |
typedef sick::cola2::MethodCommand | base_class |
Typedef to reference the base class. More... | |
Public Member Functions | |
void | addTelegramData (sick::datastructure::PacketBuffer::VectorBuffer &telegram) const |
Adds the settings as data to the packetbuffer. More... | |
bool | canBeExecutedWithoutSessionID () const |
Returns if the command can be executed without a session ID. Will return false for most commands except the commands to establish a connection. More... | |
ChangeCommSettingsCommand (Cola2Session &session, const datastructure::CommSettings &settings) | |
Constructor of the Command, takes the current session and the new set of parameters for the sensor. More... | |
bool | processReply () |
Processes the return from the sensor. Checks if the method was acknowledged by the sensor. More... | |
Public Member Functions inherited from sick::cola2::MethodCommand | |
void | addTelegramData (sick::datastructure::PacketBuffer::VectorBuffer &telegram) const |
Adds the data to the telegram. More... | |
bool | canBeExecutedWithoutSessionID () const |
Returns if the command can be executed without a session ID. Will return false for most commands except the commands to establish a connection. More... | |
uint16_t | getMethodIndex () const |
MethodCommand (Cola2Session &session, const uint16_t &method_index) | |
Constructor of the method command. More... | |
bool | processReply () |
Processes the return from the sensor. More... | |
void | setMethodIndex (const uint16_t &method_index) |
Public Member Functions inherited from sick::cola2::Command | |
Command (sick::cola2::Cola2Session &session, const uint16_t &command_type, const uint16_t &command_mode) | |
Constructor of the command. Sets the common variables for a command to the sensor. More... | |
void | constructTelegram (sick::datastructure::PacketBuffer::VectorBuffer &telegram) const |
Adds the data to the telegram and afterwards the header with the correct length. More... | |
uint8_t | getCommandMode () const |
Returns the command mode. More... | |
uint8_t | getCommandType () const |
Returns the command type. More... | |
std::vector< uint8_t > | getDataVector () const |
Returns the data vector. More... | |
uint16_t | getRequestID () const |
Returns the request id of the command. More... | |
uint32_t | getSessionID () const |
Returns the current session ID. More... | |
void | lockExecutionMutex () |
Locks a mutex to prevent other commands being executed in parallel. More... | |
void | processReplyBase (const sick::datastructure::PacketBuffer::VectorBuffer &packet) |
Parses the da incoming data package and then processes it with the inherited processReply. Afterwards the mutex will be unlocked to allow new commands to be send. More... | |
void | setCommandMode (const uint8_t &command_mode) |
Sets the command mode. More... | |
void | setCommandType (const uint8_t &command_type) |
Sets the command type. More... | |
void | setDataVector (const std::vector< uint8_t > &data) |
Sets the data vector. More... | |
void | setRequestID (const uint16_t &request_id) |
Sets the request ID of the command. More... | |
void | setSessionID (const uint32_t &session_id) |
Sets the session ID. More... | |
void | waitForCompletion () |
Scooped call to the mutex, which will block until the reply was processed. More... | |
bool | wasSuccessful () const |
Returns if the command was successfully parsed. More... | |
virtual | ~Command () |
We have virtual member functions, so a virtual destructor is needed. More... | |
Private Member Functions | |
uint8_t * | prepareTelegramAndGetDataPtr (sick::datastructure::PacketBuffer::VectorBuffer &telegram) const |
void | writeChannelToDataPtr (uint8_t *&data_ptr) const |
void | writeDataToDataPtr (uint8_t *&data_ptr) const |
void | writeEInterfaceTypeToDataPtr (uint8_t *&data_ptr) const |
void | writeEnabledToDataPtr (uint8_t *&data_ptr) const |
void | writeEndAngleToDataPtr (uint8_t *&data_ptr) const |
void | writeFeaturesToDataPtr (uint8_t *&data_ptr) const |
void | writeFrequencyToDataPtr (uint8_t *&data_ptr) const |
void | writeIPAddresstoDataPtr (uint8_t *&data_ptr) const |
void | writePortToDataPtr (uint8_t *&data_ptr) const |
void | writeStartAngleToDataPtr (uint8_t *&data_ptr) const |
Private Attributes | |
sick::datastructure::CommSettings | m_settings |
std::shared_ptr< sick::data_processing::ReadWriteHelper > | m_writer_ptr |
Additional Inherited Members | |
Protected Attributes inherited from sick::cola2::Command | |
sick::cola2::Cola2Session & | m_session |
Method command class for changing the settings in the sensor. Such as which data packages to enable.
Definition at line 51 of file ChangeCommSettingsCommand.h.
Typedef to reference the base class.
Definition at line 57 of file ChangeCommSettingsCommand.h.
sick::cola2::ChangeCommSettingsCommand::ChangeCommSettingsCommand | ( | Cola2Session & | session, |
const datastructure::CommSettings & | settings | ||
) |
Constructor of the Command, takes the current session and the new set of parameters for the sensor.
session | The current Cola2 session, in which the parameters should be transferred. |
settings | The new settings for the sensor. While the command will be executed in the session, these parameters will be set in the sensor. |
Definition at line 44 of file ChangeCommSettingsCommand.cpp.
|
virtual |
Adds the settings as data to the packetbuffer.
telegram | The telegram, which will be modified the settings as data. |
Implements sick::cola2::Command.
Definition at line 52 of file ChangeCommSettingsCommand.cpp.
bool sick::cola2::ChangeCommSettingsCommand::canBeExecutedWithoutSessionID | ( | ) | const |
Returns if the command can be executed without a session ID. Will return false for most commands except the commands to establish a connection.
Definition at line 83 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 62 of file ChangeCommSettingsCommand.cpp.
|
virtual |
Processes the return from the sensor. Checks if the method was acknowledged by the sensor.
Implements sick::cola2::Command.
Definition at line 88 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 97 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 70 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 107 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 102 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 132 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 137 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 122 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 112 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 117 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 127 of file ChangeCommSettingsCommand.cpp.
|
private |
Definition at line 98 of file ChangeCommSettingsCommand.h.
|
private |
Definition at line 97 of file ChangeCommSettingsCommand.h.