Public Types | Public Member Functions | Private Member Functions | Private Attributes
sick::cola2::Cola2Session Class Reference

Establishes a cola2 session with a sensor and enables execution of commands in this session. More...

#include <Cola2Session.h>

List of all members.

Public Types

typedef std::shared_ptr
< sick::cola2::Command
CommandPtr
 Typedef for a pointer containing a command to be executed.

Public Member Functions

bool close ()
 Closes a session with the sensor. Executes the close session command.
 Cola2Session (const std::shared_ptr< communication::AsyncTCPClient > &async_tcp_client)
 Constructor of the cola2 session.
void doDisconnect ()
 Triggers the disconnection of the tcp socket.
bool executeCommand (const CommandPtr &command)
 Executes the command passed to the function.
uint16_t getNextRequestID ()
 Returns the next request ID. The request ID is used to match the return packages of the sensor to the right command.
uint32_t getSessionID () const
 Returns the current session ID.
bool open ()
 Opens a session with the sensor. Executes the create session command.
void setSessionID (const uint32_t &session_id)
 Sets the current session ID.

Private Member Functions

bool addCommand (const uint16_t &request_id, const CommandPtr &command)
bool addPacketToMerger (const sick::datastructure::PacketBuffer &packet)
bool checkIfPacketIsCompleteAndOtherwiseListenForMorePackets ()
bool findCommand (const uint16_t &request_id, CommandPtr &command)
void processPacket (const sick::datastructure::PacketBuffer &packet)
bool removeCommand (const uint16_t &request_id)
bool sendTelegramAndListenForAnswer (const CommandPtr &command)
bool startProcessingAndRemovePendingCommandAfterwards (const sick::datastructure::PacketBuffer &packet)

Private Attributes

std::shared_ptr
< sick::communication::AsyncTCPClient
m_async_tcp_client_ptr
boost::mutex m_execution_mutex
uint16_t m_last_request_id
std::shared_ptr
< sick::data_processing::TCPPacketMerger
m_packet_merger_ptr
std::shared_ptr
< sick::data_processing::ParseTCPPacket
m_parser_ptr
std::map< uint16_t, CommandPtrm_pending_commands_map
uint32_t m_session_id
std::shared_ptr
< sick::data_processing::ParseTCPPacket
m_tcp_parser_ptr

Detailed Description

Establishes a cola2 session with a sensor and enables execution of commands in this session.

Definition at line 72 of file Cola2Session.h.


Member Typedef Documentation

Typedef for a pointer containing a command to be executed.

Definition at line 78 of file Cola2Session.h.


Constructor & Destructor Documentation

sick::cola2::Cola2Session::Cola2Session ( const std::shared_ptr< communication::AsyncTCPClient > &  async_tcp_client) [explicit]

Constructor of the cola2 session.

Parameters:
async_tcp_clientPointer to an instance of a TCP-client. Will be used to establish a connection to the sensor.

Definition at line 40 of file Cola2Session.cpp.


Member Function Documentation

bool sick::cola2::Cola2Session::addCommand ( const uint16_t &  request_id,
const CommandPtr command 
) [private]

Definition at line 138 of file Cola2Session.cpp.

Definition at line 104 of file Cola2Session.cpp.

Definition at line 114 of file Cola2Session.cpp.

Closes a session with the sensor. Executes the close session command.

Returns:
If closing the session was successful.

Definition at line 56 of file Cola2Session.cpp.

Triggers the disconnection of the tcp socket.

Definition at line 62 of file Cola2Session.cpp.

Executes the command passed to the function.

Parameters:
commandThe command to be executed.
Returns:
If the execution was successful.

Definition at line 67 of file Cola2Session.cpp.

bool sick::cola2::Cola2Session::findCommand ( const uint16_t &  request_id,
CommandPtr command 
) [private]

Definition at line 148 of file Cola2Session.cpp.

Returns the next request ID. The request ID is used to match the return packages of the sensor to the right command.

Returns:
A new request ID.

Definition at line 169 of file Cola2Session.cpp.

Returns the current session ID.

Returns:
The current session ID.

Definition at line 85 of file Cola2Session.cpp.

Opens a session with the sensor. Executes the create session command.

Returns:
If opening a session was successful.

Definition at line 50 of file Cola2Session.cpp.

Definition at line 95 of file Cola2Session.cpp.

bool sick::cola2::Cola2Session::removeCommand ( const uint16_t &  request_id) [private]

Definition at line 158 of file Cola2Session.cpp.

Definition at line 74 of file Cola2Session.cpp.

void sick::cola2::Cola2Session::setSessionID ( const uint32_t &  session_id)

Sets the current session ID.

Parameters:
session_idThe new session ID.

Definition at line 90 of file Cola2Session.cpp.

Definition at line 125 of file Cola2Session.cpp.


Member Data Documentation

Definition at line 143 of file Cola2Session.h.

Definition at line 150 of file Cola2Session.h.

Definition at line 153 of file Cola2Session.h.

Definition at line 145 of file Cola2Session.h.

Definition at line 144 of file Cola2Session.h.

Definition at line 148 of file Cola2Session.h.

Definition at line 152 of file Cola2Session.h.

Definition at line 146 of file Cola2Session.h.


The documentation for this class was generated from the following files:


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Tue May 7 2019 03:27:37