Skip to content

Commit

Permalink
Use correct start index for Art-Net in proxy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
askask committed Mar 27, 2024
1 parent ecfdc6f commit dbb27ea
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions wled00/e131.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
}

#ifdef WLED_ENABLE_DMX
// DMX data in Art-Net packet starts at index 0, for E1.31 at index 1
uint8_t artnetOffset = (protocol == P_ARTNET) ? -1 : 0;

// does not act on out-of-order packets yet
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
for (uint16_t i = 1; i <= dmxChannels; i++)
for (uint16_t i = 1+artnetOffset; i <= dmxChannels+artnetOffset; i++)
dmx.write(i, e131_data[i]);
dmx.update();
}
Expand Down Expand Up @@ -135,9 +138,8 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
availDMXLen = (dmxChannels - DMXAddress) + dmxLenOffset;
}

// DMX data in Art-Net packet starts at index 0, for E1.31 at index 1
if (protocol == P_ARTNET && dataOffset > 0) {
dataOffset--;
if (dataOffset > 0) {
dataOffset += artnetOffset;
}

switch (DMXMode) {
Expand Down

0 comments on commit dbb27ea

Please sign in to comment.