Skip to content

Commit 6999737

Browse files
DedeHaisofthack007
authored andcommitted
mask out flag bits in DDP type for compatibility
1 parent 36241e8 commit 6999737

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

wled00/e131.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ void handleDDPPacket(e131_packet_t* p) {
1616
[[maybe_unused]] int lastPushSeq = e131LastSequenceNumber[0];
1717

1818
// reject unsupported color data types (only RGB and RGBW are supported)
19+
uint8_t maskedType = p->dataType & 0x3F; // mask out custom and reserved flags, only type bits are relevant
1920
// WLEDMM allow legacy "undefined" datatype, and legacy (but wrong) datatype=0x01
20-
if ( p->dataType != 0 && p->dataType != 0x01 &&
21-
p->dataType != DDP_TYPE_RGB24 && p->dataType != DDP_TYPE_RGBW32) {
21+
if ( maskedType != 0 && maskedType != 0x01 &&
22+
maskedType != DDP_TYPE_RGB24 && maskedType != DDP_TYPE_RGBW32) {
2223
DEBUG_PRINTF("handleDDPPacket(); unsupported datatype 0x%02x\n", p->dataType);
2324
return;
2425
}

0 commit comments

Comments
 (0)