Added DNRGB UDP protocol

This commit is contained in:
cschwinne 2018-10-27 11:39:00 +02:00
parent 32cf1495d3
commit 042605701e
2 changed files with 10 additions and 3 deletions

View File

@ -58,7 +58,7 @@
//version code in format yymmddb (b = daily build)
#define VERSION 1810251
#define VERSION 1810271
char versionString[] = "0.8.1";

View File

@ -220,6 +220,15 @@ void handleNotifications()
{
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]);
id++; if (id >= ledCount) break;
}
} else if (udpIn[0] == 4) //dnrgb
{
uint16_t id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
for (uint16_t i = 4; i < packetSize -2; i += 3)
{
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]);
id++; if (id >= ledCount) break;
}
}
@ -243,5 +252,3 @@ void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w)
}
}
}