Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
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
29namespace ola {
30namespace plugin {
31namespace 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
65 OPCInputPort(const OPCInputPort &) = delete;
66 const OPCInputPort &operator=(const OPCInputPort &) = delete;
67};
68
73 public:
82 uint8_t channel,
83 class OPCClient *client);
84
85 bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
86
87 std::string Description() const;
88
89 private:
90 class OPCClient* const m_client;
91 const uint8_t m_channel;
92
93 OPCOutputPort(const OPCOutputPort &) = delete;
94 const OPCOutputPort &operator=(const OPCOutputPort &) = delete;
95};
96} // namespace openpixelcontrol
97} // namespace plugin
98} // namespace ola
99#endif // PLUGINS_OPENPIXELCONTROL_OPCPORT_H_
A class used to hold a single universe of DMX data.
Definition Port.h:199
Definition Port.h:283
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
Definition PluginAdaptor.h:41
An Open Pixel Control client.
Definition OPCClient.h:49
An InputPort for the OPC plugin.
Definition OPCPort.h:38
std::string Description() const
Fetch the string description for a Port.
Definition OPCPort.cpp:58
OPCInputPort(OPCServerDevice *parent, uint8_t channel, class PluginAdaptor *plugin_adaptor, class OPCServer *server)
Create a new OPC Input Port.
Definition OPCPort.cpp:36
An OutputPort for the OPC plugin.
Definition OPCPort.h:72
OPCOutputPort(OPCClientDevice *parent, uint8_t channel, class OPCClient *client)
Create a new OPC Output Port.
Definition OPCPort.cpp:65
std::string Description() const
Fetch the string description for a Port.
Definition OPCPort.cpp:78
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition OPCPort.cpp:73
An Open Pixel Control server.
Definition OPCServer.h:44
The namespace containing all OLA symbols.
Definition Credentials.cpp:44