Establishes a cola2 session with a sensor and enables execution of commands in this session.
More...
#include <Cola2Session.h>
Establishes a cola2 session with a sensor and enables execution of commands in this session.
Definition at line 72 of file Cola2Session.h.
◆ CommandPtr
Typedef for a pointer containing a command to be executed.
Definition at line 78 of file Cola2Session.h.
◆ Cola2Session()
Constructor of the cola2 session.
- Parameters
-
async_tcp_client | Pointer 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.
◆ addCommand()
bool sick::cola2::Cola2Session::addCommand |
( |
const uint16_t & |
request_id, |
|
|
const CommandPtr & |
command |
|
) |
| |
|
private |
◆ addPacketToMerger()
◆ checkIfPacketIsCompleteAndOtherwiseListenForMorePackets()
bool sick::cola2::Cola2Session::checkIfPacketIsCompleteAndOtherwiseListenForMorePackets |
( |
| ) |
|
|
private |
◆ close()
bool sick::cola2::Cola2Session::close |
( |
| ) |
|
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.
◆ doDisconnect()
void sick::cola2::Cola2Session::doDisconnect |
( |
| ) |
|
Triggers the disconnection of the tcp socket.
Definition at line 62 of file Cola2Session.cpp.
◆ executeCommand()
bool sick::cola2::Cola2Session::executeCommand |
( |
const CommandPtr & |
command | ) |
|
Executes the command passed to the function.
- Parameters
-
command | The command to be executed. |
- Returns
- If the execution was successful.
Definition at line 67 of file Cola2Session.cpp.
◆ findCommand()
bool sick::cola2::Cola2Session::findCommand |
( |
const uint16_t & |
request_id, |
|
|
CommandPtr & |
command |
|
) |
| |
|
private |
◆ getNextRequestID()
uint16_t sick::cola2::Cola2Session::getNextRequestID |
( |
| ) |
|
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 178 of file Cola2Session.cpp.
◆ getSessionID()
uint32_t sick::cola2::Cola2Session::getSessionID |
( |
| ) |
const |
Returns the current session ID.
- Returns
- The current session ID.
Definition at line 85 of file Cola2Session.cpp.
◆ open()
bool sick::cola2::Cola2Session::open |
( |
| ) |
|
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.
◆ processPacket()
◆ removeCommand()
bool sick::cola2::Cola2Session::removeCommand |
( |
const uint16_t & |
request_id | ) |
|
|
private |
◆ sendTelegramAndListenForAnswer()
bool sick::cola2::Cola2Session::sendTelegramAndListenForAnswer |
( |
const CommandPtr & |
command | ) |
|
|
private |
◆ setSessionID()
void sick::cola2::Cola2Session::setSessionID |
( |
const uint32_t & |
session_id | ) |
|
Sets the current session ID.
- Parameters
-
session_id | The new session ID. |
Definition at line 90 of file Cola2Session.cpp.
◆ startProcessingAndRemovePendingCommandAfterwards()
◆ m_async_tcp_client_ptr
◆ m_command_map_mutex
boost::mutex sick::cola2::Cola2Session::m_command_map_mutex |
|
private |
◆ m_execution_mutex
boost::mutex sick::cola2::Cola2Session::m_execution_mutex |
|
private |
◆ m_last_request_id
uint16_t sick::cola2::Cola2Session::m_last_request_id |
|
private |
◆ m_packet_merger_ptr
◆ m_parser_ptr
◆ m_pending_commands_map
std::map<uint16_t, CommandPtr> sick::cola2::Cola2Session::m_pending_commands_map |
|
private |
◆ m_session_id
uint32_t sick::cola2::Cola2Session::m_session_id |
|
private |
◆ m_tcp_parser_ptr
The documentation for this class was generated from the following files: