Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
E133Inflator.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  *
16  * E133Inflator.h
17  * Interface for the E133Inflator class.
18  * Copyright (C) 2011 Simon Newton
19  */
20 
21 #ifndef PLUGINS_E131_E131_E133INFLATOR_H_
22 #define PLUGINS_E131_E131_E133INFLATOR_H_
23 
24 #include "ola/acn/ACNVectors.h"
25 #include "plugins/e131/e131/BaseInflator.h"
26 #include "plugins/e131/e131/E133Header.h"
27 
28 namespace ola {
29 namespace plugin {
30 namespace e131 {
31 
32 class E133Inflator: public BaseInflator {
33  friend class E133InflatorTest;
34 
35  public:
36  E133Inflator()
37  : BaseInflator(),
38  m_last_header_valid(false) {
39  }
40  ~E133Inflator() {}
41 
42  uint32_t Id() const { return ola::acn::VECTOR_ROOT_E133; }
43 
44  protected:
45  bool DecodeHeader(HeaderSet *headers,
46  const uint8_t *data,
47  unsigned int len,
48  unsigned int &bytes_used);
49 
50  void ResetHeaderField() {
51  m_last_header_valid = false;
52  }
53  private:
54  E133Header m_last_header;
55  bool m_last_header_valid;
56 };
57 } // namespace e131
58 } // namespace plugin
59 } // namespace ola
60 #endif // PLUGINS_E131_E131_E133INFLATOR_H_