Open Lighting Architecture  Latest Git
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_
An Open Pixel Control server.
Definition: OPCServer.h:44
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
Definition: Port.h:199
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
An InputPort for the OPC plugin.
Definition: OPCPort.h:38
A class used to hold a single universe of DMX data.
Definition: PluginAdaptor.h:41
An OutputPort for the OPC plugin.
Definition: OPCPort.h:71
An Open Pixel Control client.
Definition: OPCClient.h:49
OPCInputPort(OPCServerDevice *parent, uint8_t channel, class PluginAdaptor *plugin_adaptor, class OPCServer *server)
Create a new OPC Input Port.
Definition: OPCPort.cpp:36
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Definition: Port.h:282
std::string Description() const
Fetch the string description for a Port.
Definition: OPCPort.cpp:58