From a4fcbb9f67c6fcf32c5bb35aa24b0eb6fadf1384 Mon Sep 17 00:00:00 2001
From: TroyHacks <5659019+troyhacks@users.noreply.github.com>
Date: Fri, 10 Mar 2023 13:29:00 -0500
Subject: [PATCH] Art-Net transmit support for network LEDs
Like DDP, this allows WLED to address network systems using the Art-Net protocol.
Universe starts at zero, because that's the first universe in Art-Net.
Works with RGB. It's coded to also work with RGBW, but I couldn't find a great place to enable it without mucking with things I don't understand.
---
wled00/bus_manager.cpp | 32 +++++++++++-----------
wled00/data/settings_leds.htm | 2 +-
wled00/udp.cpp | 51 +++++++++++++++++++++++++++++++++++
3 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp
index 6ab90b2f..9e4d54a4 100644
--- a/wled00/bus_manager.cpp
+++ b/wled00/bus_manager.cpp
@@ -383,24 +383,24 @@ uint8_t BusOnOff::getPins(uint8_t* pinArray) {
BusNetwork::BusNetwork(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) {
_valid = false;
-// switch (bc.type) {
-// case TYPE_NET_ARTNET_RGB:
-// _rgbw = false;
-// _UDPtype = 2;
-// break;
-// case TYPE_NET_E131_RGB:
-// _rgbw = false;
-// _UDPtype = 1;
-// break;
-// case TYPE_NET_DDP_RGB:
-// _rgbw = false;
-// _UDPtype = 0;
-// break;
-// default: // TYPE_NET_DDP_RGB / TYPE_NET_DDP_RGBW
+ switch (bc.type) {
+ case TYPE_NET_ARTNET_RGB:
+ _rgbw = false;
+ _UDPtype = 2;
+ break;
+ case TYPE_NET_E131_RGB:
+ _rgbw = false;
+ _UDPtype = 1;
+ break;
+ case TYPE_NET_DDP_RGB:
+ _rgbw = false;
+ _UDPtype = 0;
+ break;
+ default: // TYPE_NET_DDP_RGB / TYPE_NET_DDP_RGBW
_rgbw = bc.type == TYPE_NET_DDP_RGBW;
_UDPtype = 0;
-// break;
-// }
+ break;
+ }
_UDPchannels = _rgbw ? 4 : 3;
_data = (byte *)malloc(bc.count * _UDPchannels);
if (_data == nullptr) return;
diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm
index 15e39efb..e6bbde58 100644
--- a/wled00/data/settings_leds.htm
+++ b/wled00/data/settings_leds.htm
@@ -345,7 +345,7 @@ ${i+1}:
'}
-
+