21 #ifndef PLUGINS_E131_E131_DMPHEADER_H_
22 #define PLUGINS_E131_E131_DMPHEADER_H_
25 #include "plugins/e131/e131/DMPAddress.h"
36 static const unsigned int DMP_HEADER_SIZE = 1;
38 explicit DMPHeader(uint8_t header = 0): m_header(header) {}
42 dmp_address_type type,
43 dmp_address_size size) {
44 m_header = (uint8_t) (is_virtual << 7 |
51 bool IsVirtual()
const {
return m_header & VIRTUAL_MASK; }
52 bool IsRelative()
const {
return m_header & RELATIVE_MASK; }
54 dmp_address_type Type()
const {
55 return (dmp_address_type) ((m_header & TYPE_MASK) >> 4);
58 dmp_address_size Size()
const {
59 return (dmp_address_size) (m_header & SIZE_MASK);
62 unsigned int Bytes()
const {
return DMPSizeToByteSize(Size()); }
64 bool operator==(
const DMPHeader &other)
const {
65 return m_header == other.m_header;
68 bool operator!=(
const DMPHeader &other)
const {
69 return m_header != other.m_header;
72 uint8_t Header()
const {
return m_header; }
75 static const uint8_t VIRTUAL_MASK = 0x80;
76 static const uint8_t RELATIVE_MASK = 0x40;
77 static const uint8_t TYPE_MASK = 0x30;
78 static const uint8_t SIZE_MASK = 0x03;
84 #endif // PLUGINS_E131_E131_DMPHEADER_H_