Open Lighting Architecture  Latest Git
E131DiscoveryInflator.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15  *
16  * E131DiscoveryInflator.h
17  * An inflator for E1.31 discovery messages.
18  * Copyright (C) 2014 Simon Newton
19  */
20 
21 #ifndef LIBS_ACN_E131DISCOVERYINFLATOR_H_
22 #define LIBS_ACN_E131DISCOVERYINFLATOR_H_
23 
24 #include <memory>
25 #include <vector>
26 #include "ola/Callback.h"
27 #include "ola/acn/ACNVectors.h"
28 #include "libs/acn/BaseInflator.h"
29 
30 namespace ola {
31 namespace acn {
32 
34  public:
35  struct DiscoveryPage {
36  public:
37  const uint8_t page_number;
38  const uint8_t last_page;
39  const uint32_t page_sequence;
40  std::vector<uint16_t> universes;
41 
42  DiscoveryPage(uint8_t page_number, uint8_t last_page)
43  : page_number(page_number),
44  last_page(last_page),
45  page_sequence(0) { // not yet part of the standard
46  }
47  };
50 
51  explicit E131DiscoveryInflator(PageCallback *callback)
52  : m_page_callback(callback) {}
53 
54  uint32_t Id() const { return acn::VECTOR_E131_DISCOVERY; }
55 
56  unsigned int InflatePDUBlock(HeaderSet *headers,
57  const uint8_t *data,
58  unsigned int len);
59 
60 
61  private:
62  std::auto_ptr<PageCallback> m_page_callback;
63 };
64 } // namespace acn
65 } // namespace ola
66 #endif // LIBS_ACN_E131DISCOVERYINFLATOR_H_
Definition: HeaderSet.h:35
The inflator interface.
Definition: BaseInflator.h:42
ACN Vector values.
Definition: ACNVectors.h:66
unsigned int InflatePDUBlock(HeaderSet *headers, const uint8_t *data, unsigned int len)
Parse a block of PDU data.
Definition: E131DiscoveryInflator.cpp:31
Definition: E131DiscoveryInflator.h:33
A 2 argument callback which can be called multiple times.
Definition: Callback.h:1895
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Definition: E131DiscoveryInflator.h:35
uint32_t Id() const
Definition: E131DiscoveryInflator.h:54