Open Lighting Architecture  0.9.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OPCPort.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  * OPCPort.h
17  * Ports for the Open Pixel Control plugin.
18  * Copyright (C) 2014 Simon Newton
19  */
20 
21 #ifndef PLUGINS_OPENPIXELCONTROL_OPCPORT_H_
22 #define PLUGINS_OPENPIXELCONTROL_OPCPORT_H_
23 
24 #include <string>
25 #include "ola/DmxBuffer.h"
26 #include "olad/Port.h"
27 #include "plugins/openpixelcontrol/OPCDevice.h"
28 
29 namespace ola {
30 namespace plugin {
31 namespace openpixelcontrol {
32 
39  public:
48  uint8_t channel,
49  class PluginAdaptor *plugin_adaptor,
50  class OPCServer *server);
51 
52  const DmxBuffer &ReadDMX() const { return m_buffer; }
53 
54  bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
55 
56  std::string Description() const;
57 
58  private:
59  const uint8_t m_channel;
60  class OPCServer* const m_server;
61  DmxBuffer m_buffer;
62 
63  void NewData(uint8_t command, const uint8_t *data, unsigned int length);
64 
66 };
67 
72  public:
81  uint8_t channel,
82  class OPCClient *client);
83 
84  bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
85 
86  std::string Description() const;
87 
88  private:
89  class OPCClient* const m_client;
90  const uint8_t m_channel;
91 
93 };
94 } // namespace openpixelcontrol
95 } // namespace plugin
96 } // namespace ola
97 #endif // PLUGINS_OPENPIXELCONTROL_OPCPORT_H_