From bcc66aaeaee18899807f17fe1693a2d85287a444 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 27 Mar 2024 20:00:00 +0100 Subject: [PATCH] Use correct start index for Art-Net in proxy mode --- wled00/e131.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wled00/e131.cpp b/wled00/e131.cpp index a67a672c23..025d262f00 100644 --- a/wled00/e131.cpp +++ b/wled00/e131.cpp @@ -93,11 +93,14 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){ return; } + // DMX data in Art-Net packet starts at index 0, for E1.31 at index 1 + int8_t artnetOffset = (protocol == P_ARTNET) ? -1 : 0; + #ifdef WLED_ENABLE_DMX // does not act on out-of-order packets yet if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) { for (uint16_t i = 1; i <= dmxChannels; i++) - dmx.write(i, e131_data[i]); + dmx.write(i, e131_data[i+artnetOffset]); dmx.update(); } #endif @@ -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) {