NAP
Public Member Functions | List of all members
ArtNetEvent Class Reference

#include <artnetevent.h>

Public Member Functions

 ArtNetEvent ()=delete
 
 ArtNetEvent (uint8 sequence, uint8 physical, uint16 portAddress)
 
void setData (const uint8 *data, size_t size)
 
uint8 getSequence () const
 
uint8 getPhysical () const
 
uint8 getNet () const
 
uint8 getSubNet () const
 
uint8 getUniverse () const
 
uint16 getPortAddress () const
 
size_t getChannelCount () const
 
const uint8getChannelData () const
 
uint8 getChannelByNumber (uint16 number) const
 
uint8 getChannelByIndex (uint16 index) const
 
uint8 operator[] (uint16 index)
 
const uint8 operator[] (uint16 index) const
 
- Public Member Functions inherited from Event
virtual ~Event ()=default
 
 Event ()=default
 
 Event (const Event &)=delete
 
Eventoperator= (const Event &)=delete
 

Description

Represents a single received ArtDmx packet event, carrying a payload of zero-start code DMX512 data.

Inheritance diagram for ArtNetEvent:
[legend]
Collaboration diagram for ArtNetEvent:
[legend]

Constructor & Destructor Documentation

◆ ArtNetEvent() [1/2]

ArtNetEvent ( )
delete

◆ ArtNetEvent() [2/2]

ArtNetEvent ( uint8  sequence,
uint8  physical,
uint16  portAddress 
)

ArtNetEvent constructor. Creates an ArtDmx packet event identified by a Sequence field, Physical field and Port-Address (which will be parsed to the Net, Sub-Net and Universe).

Parameters
sequencethe Sequence field of the ArtDmx packet
physicalthe Physical field of the ArtDmx packet
portAddressthe Port-Address of the ArtDmx packet

Member Function Documentation

◆ getChannelByIndex()

uint8 getChannelByIndex ( uint16  index) const

Retrieve the 8-bit value of a single DMX512 channel by its 0-based channel index.

Parameters
indexthe 0-based index of the DMX512 channel, ranging from 0 to the return value of getChannelCount - 1
Returns
the 8-bit value of a single DMX512 channel in the ArtDmx packet

◆ getChannelByNumber()

uint8 getChannelByNumber ( uint16  number) const

Retrieve the 8-bit value of a single DMX512 channel by its 1-based channel number.

Parameters
numberthe 1-based number of the DMX512 channel, ranging from 1 to the return value of getChannelCount
Returns
the 8-bit value of a single DMX512 channel in the ArtDmx packet

◆ getChannelCount()

size_t getChannelCount ( ) const

The amount of channels present in the DMX512 frame.

Returns
the channel count of the ArtDmx packet

◆ getChannelData()

const uint8* getChannelData ( ) const

Get a pointer to the raw ArtDmx channel data

Returns
the pointer to the raw ArtDmx channel data

◆ getNet()

uint8 getNet ( ) const

A group of 16 consecutive Sub-Nets or 256 consecutive Universes is referred to as a Net. There are 128 Nets in total.

Returns
the Net of the ArtDmx packet

◆ getPhysical()

uint8 getPhysical ( ) const

The Physical field is an 8-bit number that defines the physical port that generated the packet. This number is limited to the range 0 to 3. It is intended to be purely informative and is not used to define the destination of the packet.

Returns
the Physical field of the ArtDmx packet

◆ getPortAddress()

uint16 getPortAddress ( ) const

One of the 32,768 possible addresses to which a DMX frame can be directed. The Port-Address is a 15-bit number composed of Net + Sub-Net + Universe.

Returns
the Port-Address of the ArtDmx packet

◆ getSequence()

uint8 getSequence ( ) const

The Sequence field is an 8-bit number that is designed to show the order in which packets were originated. When Art-Net is transferred over media such as the Internet, it is possible for packets to arrive at their destination out of sequence. This field allows the receiver to trap such errors. The generating device increments this number for every packet sent to a specific Port-Address. The number increments from 1 to 255 and then rolls over to 1 and repeats. This is because the value 0 is reserved to show that Sequence is not implemented.

Returns
the Sequence field of the ArtDmx packet

◆ getSubNet()

uint8 getSubNet ( ) const

A group of 16 consecutive Universes is referred to as a Sub-Net.

Returns
the Sub-Net of the ArtDmx packet

◆ getUniverse()

uint8 getUniverse ( ) const

A single DMX512 frame of 512 channels.

Returns
the Universe of the ArtDmx packet

◆ operator[]() [1/2]

uint8 operator[] ( uint16  index)

Retrieve the 8-bit value of a single DMX512 channel by its 0-based channel index.

Parameters
indexthe 0-based index of the DMX512 channel, ranging from 0 to the return value of getChannelCount - 1
Returns
the 8-bit value of a single DMX512 channel in the ArtDmx packet

◆ operator[]() [2/2]

const uint8 operator[] ( uint16  index) const

Retrieve the 8-bit value of a single DMX512 channel by its 0-based channel index.

Parameters
indexthe 0-based index of the DMX512 channel, ranging from 0 to the return value of getChannelCount - 1
Returns
the 8-bit value of a single DMX512 channel in the ArtDmx packet

◆ setData()

void setData ( const uint8 data,
size_t  size 
)

Sets the DMX512 channels for this ArtDmx packet.

Parameters
datapointer to the raw data buffer
sizethe length of the data buffer in bytes