ParseTCPPacket.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
35 #ifndef SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSETCPPACKET_H
36 #define SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSETCPPACKET_H
37 
41 
43 
44 namespace sick {
45 
46 namespace cola2 {
50 class Command;
51 } // namespace cola2
52 
53 namespace data_processing {
54 
55 
60 {
61 public:
66 
75  bool parseTCPSequence(const datastructure::PacketBuffer& buffer,
77 
85  uint32_t getExpectedPacketLength(const datastructure::PacketBuffer& buffer);
86 
94  uint16_t getRequestID(const datastructure::PacketBuffer& buffer) const;
95 
96 private:
97  uint32_t readSTx(std::vector<uint8_t>::const_iterator data_ptr) const;
98  uint32_t readLength(std::vector<uint8_t>::const_iterator data_ptr) const;
99  uint16_t readRequestID(std::vector<uint8_t>::const_iterator data_ptr) const;
100  uint8_t readHubCntr(std::vector<uint8_t>::const_iterator data_ptr) const;
101  uint8_t readNoC(std::vector<uint8_t>::const_iterator data_ptr) const;
102  uint32_t readSessionID(std::vector<uint8_t>::const_iterator data_ptr) const;
103  uint8_t readCommandType(std::vector<uint8_t>::const_iterator data_ptr) const;
104  uint8_t readCommandMode(std::vector<uint8_t>::const_iterator data_ptr) const;
105  uint16_t readErrorCode(std::vector<uint8_t>::const_iterator data_ptr) const;
106  std::vector<uint8_t> readData(const datastructure::PacketBuffer& buffer) const;
107  void setCommandValuesFromPacket(const sick::datastructure::PacketBuffer& buffer,
108  sick::cola2::Command& command) const;
109 };
110 
111 } // namespace data_processing
112 } // namespace sick
113 
114 #endif // SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSETCPPACKET_H
A packetbuffer for the raw data from the sensor.
Definition: PacketBuffer.h:61
Parser for an incoming TCP packet.
Base class for commands. Defines the base interface and does the common tasks.
Definition: Command.h:61
ROSLIB_DECL std::string command(const std::string &cmd)


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41