Open Lighting Architecture  Latest Git
Classes | Public Member Functions | List of all members
ola::plugin::artnet::ArtNetNodeImpl Class Reference

Classes

class  InputPort
 

Public Member Functions

 ArtNetNodeImpl (const ola::network::Interface &iface, ola::io::SelectServerInterface *ss, const ArtNetNodeOptions &options, ola::network::UDPSocketInterface *socket=NULL)
 Create a new node. More...
 
virtual ~ArtNetNodeImpl ()
 Cleanup.
 
bool Start ()
 Start this node. The port modifying functions can be called before this.
 
bool Stop ()
 Stop this node.
 
bool EnterConfigurationMode ()
 Start the configuration transaction. More...
 
bool ExitConfigurationMode ()
 End the configuration transaction. More...
 
bool SetShortName (const std::string &name)
 Set the short name. More...
 
std::string ShortName () const
 
bool SetLongName (const std::string &name)
 Set the long name. More...
 
std::string LongName () const
 
bool SetNetAddress (uint8_t net_address)
 Set the net address for this node. More...
 
uint8_t NetAddress () const
 
bool SetSubnetAddress (uint8_t subnet_address)
 Set the subnet address for this node. More...
 
uint8_t SubnetAddress () const
 
uint8_t InputPortCount () const
 
bool SetInputPortUniverse (uint8_t port_id, uint8_t universe_id)
 
uint8_t GetInputPortUniverse (uint8_t port_id) const
 Get an input port universe address. More...
 
void DisableInputPort (uint8_t port_id)
 Disable an input port. More...
 
bool InputPortState (uint8_t port_id) const
 Check the state of an input port. More...
 
bool SetOutputPortUniverse (uint8_t port_id, uint8_t universe_id)
 Set the universe for an output port. More...
 
uint8_t GetOutputPortUniverse (uint8_t port_id)
 
void DisableOutputPort (uint8_t port_id)
 Disable an output port. More...
 
bool OutputPortState (uint8_t port_id) const
 Check the state of an output port. More...
 
void SetBroadcastThreshold (unsigned int threshold)
 
bool SetMergeMode (uint8_t port_id, artnet_merge_mode merge_mode)
 Set the merge mode for an output port. More...
 
bool SendPoll ()
 Send an ArtPoll if any of the ports are sending data. More...
 
bool SendDMX (uint8_t port_id, const ola::DmxBuffer &buffer)
 Send some DMX data. More...
 
void RunFullDiscovery (uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
 Flush the TOD and force a full discovery. More...
 
void RunIncrementalDiscovery (uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
 Run an 'incremental' discovery. This just involves fetching the TOD from all nodes. More...
 
void SendRDMRequest (uint8_t port_id, ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
 Send an RDMRequest on this port. More...
 
bool SetUnsolicitedUIDSetHandler (uint8_t port_id, ola::Callback1< void, const ola::rdm::UIDSet &> *on_tod)
 Set the RDM handlers for an Input port. More...
 
void GetSubscribedNodes (uint8_t port_id, std::vector< ola::network::IPV4Address > *node_addresses)
 Get the nodes listening to the universe a port is sending. More...
 
bool SetDMXHandler (uint8_t port_id, DmxBuffer *buffer, ola::Callback0< void > *handler)
 Set the closure to be called when we receive data for this universe. More...
 
bool SendTod (uint8_t port_id, const ola::rdm::UIDSet &uid_set)
 Send an set of UIDs in one of more ArtTod packets. More...
 
bool SetOutputPortRDMHandlers (uint8_t port_id, ola::Callback0< void > *on_discover, ola::Callback0< void > *on_flush, ola::Callback2< void, ola::rdm::RDMRequest *, ola::rdm::RDMCallback *> *on_rdm_request)
 Set the RDM handlers for an Output port.
 
bool SendTimeCode (const ola::timecode::TimeCode &timecode)
 Send a timecode packet.
 

Constructor & Destructor Documentation

◆ ArtNetNodeImpl()

ola::plugin::artnet::ArtNetNodeImpl::ArtNetNodeImpl ( const ola::network::Interface iface,
ola::io::SelectServerInterface ss,
const ArtNetNodeOptions options,
ola::network::UDPSocketInterface socket = NULL 
)

Create a new node.

Parameters
ifacethe interface to use.
ssa pointer to a SelectServerInterface to use
optionsthe ArtNetNodeOptions for the node.
socketa pointer to a UDPSocketInterface to use

Member Function Documentation

◆ DisableInputPort()

void ola::plugin::artnet::ArtNetNodeImpl::DisableInputPort ( uint8_t  port_id)

Disable an input port.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1

◆ DisableOutputPort()

void ola::plugin::artnet::ArtNetNodeImpl::DisableOutputPort ( uint8_t  port_id)

Disable an output port.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1

◆ EnterConfigurationMode()

bool ola::plugin::artnet::ArtNetNodeImpl::EnterConfigurationMode ( )

Start the configuration transaction.

Configuration mode allows the caller to make changes without triggering an ArtPoll or ArtPollReply per change. e.g.

Example
node.EnterConfigurationMode()
node.SetShortName()
node.SetInputPortUniverse()
node.SetOutputPortUniverse()
// The poll / poll reply is sent here
node.ExitConfigurationMode()
Returns
false if there is already a transaction pending.

◆ ExitConfigurationMode()

bool ola::plugin::artnet::ArtNetNodeImpl::ExitConfigurationMode ( )

End the configuration transaction.

Returns
false if we weren't in a transaction.
See also
EnterConfigurationMode

◆ GetInputPortUniverse()

uint8_t ola::plugin::artnet::ArtNetNodeImpl::GetInputPortUniverse ( uint8_t  port_id) const

Get an input port universe address.

Return the 8bit universe address for a port. This does not include the Art-Net III net-address.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1
Returns
The universe address for the port. Invalid port_ids return 0.

◆ GetOutputPortUniverse()

uint8_t ola::plugin::artnet::ArtNetNodeImpl::GetOutputPortUniverse ( uint8_t  port_id)

Return the current universe address for an output port

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1
Returns
the universe address for the port

◆ GetSubscribedNodes()

void ola::plugin::artnet::ArtNetNodeImpl::GetSubscribedNodes ( uint8_t  port_id,
std::vector< ola::network::IPV4Address > *  node_addresses 
)

Get the nodes listening to the universe a port is sending.

Populate the vector with a list of IP addresses that are known to be listening for the universe that this port is sending

Parameters
port_idthe id of the port to fetch nodes for
[out]node_addressesa vector of nodes listening to the port

◆ InputPortCount()

uint8_t ola::plugin::artnet::ArtNetNodeImpl::InputPortCount ( ) const

Get the number of input ports

Returns
the number of input ports

◆ InputPortState()

bool ola::plugin::artnet::ArtNetNodeImpl::InputPortState ( uint8_t  port_id) const

Check the state of an input port.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1
Returns
the state (enabled or disabled) of an input port. An invalid port_id returns false.

◆ OutputPortState()

bool ola::plugin::artnet::ArtNetNodeImpl::OutputPortState ( uint8_t  port_id) const

Check the state of an output port.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1
Returns
the state (enabled or disabled) of an output port. An invalid port_id returns false.

◆ RunFullDiscovery()

void ola::plugin::artnet::ArtNetNodeImpl::RunFullDiscovery ( uint8_t  port_id,
ola::rdm::RDMDiscoveryCallback callback 
)

Flush the TOD and force a full discovery.

The DiscoverableQueueingRDMController ensures this is only called one at a time.

Parameters
port_idport to discover on
callbackthe RDMDiscoveryCallback to run when discovery completes

◆ RunIncrementalDiscovery()

void ola::plugin::artnet::ArtNetNodeImpl::RunIncrementalDiscovery ( uint8_t  port_id,
ola::rdm::RDMDiscoveryCallback callback 
)

Run an 'incremental' discovery. This just involves fetching the TOD from all nodes.

The DiscoverableQueueingRDMController ensures only one discovery process is running per port at any time.

Parameters
port_idport to send on
callbackthe RDMDiscoveryCallback to run when discovery completes

◆ SendDMX()

bool ola::plugin::artnet::ArtNetNodeImpl::SendDMX ( uint8_t  port_id,
const ola::DmxBuffer buffer 
)

Send some DMX data.

Parameters
port_idport to send on
bufferthe DMX data
Returns
true if it was sent successfully, false otherwise

◆ SendPoll()

bool ola::plugin::artnet::ArtNetNodeImpl::SendPoll ( )

Send an ArtPoll if any of the ports are sending data.

This should be called periodically if we're sending data.

◆ SendRDMRequest()

void ola::plugin::artnet::ArtNetNodeImpl::SendRDMRequest ( uint8_t  port_id,
ola::rdm::RDMRequest request,
ola::rdm::RDMCallback on_complete 
)

Send an RDMRequest on this port.

This may defer the sending if there are other outstanding messages in the queue.

Parameters
port_idthe id of the port to send the request on
requestthe RDMRequest object
on_completethe RDMCallback to run

Because this is wrapped in the QueueingRDMController this will only be called one-at-a-time (per port)

◆ SendTod()

bool ola::plugin::artnet::ArtNetNodeImpl::SendTod ( uint8_t  port_id,
const ola::rdm::UIDSet uid_set 
)

Send an set of UIDs in one of more ArtTod packets.

Parameters
port_idthe id of the port to send on
uid_setthe UIDSet to send

◆ SetDMXHandler()

bool ola::plugin::artnet::ArtNetNodeImpl::SetDMXHandler ( uint8_t  port_id,
DmxBuffer buffer,
ola::Callback0< void > *  handler 
)

Set the closure to be called when we receive data for this universe.

Parameters
port_idthe id of the port to register the handler for
buffera pointer to the DmxBuffer
handlerthe Callback0 to call when there is data for this universe. Ownership of the closure is transferred to the node.

◆ SetInputPortUniverse()

bool ola::plugin::artnet::ArtNetNodeImpl::SetInputPortUniverse ( uint8_t  port_id,
uint8_t  universe_id 
)

Set the universe address of an input port

◆ SetLongName()

bool ola::plugin::artnet::ArtNetNodeImpl::SetLongName ( const std::string &  name)

Set the long name.

Parameters
namethe long node name

◆ SetMergeMode()

bool ola::plugin::artnet::ArtNetNodeImpl::SetMergeMode ( uint8_t  port_id,
artnet_merge_mode  merge_mode 
)

Set the merge mode for an output port.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1
merge_modethe artnet_merge_mode

◆ SetNetAddress()

bool ola::plugin::artnet::ArtNetNodeImpl::SetNetAddress ( uint8_t  net_address)

Set the net address for this node.

Parameters
net_addressthe Art-Net 'net' address

◆ SetOutputPortUniverse()

bool ola::plugin::artnet::ArtNetNodeImpl::SetOutputPortUniverse ( uint8_t  port_id,
uint8_t  universe_id 
)

Set the universe for an output port.

Parameters
port_ida port id between 0 and ARTNET_MAX_PORTS - 1
universe_idthe new universe id.

◆ SetShortName()

bool ola::plugin::artnet::ArtNetNodeImpl::SetShortName ( const std::string &  name)

Set the short name.

Parameters
namethe short node name

◆ SetSubnetAddress()

bool ola::plugin::artnet::ArtNetNodeImpl::SetSubnetAddress ( uint8_t  subnet_address)

Set the subnet address for this node.

Parameters
subnet_addressthe Art-Net 'subnet' address, 4 bits.

◆ SetUnsolicitedUIDSetHandler()

bool ola::plugin::artnet::ArtNetNodeImpl::SetUnsolicitedUIDSetHandler ( uint8_t  port_id,
ola::Callback1< void, const ola::rdm::UIDSet &> *  on_tod 
)

Set the RDM handlers for an Input port.

Parameters
port_idthe id of the port to set the handlers for
on_todthe callback to be invoked when a ArtTod message is received, and the RDM process isn't running.

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