From 0d3debf9b92d7a9e26434b1e0bc0926c5a27ecb3 Mon Sep 17 00:00:00 2001 From: mx Date: Tue, 21 Feb 2023 17:13:15 +0100 Subject: [PATCH] sACN/E1.31 Port Priority (#3052) * Added E1.31 port priority handling #768 * Ignore E1.31 data when priority doesn't match #768 * Enable E1.31 priority handling for WLED_ENABLE_DMX * Only handle e131Priority for P_E131 protocol * Corrected comments * Highest priority package first handling * Removed obsolete code & comments * Improved comments * Reduce priority timeout to be uint8_t * Optimized code & comments * E1.31: Ignore non-zero start code and preview data These are not level data, they have other purposes * Style change cca41508 preview & ignore non-zero start code --------- Co-authored-by: RichardTea <31507749+RichardTea@users.noreply.github.com> --- wled00/cfg.cpp | 3 +++ wled00/data/settings_sync.htm | 1 + wled00/e131.cpp | 12 +++++++++- wled00/set.cpp | 2 ++ wled00/src/dependencies/e131/ESPAsyncE131.h | 26 +++++++++++++++++++++ wled00/wled.h | 2 ++ wled00/xml.cpp | 1 + 7 files changed, 46 insertions(+), 1 deletion(-) diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index e52fb6a8..eddb7ccc 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -408,6 +408,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { if (!DMXAddress || DMXAddress > 510) DMXAddress = 1; CJSON(DMXSegmentSpacing, if_live_dmx[F("dss")]); if (DMXSegmentSpacing > 150) DMXSegmentSpacing = 0; + CJSON(e131Priority, if_live_dmx[F("e131prio")]); + if (e131Priority > 200) e131Priority = 200; CJSON(DMXMode, if_live_dmx["mode"]); tdd = if_live[F("timeout")] | -1; @@ -852,6 +854,7 @@ void serializeConfig() { JsonObject if_live_dmx = if_live.createNestedObject("dmx"); if_live_dmx[F("uni")] = e131Universe; if_live_dmx[F("seqskip")] = e131SkipOutOfSequence; + if_live_dmx[F("e131prio")] = e131Priority; if_live_dmx[F("addr")] = DMXAddress; if_live_dmx[F("dss")] = DMXSegmentSpacing; if_live_dmx["mode"] = DMXMode; diff --git a/wled00/data/settings_sync.htm b/wled00/data/settings_sync.htm index a71ab31e..3f175f0b 100644 --- a/wled00/data/settings_sync.htm +++ b/wled00/data/settings_sync.htm @@ -149,6 +149,7 @@ Start universe:
Skip out-of-sequence packets:
DMX start address:
DMX segment spacing:
+E1.31 port priority:
DMX mode: