ED247 Library  VA2.3.0
Implementation of ED247-A standard
ed247_frame_header.h
1 /* -*- mode: c++; c-basic-offset: 2 -*- */
2 #ifndef _ED247_HEADER_H_
3 #define _ED247_HEADER_H_
4 #include "ed247.h"
5 #include "ed247_xml.h"
6 
7 namespace ed247
8 {
9  class FrameHeader
10  {
11  public:
12  FrameHeader(const xml::Header& configuration, ed247_uid_t ec_id, const std::string& channel_name);
13 
14  void encode(char* frame, uint32_t frame_size, uint32_t& frame_index /*inout*/);
15  bool decode(const char* frame, uint32_t frame_size, uint32_t& frame_index /*inout*/);
16 
17  uint32_t get_size() const { return (_configuration._enable == ED247_YESNO_YES)? header_size : 0; }
18  const ed247_sample_details_t& get_recv_frame_details() const { return _recv_frame_details; }
19  uint16_t get_next_serial_number() const { return _send_sn; }
20 
21  private:
22  xml::Header _configuration;
23  ed247_uid_t _ec_id_big_endian;
24  std::string _channel_name;
25  ed247_sample_details_t _recv_frame_details;
26  uint16_t _send_sn;
27 
28  // size in bytes if header present
29  static const uint32_t header_size;
30  };
31 }
32 
33 #endif
Definition: ed247_frame_header.h:9
uint16_t ed247_uid_t
Unique identifier type.
Definition: ed247.h:115
Definition: ed247_channel.cpp:37
Definition: ed247_xml.h:86
Sample Details.
Definition: ed247.h:909