Open Lighting Architecture: ola::plugin::openpixelcontrol::OPCServer Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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.
| ~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

## ◆ OPCServer()

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

Create a new OPCServer.

Parameters

  ss | The SelectServer to use
  listen_addr | the 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

  channel | the OPC channel this callback is for.
  callback | The 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:

- plugins/openpixelcontrol/OPCServer.h
- plugins/openpixelcontrol/OPCServer.cpp