Open Lighting Architecture  Latest Git
Classes | Public Types | Public Member Functions | List of all members
ola::plugin::openpixelcontrol::OPCServer Class Reference

Detailed Description

An Open Pixel Control server.

The server listens on a TCP port and receives OPC data.

Public Types

typedef Callback3< void, uint8_t, const uint8_t *, unsigned int > ChannelCallback
 The callback executed when new OPC data arrives.
 

Public Member Functions

 OPCServer (ola::io::SelectServerInterface *ss, const ola::network::IPV4SocketAddress &listen_addr)
 Create a new OPCServer. More...
 
 ~OPCServer ()
 Destructor.
 
bool Init ()
 Initialize the OPCServer. More...
 
void SetCallback (uint8_t channel, ChannelCallback *callback)
 Set the callback to be run when channel data arrives. More...
 
ola::network::IPV4SocketAddress ListenAddress () const
 The listen address of this server. More...
 

Constructor & Destructor Documentation

◆ OPCServer()

ola::plugin::openpixelcontrol::OPCServer::OPCServer ( ola::io::SelectServerInterface ss,
const ola::network::IPV4SocketAddress listen_addr 
)

Create a new OPCServer.

Parameters
ssThe SelectServer to use
listen_addrthe IP:port to listen on.

Member Function Documentation

◆ Init()

bool ola::plugin::openpixelcontrol::OPCServer::Init ( )

Initialize the OPCServer.

Returns
true if the server is now listening for new connections, false otherwise.

◆ ListenAddress()

IPV4SocketAddress ola::plugin::openpixelcontrol::OPCServer::ListenAddress ( ) const

The listen address of this server.

Returns
The listen address of the server. If the server isn't listening the empty string is returned.

◆ SetCallback()

void ola::plugin::openpixelcontrol::OPCServer::SetCallback ( uint8_t  channel,
ChannelCallback callback 
)

Set the callback to be run when channel data arrives.

Parameters
channelthe OPC channel this callback is for.
callbackThe callback to run, ownership is transferred and any previous callbacks for this channel are removed.

The documentation for this class was generated from the following files: