20 #include <arpa/inet.h> 31 template <
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
46 void BuildMessage(
const uint8_t *
const payload_buffer,
const unsigned int payload_length );
49 virtual void ParseMessage(
const uint8_t *
const message_buffer ) = 0;
52 void GetMessage( uint8_t *
const message_buffer )
const;
58 void GetPayload( uint8_t *
const payload_buffer )
const;
65 const unsigned int stop_idx )
const;
74 virtual void Clear( );
77 virtual void Print( )
const;
102 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
110 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
132 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
146 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
155 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
161 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
173 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
175 const unsigned int start_idx,
176 const unsigned int stop_idx )
const {
184 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
200 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >
205 std::cout << std::flush;
207 std::cout <<
"Message (hex):" << std::endl;
208 std::cout.setf(std::ios::hex,std::ios::basefield);
212 std::cout << std::endl << std::flush;
214 std::cout <<
"Message (ASCII):" << std::endl;
215 std::cout.setf(std::ios::dec,std::ios::basefield);
219 std::cout << std::endl << std::flush;
225 template<
unsigned int MSG_HEADER_LENGTH,
unsigned int MSG_PAYLOAD_MAX_LENGTH,
unsigned int MSG_TRAILER_LENGTH >