Skip to content

Commit bcc66aa

Browse files
committed
Use correct start index for Art-Net in proxy mode
1 parent ba9ce4a commit bcc66aa

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

wled00/e131.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
9393
return;
9494
}
9595

96+
// DMX data in Art-Net packet starts at index 0, for E1.31 at index 1
97+
int8_t artnetOffset = (protocol == P_ARTNET) ? -1 : 0;
98+
9699
#ifdef WLED_ENABLE_DMX
97100
// does not act on out-of-order packets yet
98101
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
99102
for (uint16_t i = 1; i <= dmxChannels; i++)
100-
dmx.write(i, e131_data[i]);
103+
dmx.write(i, e131_data[i+artnetOffset]);
101104
dmx.update();
102105
}
103106
#endif
@@ -135,9 +138,8 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
135138
availDMXLen = (dmxChannels - DMXAddress) + dmxLenOffset;
136139
}
137140

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

143145
switch (DMXMode) {

0 commit comments

Comments
 (0)