1
0
Fork 0
OpenLCP/protocols/sacn
Kevin Matz 5c0cc41af5 worker thread for streaming sACN 2021-09-01 12:53:53 -04:00
..
CMakeLists.txt new name for the ArpitratingUniverse class 2021-08-28 15:28:52 -04:00
README.md additional documentation 2021-08-25 17:20:33 -04:00
arbitratinguniverse.cpp mutex for NULL Start Code data 2021-08-31 11:33:02 -04:00
arbitratinguniverse.h mutex for NULL Start Code data 2021-08-31 11:33:02 -04:00
data.cpp default universe priority 2021-09-01 12:24:02 -04:00
data.h default universe priority 2021-09-01 12:24:02 -04:00
extended.cpp parent isn't set until after istream completes 2021-09-01 12:27:02 -04:00
extended.h keep a list of discovered universes 2021-08-29 11:44:27 -04:00
node.cpp don't force sACN namespace to be all caps 2021-08-28 09:01:33 -04:00
node.h don't force sACN namespace to be all caps 2021-08-28 09:01:33 -04:00
receiver.cpp smart pointers for PDU header and data segments 2021-08-31 11:13:36 -04:00
receiver.h keep a list of discovered universes 2021-08-29 11:44:27 -04:00
sacn.h calculate multicast addresses from universe numbers 2021-08-30 13:30:36 -04:00
source.cpp index off-by-one error 2021-09-01 12:29:11 -04:00
source.h platform driver needs a refactor before output can be const keyword 2021-09-01 12:20:35 -04:00
universe.cpp worker thread for streaming sACN 2021-09-01 12:53:53 -04:00
universe.h worker thread for streaming sACN 2021-09-01 12:53:53 -04:00

README.md

Library for E1.31 sACN

Lightweight streaming protocol for transport of DMX512 using ACN

Top level include

Include sacn.h for full protocol support.

#include "sacn.h"

Requirements

Expects to also have the acn and dmx libraries in the include path.

Logical components

Protocol Handling

  • sacn.h: [SACN] protocol constants.
  • data.h: [SACN::DATA] protocol support for VECTOR_ROOT_E131_DATA packets.
  • extended.h: [SACN::EXTENDED] protocol support for VECTOR_ROOT_E131_EXTENDED packets

Data Classes

  • universe.h: [SACN::Universe] A set of up to 512 data slots identified by universe number. Note: In E1.31 there may be multiple sources for a universe.

For protocol agnostic universe refer to the base class, DMX::Universe

  • receiver.h: [SACN::Receiver] A receiver is the intended target of information from a source. A receiver may listen for multiple universes.

  • source.h: [SACN::Source] A sACN component that assembles, formats, and transmits data to one or many receivers.

  • node.h: [SACN::Node] A class that inherits from both SACN::Source and SACN::Receiver. IE. can both send and receive. The node class also manages universe discovery.

Reference Implementations

Several reference implementations may be available in the platform subdirectory.

  • receiver-esp.h: [SACN::EspReceiver] A reference implementation, derived from SACN::Receiver for use with ESP devices and Arduino.

  • qsacnnode.h: [SACN::QSacnNode] An implementation that inherits from SACN::Node, which handles all of the mucky hardware and network with Qt.

Usage with Arduino

Include receiver-esp.h at the top of your sketch.

Create a receiver object.

EspReceiver * e131 = new EspReceiver();

In setup, subscribe to a universe an register a callback for data activity.

setup() { e131->subscribe(1); e131->universe(1)->onData(std::bind(&universeHandler, std::placeholders::_1)); }

Write a handler function with the follow signature (returns void, requires 1 argument, a Universe pointer):

void universeHandler(Universe * universe) { do something... }