Open Lighting Architecture: ola::plugin::artnet::ArtNetNodeImpl Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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.
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.
bool | ExitConfigurationMode ()
| End the configuration transaction.
bool | SetShortName (const std::string &name)
| Set the short name.
std::string | ShortName () const
bool | SetLongName (const std::string &name)
| Set the long name.
std::string | LongName () const
bool | SetNetAddress (uint8_t net_address)
| Set the net address for this node.
uint8_t | NetAddress () const
bool | SetSubnetAddress (uint8_t subnet_address)
| Set the subnet address for this node.
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.
void | DisableInputPort (uint8_t port_id)
| Disable an input port.
bool | InputPortState (uint8_t port_id) const
| Check the state of an input port.
bool | SetOutputPortUniverse (uint8_t port_id, uint8_t universe_id)
| Set the universe for an output port.
uint8_t | GetOutputPortUniverse (uint8_t port_id)
void | DisableOutputPort (uint8_t port_id)
| Disable an output port.
bool | OutputPortState (uint8_t port_id) const
| Check the state of an output port.
void | SetBroadcastThreshold (unsigned int threshold)
bool | SetMergeMode (uint8_t port_id, artnet_merge_mode merge_mode)
| Set the merge mode for an output port.
bool | SendPoll ()
| Send an ArtPoll if any of the ports are sending data.
bool | SendDMX (uint8_t port_id, const ola::DmxBuffer &buffer)
| Send some DMX data.
void | RunFullDiscovery (uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
| Flush the TOD and force a full discovery.
void | RunIncrementalDiscovery (uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
| Run an 'incremental' discovery. This just involves fetching the TOD from all nodes.
void | SendRDMRequest (uint8_t port_id, ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
| Send an RDMRequest on this port.
bool | SetUnsolicitedUIDSetHandler (uint8_t port_id, ola::Callback1< void, const ola::rdm::UIDSet & > *on_tod)
| Set the RDM handlers for an Input port.
void | GetSubscribedNodes (uint8_t port_id, std::vector< ola::network::IPV4Address > *node_addresses)
| Get the nodes listening to the universe a port is sending.
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.
bool | SendTod (uint8_t port_id, const ola::rdm::UIDSet &uid_set)
| Send an set of UIDs in one of more ArtTod packets.
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

  iface | the interface to use.
  ss | a pointer to a SelectServerInterface to use
  options | the ArtNetNodeOptions for the node.
  socket | a 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_id | a 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_id | a 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 ArtNet III net-address.

Parameters

  port_id | a 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_id | a 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_id | the id of the port to fetch nodes for
  [out] | node_addresses | a 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_id | a 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_id | a 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_id | port to discover on
  callback | the 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_id | port to send on
  callback | the 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_id | port to send on
  buffer | the 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_id | the id of the port to send the request on
  request | the RDMRequest object
  on_complete | the 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_id | the id of the port to send on
  uid_set | the 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_id | the id of the port to register the handler for
  buffer | a pointer to the DmxBuffer
  handler | the 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

  name | the 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_id | a port id between 0 and ARTNET_MAX_PORTS - 1
  merge_mode | the artnet_merge_mode

## ◆ SetNetAddress()

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

Set the net address for this node.

Parameters

  net_address | the ArtNet '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_id | a port id between 0 and ARTNET_MAX_PORTS - 1
  universe_id | the new universe id.

## ◆ SetShortName()

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

Set the short name.

Parameters

  name | the short node name

## ◆ SetSubnetAddress()

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

Set the subnet address for this node.

Parameters

  subnet_address | the ArtNet '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_id | the id of the port to set the handlers for
  on_tod | the 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:

- plugins/artnet/ArtNetNode.h
- plugins/artnet/ArtNetNode.cpp