Go to the documentation of this file.00001
00016 #ifndef SICK_LMS_1XX_MESSAGE_HH
00017 #define SICK_LMS_1XX_MESSAGE_HH
00018
00019
00020 #define SICK_LMS_1XX_MSG_HEADER_LEN (1) ///< Sick LMS 1xx message header length in bytes
00021 #define SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN (30000) ///< Sick LMS 1xx maximum payload length
00022 #define SICK_LMS_1XX_MSG_TRAILER_LEN (1) ///< Sick LMS 1xx length of the message trailer
00023
00024
00025 #include <string.h>
00026 #include <arpa/inet.h>
00027 #include "SickMessage.hh"
00028 #include "SickException.hh"
00029
00030
00031 namespace SickToolbox {
00032
00037 class SickLMS1xxMessage : public SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN > {
00038
00039 public:
00040
00042 SickLMS1xxMessage( );
00043
00045 SickLMS1xxMessage( const uint8_t * const payload_buffer, const unsigned int payload_length );
00046
00048 SickLMS1xxMessage( const uint8_t * const message_buffer );
00049
00051 void BuildMessage( const uint8_t * const payload_buffer, const unsigned int payload_length );
00052
00054 void ParseMessage( const uint8_t * const message_buffer ) throw ( SickIOException );
00055
00057 std::string GetCommandType( ) const { return _command_type; }
00058
00060 std::string GetCommand( ) const { return _command; }
00061
00063 void Clear( );
00064
00066 void Print( ) const;
00067
00069 ~SickLMS1xxMessage( );
00070
00071 private:
00072
00074 std::string _command_type;
00075
00077 std::string _command;
00078
00079 };
00080
00081 }
00082
00083 #endif