some library documentation
This commit is contained in:
parent
073d3b7a05
commit
43c0e61465
|
@ -0,0 +1,31 @@
|
|||
# Library for E1.17 ACN
|
||||
## `Architecture for Control Networks`
|
||||
|
||||
## Top level include
|
||||
Include `acn.h` for full protocol support.
|
||||
|
||||
> ```#include "acn.h"```
|
||||
|
||||
## Logical components
|
||||
|
||||
### Protocol Handling
|
||||
* ACN Architecture
|
||||
* `pdu.h`: [`ACN::PDU`]
|
||||
* `rlp.h`: [`ACN::RLP`]
|
||||
|
||||
|
||||
* Device Management Protocol
|
||||
* `dmp.h`: [`ACN::DMP`]
|
||||
|
||||
|
||||
* Session Data Transport
|
||||
* `sdt.h`: [`ACN::SDT`]
|
||||
|
||||
### EPI Support
|
||||
* EPI 17. ACN Root Layer Protocol
|
||||
Operation on UDP
|
||||
* `rlp-udp.h`: [`ACN::RLP::UDP`]
|
||||
|
||||
|
||||
* EPI 18. Operation of SDT on UDP Networks
|
||||
* `sdt-udp.h`: [`ACN::SDT::UDP`]
|
|
@ -0,0 +1,53 @@
|
|||
# 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 the parent directory to contain the `acn` and `dmx` libraries.
|
||||
|
||||
## 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 on multiple universes.
|
||||
* `receiver-esp.h`: [`SACN::EspReceiver`] A referance implimention, derived from `SACN::Receiver` for use with ESP devices and Arduino.
|
||||
|
||||
## Usage with Arduino
|
||||
|
||||
Include `receiver-esp.h` at the top of your sketch.
|
||||
> ```
|
||||
> #include "src/lib/sacn/receiver-esp.h"
|
||||
> ```
|
||||
|
||||
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...
|
||||
}
|
||||
> ```
|
Loading…
Reference in New Issue