Open Lighting Architecture  0.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | List of all members
ola::acn::E131Node Class Reference

Classes

struct  KnownController
 
struct  Options
 Options for the E131Node. More...
 

Public Member Functions

 E131Node (ola::thread::SchedulerInterface *ss, const std::string &ip_address, const Options &options, const ola::acn::CID &cid=ola::acn::CID::Generate())
 Create a new E1.31 node. More...
 
bool Start ()
 Start this node.
 
bool Stop ()
 Stop this node.
 
bool SetSourceName (uint16_t universe, const std::string &source)
 Set the name for a universe. More...
 
bool StartStream (uint16_t universe)
 Signal that we will start sending on this particular universe. Without sending any DMX data. More...
 
bool TerminateStream (uint16_t universe, uint8_t priority=DEFAULT_PRIORITY)
 Signal that we will no longer send on this particular universe. More...
 
bool SendDMX (uint16_t universe, const ola::DmxBuffer &buffer, uint8_t priority=DEFAULT_PRIORITY, bool preview=false)
 Send some DMX data. More...
 
bool SendDMXWithSequenceOffset (uint16_t universe, const ola::DmxBuffer &buffer, int8_t sequence_offset, uint8_t priority=DEFAULT_PRIORITY, bool preview=false)
 Send some DMX data, allowing finer grained control of parameters. More...
 
bool SendStreamTerminated (uint16_t universe, const ola::DmxBuffer &buffer=DmxBuffer(), uint8_t priority=DEFAULT_PRIORITY)
 Signal termination of the stream for a universe. More...
 
bool SetHandler (uint16_t universe, ola::DmxBuffer *buffer, uint8_t *priority, ola::Callback0< void > *handler)
 Set the Callback to be run when we receive data for this universe. More...
 
bool RemoveHandler (uint16_t universe)
 Remove the handler for a particular universe. More...
 
const ola::network::InterfaceGetInterface () const
 Return the Interface this node is using.
 
ola::network::UDPSocketGetSocket ()
 Return the UDP socket this node is using.
 
void GetKnownControllers (std::vector< KnownController > *controllers)
 Return a list of known controllers. More...
 

Constructor & Destructor Documentation

ola::acn::E131Node::E131Node ( ola::thread::SchedulerInterface ss,
const std::string &  ip_address,
const Options options,
const ola::acn::CID cid = ola::acn::CID::Generate() 
)

Create a new E1.31 node.

Parameters
ssthe SchedulerInterface to use.
ip_addressthe IP address to prefer to listen on
optionsthe Options to use for the node.
cidthe CID to use, if not provided we generate one.

Member Function Documentation

void ola::acn::E131Node::GetKnownControllers ( std::vector< KnownController > *  controllers)

Return a list of known controllers.

This will return an empty list unless enable_draft_discovery was set in the node Options.

bool ola::acn::E131Node::RemoveHandler ( uint16_t  universe)

Remove the handler for a particular universe.

Parameters
universethe universe handler to remove
Returns
true if removed, false if it didn't exist
bool ola::acn::E131Node::SendDMX ( uint16_t  universe,
const ola::DmxBuffer buffer,
uint8_t  priority = DEFAULT_PRIORITY,
bool  preview = false 
)

Send some DMX data.

Parameters
universethe id of the universe to send
bufferthe DMX data.
prioritythe priority to use
previewset to true to turn on the preview bit
Returns
true if it was sent successfully, false otherwise
bool ola::acn::E131Node::SendDMXWithSequenceOffset ( uint16_t  universe,
const ola::DmxBuffer buffer,
int8_t  sequence_offset,
uint8_t  priority = DEFAULT_PRIORITY,
bool  preview = false 
)

Send some DMX data, allowing finer grained control of parameters.

The method is provided for the testing framework. Don't use it in production code!

Parameters
universethe id of the universe to send
bufferthe DMX data
sequence_offsetused to twiddle the sequence numbers, this doesn't increment the sequence counter.
prioritythe priority to use
previewset to true to turn on the preview bit
Returns
true if it was sent successfully, false otherwise
bool ola::acn::E131Node::SendStreamTerminated ( uint16_t  universe,
const ola::DmxBuffer buffer = DmxBuffer(),
uint8_t  priority = DEFAULT_PRIORITY 
)

Signal termination of the stream for a universe.

Parameters
universethe id of the universe to send
bufferthe last DmxBuffer to send.
prioritythe priority to use, this doesn't actually make a difference.

This does not remove the universe from the list of active TX universes, so it should only be used for testing purposes.

bool ola::acn::E131Node::SetHandler ( uint16_t  universe,
ola::DmxBuffer buffer,
uint8_t *  priority,
ola::Callback0< void > *  handler 
)

Set the Callback to be run when we receive data for this universe.

Parameters
universethe universe to register the handler for
bufferthe DmxBuffer to copy the data to.
prioritythe priority to set.
handlerthe Callback to call when there is data for this universe. Ownership is transferred.
bool ola::acn::E131Node::SetSourceName ( uint16_t  universe,
const std::string &  source 
)

Set the name for a universe.

Parameters
universethe id of the universe to send
sourcethe new source name.
bool ola::acn::E131Node::StartStream ( uint16_t  universe)

Signal that we will start sending on this particular universe. Without sending any DMX data.

Parameters
universeto start sending on.
bool ola::acn::E131Node::TerminateStream ( uint16_t  universe,
uint8_t  priority = DEFAULT_PRIORITY 
)

Signal that we will no longer send on this particular universe.

Parameters
universeto terminate sending on.
prioritythe priority to use in the stream terminated message.

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