21 #ifndef PLUGINS_E131_E131_DMPHEADER_H_
22 #define PLUGINS_E131_E131_DMPHEADER_H_
26 #include "plugins/e131/e131/DMPAddress.h"
39 static const unsigned int DMP_HEADER_SIZE = 1;
41 explicit DMPHeader(uint8_t header = 0): m_header(header) {}
45 dmp_address_type type,
46 dmp_address_size size) {
47 m_header = (uint8_t) (is_virtual << 7 |
54 bool IsVirtual()
const {
return m_header & VIRTUAL_MASK; }
55 bool IsRelative()
const {
return m_header & RELATIVE_MASK; }
57 dmp_address_type Type()
const {
58 return (dmp_address_type) ((m_header & TYPE_MASK) >> 4);
61 dmp_address_size Size()
const {
62 return (dmp_address_size) (m_header & SIZE_MASK);
65 unsigned int Bytes()
const {
return DMPSizeToByteSize(Size()); }
67 bool operator==(
const DMPHeader &other)
const {
68 return m_header == other.m_header;
71 bool operator!=(
const DMPHeader &other)
const {
72 return m_header != other.m_header;
75 uint8_t Header()
const {
return m_header; }
78 static const uint8_t VIRTUAL_MASK = 0x80;
79 static const uint8_t RELATIVE_MASK = 0x40;
80 static const uint8_t TYPE_MASK = 0x30;
81 static const uint8_t SIZE_MASK = 0x03;
87 #endif // PLUGINS_E131_E131_DMPHEADER_H_