Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 > 
 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 ()
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

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

Create a new OPCServer.

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

Member Function Documentation

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

Initialize the OPCServer.

true if the server is now listening for new connections, false otherwise.
IPV4SocketAddress ola::plugin::openpixelcontrol::OPCServer::ListenAddress ( ) const

The listen address of this server.

The listen address of the server. If the server isn't listening the empty string is returned.
void ola::plugin::openpixelcontrol::OPCServer::SetCallback ( uint8_t  channel,
ChannelCallback callback 

Set the callback to be run when channel data arrives.

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: