1
0
Fork 0

DMP layer of sACN is too constrained to require inheritance of DMP::Device

This commit is contained in:
Kevin Matz 2021-08-27 09:02:44 -04:00
parent 8c99f4ff1f
commit 2a26e7fa49
4 changed files with 3 additions and 32 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

After

Width:  |  Height:  |  Size: 510 KiB

View File

@ -31,7 +31,6 @@ namespace SACN {
*/
Universe::Universe()
: DMX::Universe(E131_NETWORK_DATA_LOSS_TIMEOUT)
, ACN::DMP::Device()
{
}
@ -61,8 +60,8 @@ void Universe::set(ACN::PDU::Message<ACN::DMP::Pdu> dmp,
return;
auto type = static_cast<ACN::DMP::address_type*>(dmp->header());
if (type->relative) return;
if (type->type != ACN::DMP::ARRAY) return;
if (type->width != ACN::DMP::TWO) return;
if (type->data_type != ACN::DMP::ARRAY) return;
if (type->address_length != ACN::DMP::TWO) return;
// only act on the first property pair in the data
if (!dmp->data())
@ -93,10 +92,10 @@ void Universe::set(ACN::PDU::Message<ACN::DMP::Pdu> dmp,
setProvenance(source);
/// \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.
/// \cite sACN 6.2.6 E1.31 Data Packet: Options
/// Force_Synchronization: Bit 5
/// This bit indicates whether to lock or revert to an unsynchronized state
@ -167,26 +166,4 @@ void Universe::synchronize()
}
}
/**
* @brief Universe::getProperty
* @param address
* @return
*/
uint32_t Universe::getProperty(const unsigned int address) const
{
return DMX::Universe::slot(address);
}
/**
* @brief Universe::setProperty
* @param address
* @param value
*/
void Universe::setProperty(const unsigned int address, const int value)
{
DMX::Universe::setValue(address, value);
}
}; // namespace SACN

View File

@ -24,7 +24,6 @@
#pragma once
#include "dmp/dmp.h"
#include "dmp/device.h"
#include "dmx/universe.h"
#include "provenance.h"
@ -38,7 +37,6 @@ namespace SACN {
*/
class Universe
: public DMX::Universe
, public ACN::DMP::Device
{
public:
Universe();
@ -52,10 +50,6 @@ public:
virtual void synchronize();
// DMP::Device override
uint32_t getProperty(const unsigned int address) const override;
void setProperty(const unsigned int address, const int value) override;
private:
std::shared_ptr<Provenance> provenance_;
std::vector<uint8_t> * sync_data_ = nullptr;