Open Lighting Architecture  0.9.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
E131Sender.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  * E131Sender.h
17  * Interface for the E131Sender class, this abstracts the encapsulation and
18  * sending of DMP PDUs contained within E131PDUs.
19  * Copyright (C) 2007 Simon Newton
20  */
21 
22 #ifndef PLUGINS_E131_E131_E131SENDER_H_
23 #define PLUGINS_E131_E131_E131SENDER_H_
24 
25 #include "ola/network/Socket.h"
26 #include "plugins/e131/e131/DMPPDU.h"
27 #include "plugins/e131/e131/E131Header.h"
28 #include "plugins/e131/e131/PreamblePacker.h"
29 #include "plugins/e131/e131/Transport.h"
30 #include "plugins/e131/e131/UDPTransport.h"
31 
32 namespace ola {
33 namespace plugin {
34 namespace e131 {
35 
36 class DMPInflator;
37 
38 class E131Sender {
39  public:
41  class RootSender *root_sender);
42  ~E131Sender() {}
43 
44  bool SendDMP(const E131Header &header, const DMPPDU *pdu);
45  bool SendDiscoveryData(const E131Header &header, const uint8_t *data,
46  unsigned int data_size);
47 
48  static bool UniverseIP(unsigned int universe,
49  class ola::network::IPV4Address *addr);
50 
51  private:
52  ola::network::UDPSocket *m_socket;
53  PreamblePacker m_packer;
54  OutgoingUDPTransportImpl m_transport_impl;
55  class RootSender *m_root_sender;
56 
58 };
59 } // namespace e131
60 } // namespace plugin
61 } // namespace ola
62 #endif // PLUGINS_E131_E131_E131SENDER_H_