21#ifndef PLUGINS_OPENPIXELCONTROL_OPCSERVER_H_
22#define PLUGINS_OPENPIXELCONTROL_OPCSERVER_H_
29#include "ola/io/SelectServerInterface.h"
31#include "ola/network/TCPSocket.h"
32#include "ola/network/TCPSocketFactory.h"
33#include "plugins/openpixelcontrol/OPCConstants.h"
37namespace openpixelcontrol {
91 uint16_t expected_size;
93 unsigned int buffer_size;
99 data =
new uint8_t[buffer_size];
109 typedef std::map<ola::network::TCPSocket*, RxState*> ClientMap;
115 std::auto_ptr<ola::network::TCPAcceptingSocket> m_listening_socket;
117 std::map<uint8_t, ChannelCallback*> m_callbacks;
Constants used throughout OLA.
A class used to hold a single universe of DMX data.
Represents Socket Addresses.
A 3 argument callback which can be called multiple times.
Definition Callback.h:2838
The interface for the SelectServer.
Definition SelectServerInterface.h:42
Definition TCPSocketFactory.h:46
An IPv4 SocketAddress.
Definition SocketAddress.h:78
Definition TCPSocket.h:43
An Open Pixel Control server.
Definition OPCServer.h:44
ola::network::IPV4SocketAddress ListenAddress() const
The listen address of this server.
Definition OPCServer.cpp:95
Callback3< void, uint8_t, const uint8_t *, unsigned int > ChannelCallback
The callback executed when new OPC data arrives.
Definition OPCServer.h:50
bool Init()
Initialize the OPCServer.
Definition OPCServer.cpp:84
void SetCallback(uint8_t channel, ChannelCallback *callback)
Set the callback to be run when channel data arrives.
Definition OPCServer.cpp:105
OPCServer(ola::io::SelectServerInterface *ss, const ola::network::IPV4SocketAddress &listen_addr)
Create a new OPCServer.
Definition OPCServer.cpp:60
~OPCServer()
Destructor.
Definition OPCServer.cpp:68
@ OPC_FRAME_SIZE
The size of an OPC frame with DMX512 data.
Definition OPCConstants.h:41
The namespace containing all OLA symbols.
Definition Credentials.cpp:44