Refactor DALI command handling: streamline send methods and enhance scene color reporting

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Tony
2026-04-28 17:32:32 +08:00
parent 32e7329b3e
commit 9e1244712d
10 changed files with 84 additions and 38 deletions
+2 -2
View File
@@ -9,7 +9,7 @@
// Lightweight communicator for DALI gateway type 1 (USB UART new frame format).
// Frames:
// - Send: [0x10, addr, cmd]
// - Ext: [0x11, addr, cmd] (sent twice with a small delay)
// - Ext: [0x11, addr, cmd] (one logical send; gateway/transceiver handles any required repeat timing)
// - Query: [0x12, addr, cmd] -> expects [0xFF, data] on success
// COMPARE may also return [0xFD, data] when multiple devices reply together
// Callers provide UART callbacks; this class only builds frames and parses basic responses.
@@ -49,7 +49,7 @@ class DaliComm {
// Send standard command frame (0x10).
bool sendCmd(uint8_t addr, uint8_t cmd) const;
// Send extended command frame (0x11).
// Send one logical extended command frame (0x11).
bool sendExtCmd(uint8_t addr, uint8_t cmd) const;
// Send query frame (0x12) and parse single-byte response. Returns nullopt on no/invalid response,
// except COMPARE where 0xFD collisions are treated as a positive match.