From ac6ea29db98070ac2e190a9ee008fb444292f3b5 Mon Sep 17 00:00:00 2001 From: tonycao Date: Mon, 14 Sep 2026 20:36:45 +0800 Subject: [PATCH] hostdemo: show mode runs session_loop (fix PDL=0 DUB storm, zero-pre-bake works) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit ab8090b emptied the show-mode 'known' fixture list (default) but left its step state machine intact: with known.len()==0 the machine oscillates step 0<->1 through the '_' arm, emitting malformed DISC_UNIQUE_BRANCH frames with PDL=0 forever. The DUT's pool proxy correctly ignores them, so discovery never saw a single fixture. Fix: after the AECH claim, show mode now enters session_loop() — the verified zero-pre-baked full-space bisect (pool-answered DUBs, collision pulses, UN_MUTE/MUTE) plus GET DEVICE_INFO and encrypted DMX playback on the discovered addresses. hybrid keeps the legacy template behaviour. Bench: 3/3 fixtures discovered (0899500026c9 / 010734880900 / 010734670125), addresses 1/129/101 read back, 1386-frame DMX run — locally and from the Windows host over udprelay. --- src/hostdemo.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hostdemo.rs b/src/hostdemo.rs index 0b87899..6533610 100644 --- a/src/hostdemo.rs +++ b/src/hostdemo.rs @@ -503,6 +503,17 @@ pub fn run(target: &str, bind_ip: &str, secs: u64) { if !aere_ok { println!("[{}] ⚠ 未收到有效 AERE — 认领可能失败, DMX 将无法解密!", label); } println!("[{}] 认领完成 B12=0x{:08x}; {}", label, bc, if is_show { "地址1-32 炫彩呼吸 (零模板纯自构造 DMX+RDM)" } else { "verbatim DMX + 模板 RDM" }); + // ★show 模式: 认领后进入统一会话环 — 零预制全空间二分发现 + 按发现地址播放。 + // (旧 show 轮询循环依赖非空 known 清单; 67866e2 起 known 默认为空, + // step 状态机在 0↔1 死循环并发出 PDL=0 的畸形 DUB, DUB 池应答因此全静默 + // — 2026-09-14 本机 Linux 版定位) + if is_show { + let run_secs = if secs == 0 { u64::MAX } else { secs }; + println!("[SHOW] 进入统一会话环: 零预制二分发现 + 播放 ({}s)", if secs == 0 { 0 } else { secs }); + send_key_burst(&sock); + session_loop(&sock, &dst, target, &mut rng, bc, run_secs); + return; + } let rdm_t: Option> = base_rdm; // HOSTDEMO_KNOWN=uid12hex[,uid12hex...] 覆盖默认灯具清单 // (用于对测仿真 Butler/其他 UID 的设备; 默认 = 台架 3 台真灯)