41 : m_async_tcp_client_ptr(async_tcp_client)
43 , m_last_request_id(0)
47 m_tcp_parser_ptr = std::make_shared<sick::data_processing::ParseTCPPacket>();
52 CommandPtr command_ptr = std::make_shared<CreateSession>(boost::ref(*
this));
58 CommandPtr command_ptr = std::make_shared<CloseSession>(boost::ref(*
this));
76 command->lockExecutionMutex();
77 std::vector<uint8_t> telegram;
78 telegram = command->constructTelegram(telegram);
80 command->waitForCompletion();
135 pending_command->processReplyBase(*packet.
getBuffer());
bool checkIfPacketIsCompleteAndOtherwiseListenForMorePackets()
bool close()
Closes a session with the sensor. Executes the close session command.
std::shared_ptr< sick::data_processing::TCPPacketMerger > m_packet_merger_ptr
A packetbuffer for the raw data from the sensor.
std::shared_ptr< sick::cola2::Command > CommandPtr
Typedef for a pointer containing a command to be executed.
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
void processPacket(const sick::datastructure::PacketBuffer &packet)
std::shared_ptr< sick::data_processing::ParseTCPPacket > m_tcp_parser_ptr
uint16_t m_last_request_id
bool addPacketToMerger(const sick::datastructure::PacketBuffer &packet)
bool executeCommand(const CommandPtr &command)
Executes the command passed to the function.
Cola2Session(const std::shared_ptr< communication::AsyncTCPClient > &async_tcp_client)
Constructor of the cola2 session.
bool findCommand(const uint16_t &request_id, CommandPtr &command)
void doDisconnect()
Triggers the disconnection of the tcp socket.
std::shared_ptr< sick::communication::AsyncTCPClient > m_async_tcp_client_ptr
bool open()
Opens a session with the sensor. Executes the create session command.
bool sendTelegramAndListenForAnswer(const CommandPtr &command)
bool addCommand(const uint16_t &request_id, const CommandPtr &command)
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...
bool removeCommand(const uint16_t &request_id)
bool startProcessingAndRemovePendingCommandAfterwards(const sick::datastructure::PacketBuffer &packet)
uint32_t getSessionID() const
Returns the current session ID.
std::map< uint16_t, CommandPtr > m_pending_commands_map