markdown block quotes from the standard
This commit is contained in:
parent
bb290ab7cb
commit
287ae5f6cc
|
@ -35,19 +35,19 @@ namespace DATA {
|
|||
void data_header::iStream(ACN::PDU::Stream stream)
|
||||
{
|
||||
stream->readString(source_name, 64);
|
||||
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
///
|
||||
/// No priority outside the range of 0 to 200 shall be transmitted
|
||||
/// on the network.
|
||||
/// > \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
/// >
|
||||
/// > No priority outside the range of 0 to 200 shall be transmitted
|
||||
/// > on the network.
|
||||
*stream >> priority;
|
||||
if (priority> 200)
|
||||
stream->setstate(std::ios_base::failbit);
|
||||
*stream >> sync_address;
|
||||
*stream >> sequence_number;
|
||||
*stream >> options;
|
||||
/// \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
///
|
||||
/// Universe values shall be limited to the range 1 to 63999.
|
||||
/// > \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
/// >
|
||||
/// > Universe values shall be limited to the range 1 to 63999.
|
||||
*stream >> universe;
|
||||
if ((universe == 0) ||
|
||||
(universe >= 64000 && universe != E131_DISCOVERY_UNIVERSE))
|
||||
|
@ -62,10 +62,10 @@ void data_header::iStream(ACN::PDU::Stream stream)
|
|||
void data_header::oStream(ACN::PDU::Stream stream) const
|
||||
{
|
||||
stream->writeString(source_name, 64);
|
||||
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
///
|
||||
/// No priority outside the range of 0 to 200 shall be transmitted on
|
||||
/// the network.
|
||||
/// > \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
/// >
|
||||
/// > No priority outside the range of 0 to 200 shall be transmitted on
|
||||
/// > the network.
|
||||
*stream << (priority <= 200 ? priority : 200);
|
||||
*stream << sync_address;
|
||||
*stream << sequence_number;
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "sacn.h"
|
||||
|
||||
/**
|
||||
* \cite sACN 1.4 Classes of Data Appropriate for Transmission
|
||||
* @brief \cite sACN 1.4 Classes of Data Appropriate for Transmission
|
||||
*
|
||||
* This standard, E1.31, is intended to define a method to carry DMX512-A
|
||||
* \cite DMX style data and metadata over IP Networks. It is designed to carry
|
||||
* repetitive control data from one or more sources to one or more receivers.
|
||||
* This protocol is intended to be used to control dimmers, other lighting
|
||||
* devices, and related non- hazardous effects equipment.
|
||||
* > This standard, E1.31, is intended to define a method to carry DMX512-A
|
||||
* > \cite DMX style data and metadata over IP Networks. It is designed to carry
|
||||
* > repetitive control data from one or more sources to one or more receivers.
|
||||
* > This protocol is intended to be used to control dimmers, other lighting
|
||||
* > devices, and related non- hazardous effects equipment.
|
||||
*/
|
||||
namespace sACN::DATA {
|
||||
|
||||
|
@ -65,61 +65,62 @@ struct data_options
|
|||
struct data_header
|
||||
: ACN::PDU::pdu_header
|
||||
{
|
||||
/// \cite sACN 6.2.2 E1.31 Data Packet: Source Name
|
||||
/// @brief \cite sACN 6.2.2 E1.31 Data Packet: Source Name
|
||||
///
|
||||
/// A user-assigned name provided by the source of the packet for use in
|
||||
/// displaying the identity of a source to a user. There is no mechanism,
|
||||
/// other than user configuration, to ensure uniqueness of this name. The
|
||||
/// source name shall be null-terminated. If the source component implements
|
||||
/// ACN discovery as defined in EPI 19 \cite epi19, then this name shall be
|
||||
/// the same as the UACN field specified in EPI 19 \cite epi19. User-Assigned
|
||||
/// Component Names, as the title suggests, supply a single name for an entire
|
||||
/// component, so this Source Name field will exist for each unique CID, but
|
||||
/// may be the same across multiple universes sourced by the same component.
|
||||
std::string source_name;
|
||||
/// > A user-assigned name provided by the source of the packet for use in
|
||||
/// > displaying the identity of a source to a user. There is no mechanism,
|
||||
/// > other than user configuration, to ensure uniqueness of this name. The
|
||||
/// > source name shall be null-terminated. If the source component implements
|
||||
/// > ACN discovery as defined in EPI 19 \cite epi19, then this name shall be
|
||||
/// > the same as the UACN field specified in EPI 19 \cite epi19.
|
||||
/// > User-Assigned Component Names, as the title suggests, supply a single
|
||||
/// > name for an entire component, so this Source Name field will exist for
|
||||
/// > each unique CID, but may be the same across multiple universes sourced
|
||||
/// > by the same component.
|
||||
std::string source_name;
|
||||
|
||||
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
/// @brief \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
///
|
||||
/// The Priority field is an unsigned, one octet field. The value is used by
|
||||
/// receivers in selecting between multiple sources of data for a given
|
||||
/// universe number. Sources that do not support variable priority shall
|
||||
/// transmit a priority of 100. No priority outside the range of 0 to 200
|
||||
/// shall be transmitted on the network. Priority increases with numerical
|
||||
/// value, e.g., 200 is a higher priority than 100.
|
||||
uint8_t priority;
|
||||
/// > The Priority field is an unsigned, one octet field. The value is used by
|
||||
/// > receivers in selecting between multiple sources of data for a given
|
||||
/// > universe number. Sources that do not support variable priority shall
|
||||
/// > transmit a priority of 100. No priority outside the range of 0 to 200
|
||||
/// > shall be transmitted on the network. Priority increases with numerical
|
||||
/// > value, e.g., 200 is a higher priority than 100.
|
||||
uint8_t priority;
|
||||
|
||||
/// \cite sACN 6.2.4 E1.31 Data Packet: Synchronization Address
|
||||
/// @brief \cite sACN 6.2.4 E1.31 Data Packet: Synchronization Address
|
||||
///
|
||||
/// The Synchronization Address identifies a universe number to be used for
|
||||
/// universe synchronization.
|
||||
uint16_t sync_address;
|
||||
/// > The Synchronization Address identifies a universe number to be used for
|
||||
/// > universe synchronization.
|
||||
uint16_t sync_address;
|
||||
|
||||
/// \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number
|
||||
/// @brief \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number
|
||||
///
|
||||
/// In a routed network environment it is possible for packets to be received
|
||||
/// in a different order to the one in which they were sent. The sequence
|
||||
/// number allows receivers or diagnostic equipment to detect out of sequence
|
||||
/// or lost packets.
|
||||
///
|
||||
/// Sources shall maintain a sequence for each universe they
|
||||
/// transmit. The sequence number for a universe shall be incremented by one
|
||||
/// for every packet sent on that universe. There is no implied relationship
|
||||
/// between the sequence number of an E1.31 Synchronization Packet and the
|
||||
/// sequence number of an E1.31 Data Packet on that same universe.
|
||||
uint8_t sequence_number;
|
||||
/// > In a routed network environment it is possible for packets to be received
|
||||
/// > in a different order to the one in which they were sent. The sequence
|
||||
/// > number allows receivers or diagnostic equipment to detect out of sequence
|
||||
/// > or lost packets.
|
||||
/// >
|
||||
/// > Sources shall maintain a sequence for each universe they
|
||||
/// > transmit. The sequence number for a universe shall be incremented by one
|
||||
/// > for every packet sent on that universe. There is no implied relationship
|
||||
/// > between the sequence number of an E1.31 Synchronization Packet and the
|
||||
/// > sequence number of an E1.31 Data Packet on that same universe.
|
||||
uint8_t sequence_number;
|
||||
|
||||
/// \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
/// @brief \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
///
|
||||
/// This bit-oriented field is used to encode optional flags that control
|
||||
/// how the packet is used.
|
||||
/// > This bit-oriented field is used to encode optional flags that control
|
||||
/// > how the packet is used.
|
||||
data_options options;
|
||||
|
||||
/// \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
/// @brief \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
///
|
||||
/// The Universe is a 16-bit field that defines the universe number of the
|
||||
/// data carried in the packet. Universe values shall be limited to the range
|
||||
/// 1 to 63999.
|
||||
uint16_t universe;
|
||||
/// > The Universe is a 16-bit field that defines the universe number of the
|
||||
/// > data carried in the packet. Universe values shall be limited to the
|
||||
/// > range 1 to 63999.
|
||||
uint16_t universe;
|
||||
|
||||
size_t streamSize() const override { return 71; }
|
||||
void iStream(ACN::PDU::Stream) override;
|
||||
|
|
|
@ -77,13 +77,13 @@ public:
|
|||
|
||||
|
||||
/**
|
||||
* \cite sACN 1.6 Universe Discovery
|
||||
* @brief \cite sACN 1.6 Universe Discovery
|
||||
*
|
||||
* This standard includes a Universe Discovery packet that sources must provide
|
||||
* in order to enumerate the universes upon which they are transmitting. This
|
||||
* allows other devices interested in network traffic to monitor which universes
|
||||
* are currently active, without the need to join every multicast group to
|
||||
* examine their individual transmissions.
|
||||
* > This standard includes a Universe Discovery packet that sources must
|
||||
* > provide in order to enumerate the universes upon which they are
|
||||
* > transmitting. This allows other devices interested in network traffic to
|
||||
* > monitor which universes are currently active, without the need to join
|
||||
* > every multicast group to examine their individual transmissions.
|
||||
*/
|
||||
namespace DISCOVERY {
|
||||
|
||||
|
@ -136,9 +136,9 @@ struct discovery_list_data
|
|||
/**
|
||||
* @brief \cite sACN 3.10 E1.31 Universe Discovery Packet
|
||||
*
|
||||
* An E1.31 Universe Discovery Packet is a packet which contains a packed list
|
||||
* of the universes upon which a source is actively operating. It is transmitted
|
||||
* with the VECTOR_E131_EXTENDED_DISCOVERY vector.
|
||||
* > An E1.31 Universe Discovery Packet is a packet which contains a packed
|
||||
* > list of the universes upon which a source is actively operating. It is
|
||||
* > transmitted with the VECTOR_E131_EXTENDED_DISCOVERY vector.
|
||||
*/
|
||||
class Pdu
|
||||
: public ACN::PDU::Pdu
|
||||
|
|
|
@ -33,11 +33,11 @@ namespace sACN {
|
|||
/**
|
||||
* @brief The MergeProxyUniverse class
|
||||
*
|
||||
* \cite sACN 6.2.3.1 Multiple Sources at Highest Priority
|
||||
*
|
||||
* It is possible for there to be multiple sources, all transmitting data at the
|
||||
* highest currently active priority for a given universe. When this occurs,
|
||||
* receivers must handle these sources in some way.
|
||||
* > \cite sACN 6.2.3.1 Multiple Sources at Highest Priority
|
||||
* >
|
||||
* > It is possible for there to be multiple sources, all transmitting data at the
|
||||
* > highest currently active priority for a given universe. When this occurs,
|
||||
* > receivers must handle these sources in some way.
|
||||
*/
|
||||
class MergeProxyUniverse
|
||||
: public sACN::Universe
|
||||
|
|
|
@ -39,58 +39,58 @@ struct Provenance
|
|||
Provenance();
|
||||
explicit Provenance(ACN::PDU::Message<DATA::Pdu>);
|
||||
|
||||
/// \cite sACN 5.6 CID (Component Identifier)
|
||||
/// @brief \cite sACN 5.6 CID (Component Identifier)
|
||||
///
|
||||
/// The Root Layer contains a CID. The CID shall be compliant with RFC 4122
|
||||
/// \cite uuid.
|
||||
/// > The Root Layer contains a CID. The CID shall be compliant with RFC 4122
|
||||
/// > \cite uuid.
|
||||
UUID::uuid cid;
|
||||
|
||||
/// \cite sACN 6.2.2 E1.31 Data Packet: Source Name
|
||||
/// @brief \cite sACN 6.2.2 E1.31 Data Packet: Source Name
|
||||
///
|
||||
/// A user-assigned name provided by the source of the packet for use in
|
||||
/// displaying the identity of a source to a user.
|
||||
///
|
||||
/// If the source component implements ACN discovery as defined in EPI 19
|
||||
/// \cite epi19, then this name shall be the same as the UACN field specified
|
||||
/// in EPI 19 \cite epi19. User-Assigned Component Names supply a single name
|
||||
/// for an entire component, so this Source Name field will exist for each
|
||||
/// unique CID, but may be the same across multiple universes sourced by the
|
||||
/// same component.
|
||||
/// > A user-assigned name provided by the source of the packet for use in
|
||||
/// > displaying the identity of a source to a user.
|
||||
/// >
|
||||
/// > If the source component implements ACN discovery as defined in EPI 19
|
||||
/// > \cite epi19, then this name shall be the same as the UACN field specified
|
||||
/// > in EPI 19 \cite epi19. User-Assigned Component Names supply a single name
|
||||
/// > for an entire component, so this Source Name field will exist for each
|
||||
/// > unique CID, but may be the same across multiple universes sourced by the
|
||||
/// > same component.
|
||||
std::string source_name;
|
||||
|
||||
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
/// @brief \cite sACN 6.2.3 E1.31 Data Packet: Priority
|
||||
///
|
||||
/// Sources that do not support variable priority shall transmit a priority
|
||||
/// of 100. Priority increases with numerical value, e.g., 200 is a higher
|
||||
/// priority than 100.
|
||||
/// > Sources that do not support variable priority shall transmit a priority
|
||||
/// > of 100. Priority increases with numerical value, e.g., 200 is a higher
|
||||
/// > priority than 100.
|
||||
uint8_t priority;
|
||||
|
||||
/// \cite sACN 6.2.4 E1.31 Data Packet: Synchronization Address
|
||||
/// @brief \cite sACN 6.2.4 E1.31 Data Packet: Synchronization Address
|
||||
///
|
||||
/// The Synchronization Address identifies a universe number to be used for
|
||||
/// universe synchronization.
|
||||
/// > The Synchronization Address identifies a universe number to be used for
|
||||
/// > universe synchronization.
|
||||
uint16_t sync_address;
|
||||
|
||||
/// \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number
|
||||
/// @brief \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number
|
||||
///
|
||||
/// Sources shall maintain a sequence for each universe they
|
||||
/// transmit. The sequence number for a universe shall be incremented by one
|
||||
/// for every packet sent on that universe. There is no implied relationship
|
||||
/// between the sequence number of an E1.31 Synchronization Packet and the
|
||||
/// sequence number of an E1.31 Data Packet on that same universe.
|
||||
/// > Sources shall maintain a sequence for each universe they
|
||||
/// > transmit. The sequence number for a universe shall be incremented by one
|
||||
/// > for every packet sent on that universe. There is no implied relationship
|
||||
/// > between the sequence number of an E1.31 Synchronization Packet and the
|
||||
/// > sequence number of an E1.31 Data Packet on that same universe.
|
||||
uint8_t sequence_number;
|
||||
|
||||
/// \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
/// @brief \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
///
|
||||
/// This bit-oriented field is used to encode optional flags that control
|
||||
/// how the packet is used.
|
||||
/// > This bit-oriented field is used to encode optional flags that control
|
||||
/// > how the packet is used.
|
||||
DATA::data_options options;
|
||||
|
||||
/// \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
/// @brief \cite sACN 6.2.7 E1.31 Data Packet: Universe
|
||||
///
|
||||
/// The Universe is a 16-bit field that defines the universe number of the
|
||||
/// data carried in the packet. Universe values shall be limited to the range
|
||||
/// 1 to 63999.
|
||||
/// > The Universe is a 16-bit field that defines the universe number of the
|
||||
/// > data carried in the packet. Universe values shall be limited to the
|
||||
/// > range 1 to 63999.
|
||||
uint16_t universe;
|
||||
|
||||
friend bool operator== (const Provenance& a, const Provenance& b);
|
||||
|
|
|
@ -134,10 +134,11 @@ void Receiver::dataReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
|||
auto block = static_cast<ACN::PDU::Block<DATA::Pdu>*>(root->data());
|
||||
for(auto const &frame : *block->pdu)
|
||||
{
|
||||
/// \cite sACN 6.2.1 E1.31 Data Packet: Vector
|
||||
/// Sources sending an E1.31 Data Packet shall set the E1.31 Layer's Vector
|
||||
/// to VECTOR_E131_DATA_PACKET. This value indicates that the E1.31 framing
|
||||
/// layer is wrapping a DMP PDU.
|
||||
/// > \cite sACN 6.2.1 E1.31 Data Packet: Vector
|
||||
/// >
|
||||
/// > Sources sending an E1.31 Data Packet shall set the E1.31 Layer's
|
||||
/// > Vector to VECTOR_E131_DATA_PACKET. This value indicates that the
|
||||
/// > E1.31 framing layer is wrapping a DMP PDU.
|
||||
switch(frame->vector()) {
|
||||
case VECTOR_E131_DATA_PACKET:
|
||||
dataFrameHandler(frame);
|
||||
|
@ -197,32 +198,35 @@ void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame) {
|
|||
return;
|
||||
auto universe = universes_.at(source->universe)->sourceUniverse(*source);
|
||||
|
||||
/// \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
/// Preview_Data: Bit 7 (most significant bit)
|
||||
/// This bit, when set to 1, indicates that the data in this packet is
|
||||
/// intended for use in visualization or media server preview applications and
|
||||
/// shall not be used to generate live output.
|
||||
/// > \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
/// >
|
||||
/// > Preview_Data: Bit 7 (most significant bit)
|
||||
/// > This bit, when set to 1, indicates that the data in this packet is
|
||||
/// > intended for use in visualization or media server preview applications
|
||||
/// > and shall not be used to generate live output.
|
||||
if (source->options.preview_data)
|
||||
return;
|
||||
|
||||
/// \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
/// Stream_Terminated: Bit 6
|
||||
/// allow E1.31 sources to terminate transmission of a stream or of
|
||||
/// universe synchronization without waiting for a timeout to occur.
|
||||
/// Any property values in an E1.31 Data Packet containing this bit
|
||||
/// shall be ignored.
|
||||
if (source->options.stream_terminated) {
|
||||
universes_[source->universe]->deleteSourceUniverse(*source);
|
||||
return;
|
||||
}
|
||||
/// > \cite sACN 6.2.6 E1.31 Data Packet: Options
|
||||
/// >
|
||||
/// > Stream_Terminated: Bit 6
|
||||
/// >
|
||||
/// > allow E1.31 sources to terminate transmission of a stream or of
|
||||
/// > universe synchronization without waiting for a timeout to occur.
|
||||
/// > Any property values in an E1.31 Data Packet containing this bit
|
||||
/// > shall be ignored.
|
||||
if (source->options.stream_terminated)
|
||||
return universes_[source->universe]->deleteSourceUniverse(*source);
|
||||
|
||||
/// \cite sACN 6.2.4.1 Synchronization Address Usage in an E1.31 Data Packet
|
||||
/// a value of 0 in the Synchronization Address indicates that the universe
|
||||
/// data is not synchronized.
|
||||
/// > \cite sACN 6.2.4.1 Synchronization Address Usage in an E1.31 Data Packet
|
||||
/// >
|
||||
/// > a value of 0 in the Synchronization Address indicates that the universe
|
||||
/// > data is not synchronized.
|
||||
if (source->sync_address != 0)
|
||||
subscribe(source->sync_address);
|
||||
|
||||
/// > \cite sACN 6.2.5 E1.31 Data Packet: Sequence Number
|
||||
/// >
|
||||
/// > In a routed network environment it is possible for packets to be
|
||||
/// > received in a different order to the one in which they were sent. The
|
||||
/// > sequence number allows receivers or diagnostic equipment to detect out
|
||||
|
@ -249,11 +253,12 @@ void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame) {
|
|||
auto block = static_cast<ACN::PDU::Block<ACN::DMP::Pdu>*>(frame->data());
|
||||
for (auto const &dmp : *block->pdu)
|
||||
{
|
||||
/// \cite sACN 7.2 DMP Layer: Vector
|
||||
/// The DMP Layer's Vector shall be set to VECTOR_DMP_SET_PROPERTY, which
|
||||
/// indicates a DMP Set Property message by sources. Receivers shall
|
||||
/// discard the packet if the received value is not
|
||||
/// VECTOR_DMP_SET_PROPERTY.
|
||||
/// > \cite sACN 7.2 DMP Layer: Vector
|
||||
/// >
|
||||
/// > The DMP Layer's Vector shall be set to VECTOR_DMP_SET_PROPERTY,
|
||||
/// > which indicates a DMP Set Property message by sources. Receivers
|
||||
/// > shall discard the packet if the received value is not
|
||||
/// > VECTOR_DMP_SET_PROPERTY.
|
||||
switch(dmp->vector()) {
|
||||
case ACN::DMP::SET_PROPERTY:
|
||||
universe->set(dmp, source);
|
||||
|
@ -284,10 +289,11 @@ void Receiver::discoveryFrameHandler(ACN::PDU::Message<EXTENDED::Pdu> frame) {
|
|||
auto block = static_cast<ACN::PDU::Block<EXTENDED::DISCOVERY::Pdu>*>(frame->data());
|
||||
for(auto const &pdu : *block->pdu)
|
||||
{
|
||||
/// \cite sACN 8 Universe Discovery Layer
|
||||
/// Universe Discovery data only appears in E1.31 Universe Discovery
|
||||
/// Packets and shall not be included in E1.31 Data Packets or E1.31
|
||||
/// Synchronization Packets.
|
||||
/// > \cite sACN 8 Universe Discovery Layer
|
||||
/// >
|
||||
/// > Universe Discovery data only appears in E1.31 Universe Discovery
|
||||
/// > Packets and shall not be included in E1.31 Data Packets or E1.31
|
||||
/// > Synchronization Packets.
|
||||
switch(pdu->vector()) {
|
||||
case VECTOR_UNIVERSE_DISCOVERY_UNIVERSE_LIST:
|
||||
discoveryListHanlder(pdu);
|
||||
|
|
|
@ -29,56 +29,57 @@
|
|||
* @brief \cite sACN E1.31 Lightweight streaming protocol for transport of
|
||||
* DMX512 \cite DMX using ACN \cite ACN.
|
||||
*
|
||||
* # 1 Introduction
|
||||
*
|
||||
* ## 1.1 Scope
|
||||
*
|
||||
* This standard describes a mechanism to transfer DMX512-A [DMX] packets over
|
||||
* an IP network using a subset of the ACN protocol suite. It covers data
|
||||
* format, data protocol, data addressing, and network management. It also
|
||||
* outlines a synchronization method to help ensure that multiple receivers can
|
||||
* process this data concurrently when supervised by the same source. Sources
|
||||
* transporting either data or synchronization packets must also advertise, via
|
||||
* the Universe Discovery mechanism, what universes they are actively
|
||||
* transmitting on.
|
||||
*
|
||||
* ## 1.2 Overview and Architecture
|
||||
*
|
||||
* This standard can be used to transfer DMX512-A \cite DMX packets of all START
|
||||
* Codes via an ANSI E1.17 \cite ACN supported network. It also defines a method
|
||||
* by which this \cite DMX data may be synchronized across multiple receivers.
|
||||
* A simple packet wrapper approach is used whereby the data is encapsulated in
|
||||
* a wrapper following the ACN packet structure. For the use of this standard,
|
||||
* the ACN wrapper is carried in UDP \cite udp packets.
|
||||
*
|
||||
* The wrapper is structured such that it is both compatible and meaningful to
|
||||
* the ANSI E1.17 \cite ACN standard. Readers are referred to the ANSI E1.17
|
||||
* \cite ACN standard, particularly the “ACN Architecture” \cite ACN and “Device
|
||||
* Management Protocol” \cite DMP documents for more information. The “Root
|
||||
* Layer Protocol” used in this standard is described in the “ACN Architecture”
|
||||
* document.
|
||||
*
|
||||
* This standard uses multicast addressing to provide a mechanism to partition
|
||||
* traffic for distinct universes of DMX512-A \cite DMX and synchronization
|
||||
* data. Direct unicast of DMX512-A \cite DMX data is also supported.
|
||||
* > # 1 Introduction
|
||||
* >
|
||||
* > ## 1.1 Scope
|
||||
* >
|
||||
* > This standard describes a mechanism to transfer DMX512-A [DMX] packets
|
||||
* > over an IP network using a subset of the ACN protocol suite. It covers
|
||||
* > data format, data protocol, data addressing, and network management. It
|
||||
* > also outlines a synchronization method to help ensure that multiple
|
||||
* > receivers can process this data concurrently when supervised by the same
|
||||
* > source. Sources transporting either data or synchronization packets must
|
||||
* > also advertise, via the Universe Discovery mechanism, what universes they
|
||||
* > are actively transmitting on.
|
||||
* >
|
||||
* > ## 1.2 Overview and Architecture
|
||||
* >
|
||||
* > This standard can be used to transfer DMX512-A \cite DMX packets of all
|
||||
* > START Codes via an ANSI E1.17 \cite ACN supported network. It also
|
||||
* > defines a method by which this \cite DMX data may be synchronized across
|
||||
* > multiple receivers. A simple packet wrapper approach is used whereby the
|
||||
* > data is encapsulated in a wrapper following the ACN packet structure.
|
||||
* > For the use of this standard, the ACN wrapper is carried in UDP
|
||||
* > \cite udp packets.
|
||||
* >
|
||||
* > The wrapper is structured such that it is both compatible and meaningful
|
||||
* > to the ANSI E1.17 \cite ACN standard. Readers are referred to the ANSI
|
||||
* > E1.17 \cite ACN standard, particularly the “ACN Architecture” \cite ACN
|
||||
* > and “Device Management Protocol” \cite DMP documents for more information.
|
||||
* > The “Root Layer Protocol” used in this standard is described in the “ACN
|
||||
* > Architecture” document.
|
||||
* >
|
||||
* > This standard uses multicast addressing to provide a mechanism to
|
||||
* > partition traffic for distinct universes of DMX512-A \cite DMX and
|
||||
* > synchronization data. Direct unicast of DMX512-A \cite DMX data is also
|
||||
* > supported.
|
||||
*/
|
||||
namespace sACN {
|
||||
|
||||
/// \cite sACN 3.1 Octet: An eight-bit byte within a data packet.
|
||||
/// @brief \cite sACN 3.1 Octet: An eight-bit byte within a data packet.
|
||||
using octet = uint8_t;
|
||||
|
||||
/// \cite sACN 3.3 Universe Number: Each E1.31 Data Packet contains a universe
|
||||
/// @brief \cite sACN 3.3 Universe Number: Each E1.31 Data Packet contains a universe
|
||||
/// number identifying the universe it carries.
|
||||
///
|
||||
/// From an ACN perspective, a receiving device has some number of properties
|
||||
/// whose value is addressed by the combination of a universe number and a data
|
||||
/// slot number. From an historical perspective, a receiving device consumes
|
||||
/// some number of DMX512-A \cite DMX data slots.
|
||||
/// > From an ACN perspective, a receiving device has some number of properties
|
||||
/// > whose value is addressed by the combination of a universe number and a
|
||||
/// > data slot number. From an historical perspective, a receiving device
|
||||
/// > consumes some number of DMX512-A \cite DMX data slots.
|
||||
using universe_number = uint16_t;
|
||||
|
||||
|
||||
/// \cite sACN
|
||||
/// Appendix A: Defined Parameters (Normative)
|
||||
// Appendix A: Defined Parameters (Normative)
|
||||
static const uint32_t VECTOR_ROOT_E131_DATA = 0x00000004;
|
||||
static const uint32_t VECTOR_ROOT_E131_EXTENDED = 0x00000008;
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@ namespace sACN {
|
|||
* @brief \cite sACN 3.5 Source: A stream of E1.31 Packets for a universe is
|
||||
* said to be sent from a source.
|
||||
*
|
||||
* A source is uniquely identified by a number in the header of the packet (see
|
||||
* field CID in Table 4-1). A source may output multiple streams of data, each
|
||||
* for a different universe. Also, multiple sources may output data for a given
|
||||
* universe.
|
||||
* > A source is uniquely identified by a number in the header of the packet
|
||||
* > (see field CID in Table 4-1). A source may output multiple streams of data,
|
||||
* > each for a different universe. Also, multiple sources may output data for
|
||||
* > a given universe.
|
||||
*/
|
||||
class Source
|
||||
: public virtual ACN::RLP::Component
|
||||
|
|
|
@ -52,10 +52,10 @@ Universe::~Universe()
|
|||
void Universe::set(ACN::PDU::Message<ACN::DMP::Pdu> dmp,
|
||||
std::shared_ptr<Provenance> source)
|
||||
{
|
||||
/// \cite sACN 7.3 Address Type and Data Type
|
||||
///
|
||||
/// Sources shall set the DMP Layer's Address Type and Data Type to 0xa1.
|
||||
/// Receivers shall discard the packet if the received value is not 0xa1.
|
||||
/// > \cite sACN 7.3 Address Type and Data Type
|
||||
/// >
|
||||
/// > Sources shall set the DMP Layer's Address Type and Data Type to 0xa1.
|
||||
/// > Receivers shall discard the packet if the received value is not 0xa1.
|
||||
if (!dmp->header())
|
||||
return;
|
||||
auto type = static_cast<ACN::DMP::address_type*>(dmp->header());
|
||||
|
@ -69,44 +69,46 @@ void Universe::set(ACN::PDU::Message<ACN::DMP::Pdu> dmp,
|
|||
auto set_data = static_cast<ACN::DMP::address_pair_list*>(dmp->data());
|
||||
const auto& [range, data] = set_data->properties.front();
|
||||
|
||||
/// \cite sACN 7.4 First Property Address
|
||||
///
|
||||
/// Sources shall set the DMP Layer's First Property Address to 0x0000.
|
||||
/// Receivers shall discard the packet if the received value is not 0x0000.
|
||||
/// > \cite sACN 7.4 First Property Address
|
||||
/// >
|
||||
/// > Sources shall set the DMP Layer's First Property Address to 0x0000.
|
||||
/// > Receivers shall discard the packet if the received value is not 0x0000.
|
||||
if (range.address != 0)
|
||||
return;
|
||||
|
||||
/// \cite sACN 7.5 Address Increment
|
||||
///
|
||||
/// Sources shall set the DMP Layer's Address Increment to 0x0001.
|
||||
/// Receivers shall discard the packet if the received value is not 0x0001.
|
||||
/// > \cite sACN 7.5 Address Increment
|
||||
/// >
|
||||
/// > Sources shall set the DMP Layer's Address Increment to 0x0001.
|
||||
/// > Receivers shall discard the packet if the received value is not 0x0001.
|
||||
if (range.incriment != 1)
|
||||
return;
|
||||
|
||||
/// \cite sACN 7.6 Property Value Count
|
||||
///
|
||||
/// The DMP Layer's Property Value Count is used to encode the number of
|
||||
/// DMX512-A [DMX] Slots (including the START Code slot).
|
||||
/// > \cite sACN 7.6 Property Value Count
|
||||
/// >
|
||||
/// > The DMP Layer's Property Value Count is used to encode the number of
|
||||
/// > DMX512-A [DMX] Slots (including the START Code slot).
|
||||
if (range.count < 1 || range.count > 513)
|
||||
return;
|
||||
|
||||
active_data_slots = range.address + range.count;
|
||||
setProvenance(source);
|
||||
|
||||
if (/// \cite sACN 6.2.4.1 If a receiver is presented with an E1.31 Data
|
||||
///
|
||||
/// Packet containing a Synchronization Address of 0, it shall discard any
|
||||
/// data waiting to be processed and immediately act on that Data Packet.
|
||||
if (/// > \cite sACN 6.2.4.1 If a receiver is presented with an E1.31 Data
|
||||
/// >
|
||||
/// > Packet containing a Synchronization Address of 0, it shall discard
|
||||
/// > any data waiting to be processed and immediately act on that Data
|
||||
/// > Packet.
|
||||
(source->sync_address == 0) ||
|
||||
/// \cite sACN 6.2.6 E1.31 Data Packet: Options Force_Synchronization
|
||||
///
|
||||
/// This bit indicates whether to lock or revert to an unsynchronized
|
||||
/// state when synchronization is lost. When set to 0, components that had
|
||||
/// been operating in a synchronized state shall not update with any new
|
||||
/// packets until synchronization resumes. When set to 1, once
|
||||
/// synchronization has been lost, components that had been operating in a
|
||||
/// synchronized state need not wait for a new E1.31 Synchronization
|
||||
/// Packet in order to update to the next E1.31 Data Packet.
|
||||
/// > \cite sACN 6.2.6 E1.31 Data Packet: Options Force_Synchronization
|
||||
/// >
|
||||
/// > This bit indicates whether to lock or revert to an unsynchronized
|
||||
/// > state when synchronization is lost. When set to 0, components that
|
||||
/// > had been operating in a synchronized state shall not update with
|
||||
/// > any new packets until synchronization resumes. When set to 1, once
|
||||
/// > synchronization has been lost, components that had been operating
|
||||
/// > in a synchronized state need not wait for a new E1.31
|
||||
/// > Synchronization Packet in order to update to the next E1.31 Data
|
||||
/// > Packet.
|
||||
(isSyncronized() && source->options.force_synchronization && rxRate() == 0))
|
||||
{
|
||||
if (sync_data_)
|
||||
|
@ -114,10 +116,10 @@ void Universe::set(ACN::PDU::Message<ACN::DMP::Pdu> dmp,
|
|||
delete sync_data_;
|
||||
sync_data_ = nullptr;
|
||||
}
|
||||
/// \cite sACN 7.7 Property Values (DMX512-A Data)
|
||||
///
|
||||
/// The DMP Layer's Property values field is used to encode the
|
||||
/// DMX512-A [DMX] START Code and data.
|
||||
/// > \cite sACN 7.7 Property Values (DMX512-A Data)
|
||||
/// >
|
||||
/// > The DMP Layer's Property values field is used to encode the
|
||||
/// > DMX512-A [DMX] START Code and data.
|
||||
DMX::Universe::setData(data);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace sACN {
|
|||
/**
|
||||
* @brief \cite sACN 3.2 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. See also: Slot.
|
||||
* > A set of up to 512 data slots identified by universe number.
|
||||
* > Note: In E1.31 there may be multiple sources for a universe. See also: Slot.
|
||||
*/
|
||||
class Universe
|
||||
: public DMX::Universe
|
||||
|
@ -56,14 +56,15 @@ public:
|
|||
|
||||
protected:
|
||||
/**
|
||||
* \cite sACN 3.7 Active Data Slots
|
||||
* @brief \cite sACN 3.7 Active Data Slots
|
||||
*
|
||||
* When translating ANSI E1.11 DMX512-A \cite DMX to E1.31, the active data
|
||||
* slots are defined as ranging from data slot 1 to the maximum data slot in
|
||||
* the most recently received packet with the corresponding START Code.
|
||||
*
|
||||
* Devices originating E1.31 shall define their active data slots using the DMP
|
||||
* First Property Address and DMP Property Count fields shown in Table 4-1.
|
||||
* > When translating ANSI E1.11 DMX512-A \cite DMX to E1.31, the active data
|
||||
* > slots are defined as ranging from data slot 1 to the maximum data slot in
|
||||
* > the most recently received packet with the corresponding START Code.
|
||||
* >
|
||||
* > Devices originating E1.31 shall define their active data slots using
|
||||
* > the DMP First Property Address and DMP Property Count fields shown in
|
||||
* > Table 4-1.
|
||||
*/
|
||||
uint16_t active_data_slots;
|
||||
|
||||
|
|
|
@ -502,11 +502,11 @@ void uuid::uuid4() {
|
|||
* @brief uuid::time_ 4.1.4. Timestamp
|
||||
* @return
|
||||
*
|
||||
* \cite rfc4122
|
||||
* The timestamp is a 60-bit value. For UUID version 1, this is represented
|
||||
* by Coordinated Universal Time (UTC) as a count of 100-nanosecond intervals
|
||||
* since 00:00:00.00, 15 October 1582 (the date of Gregorian reform to the
|
||||
* Christian calendar).
|
||||
* > \cite uuid The timestamp is a 60-bit value.
|
||||
* >
|
||||
* > For UUID version 1, this is represented by Coordinated Universal Time
|
||||
* > (UTC) as a count of 100-nanosecond intervals since 00:00:00.00,
|
||||
* > 15 October 1582 (the date of Gregorian reform to the Christian calendar).
|
||||
*/
|
||||
uint64_t uuid::now_()
|
||||
{
|
||||
|
|
|
@ -29,7 +29,20 @@
|
|||
|
||||
#define UUID_LENGTH 16
|
||||
|
||||
// RFC4122 A Universally Unique IDentifier (UUID) URN Namespace
|
||||
/**
|
||||
* @brief RFC4122 A Universally Unique IDentifier (UUID) URN Namespace
|
||||
*
|
||||
* > \cite uuid This specification defines a Uniform Resource Name namespace
|
||||
* > for UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally
|
||||
* > Unique IDentifier). A UUID is 128 bits long, and can guarantee uniqueness
|
||||
* > across space and time. UUIDs were originally used in the Apollo Network
|
||||
* > Computing System and later in the Open Software Foundation's (OSF)
|
||||
* > Distributed Computing Environment (DCE), and then in Microsoft Windows
|
||||
* > platforms. This specification is derived from the DCE specification with
|
||||
* > the kind permission of the OSF (now known as The Open Group). Information
|
||||
* > from earlier versions of the DCE specification have been incorporated into
|
||||
* > this document.
|
||||
*/
|
||||
namespace UUID {
|
||||
|
||||
/**
|
||||
|
@ -94,9 +107,8 @@ struct RFC4122Fields {
|
|||
|
||||
|
||||
/**
|
||||
* @brief UUID_TICKS_BETWEEK_EPOCH
|
||||
* The number of 100 ns ticks between the Gregorian epoch `1582-10-15 00:00:00`
|
||||
* and the Unix epoch `1970-01-01 00:00:00`.
|
||||
* @brief The number of 100 ns ticks between the Gregorian epoch `1582-10-15
|
||||
* 00:00:00` and the Unix epoch `1970-01-01 00:00:00`.
|
||||
*/
|
||||
static const uint64_t UUID_TICKS_BETWEEK_EPOCH = 122192928000000000;
|
||||
|
||||
|
|
Loading…
Reference in New Issue