Go to the documentation of this file.
35 #ifndef SICK_SAFETYSCANNERS_COLA2_COLA2SESSION_H
36 #define SICK_SAFETYSCANNERS_COLA2_COLA2SESSION_H
49 #include <boost/bind.hpp>
78 typedef std::shared_ptr<sick::cola2::Command>
CommandPtr;
86 explicit Cola2Session(
const std::shared_ptr<communication::AsyncTCPClient>& async_tcp_client);
173 #endif // SICK_SAFETYSCANNERS_COLA2_COLA2SESSION_H
std::shared_ptr< sick::cola2::Command > CommandPtr
Typedef for a pointer containing a command to be executed.
bool addPacketToMerger(const sick::datastructure::PacketBuffer &packet)
uint16_t m_last_request_id
Cola2Session(const std::shared_ptr< communication::AsyncTCPClient > &async_tcp_client)
Constructor of the cola2 session.
boost::mutex m_command_map_mutex
bool close()
Closes a session with the sensor. Executes the close session command.
Establishes a cola2 session with a sensor and enables execution of commands in this session.
std::shared_ptr< sick::data_processing::ParseTCPPacket > m_tcp_parser_ptr
void doDisconnect()
Triggers the disconnection of the tcp socket.
bool findCommand(const uint16_t &request_id, CommandPtr &command)
bool sendTelegramAndListenForAnswer(const CommandPtr &command)
bool executeCommand(const CommandPtr &command)
Executes the command passed to the function.
bool open()
Opens a session with the sensor. Executes the create session command.
boost::mutex m_execution_mutex
std::shared_ptr< sick::communication::AsyncTCPClient > m_async_tcp_client_ptr
void setSessionID(const uint32_t &session_id)
Sets the current session ID.
uint16_t getNextRequestID()
Returns the next request ID. The request ID is used to match the return packages of the sensor to the...
std::shared_ptr< sick::data_processing::ParseTCPPacket > m_parser_ptr
bool removeCommand(const uint16_t &request_id)
uint32_t getSessionID() const
Returns the current session ID.
A packetbuffer for the raw data from the sensor.
std::map< uint16_t, CommandPtr > m_pending_commands_map
bool addCommand(const uint16_t &request_id, const CommandPtr &command)
bool startProcessingAndRemovePendingCommandAfterwards(const sick::datastructure::PacketBuffer &packet)
std::shared_ptr< sick::data_processing::TCPPacketMerger > m_packet_merger_ptr
bool checkIfPacketIsCompleteAndOtherwiseListenForMorePackets()
void processPacket(const sick::datastructure::PacketBuffer &packet)