Open Lighting Architecture  0.9.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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.

Classes

struct  RxState

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.
 ~OPCServer ()
 Destructor.
bool Init ()
 Initialize the OPCServer.
void SetCallback (uint8_t channel, ChannelCallback *callback)
 Set the callback to be run when channel data arrives.
ola::network::IPV4SocketAddress ListenAddress () const
 The listen address of this server.

Constructor & Destructor Documentation

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

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

Initialize the OPCServer.

Returns
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.

Returns
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.

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: