z21-client 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -88,8 +88,11 @@ class EngineController {
|
|
|
88
88
|
default:
|
|
89
89
|
throw new Error("state must be \"on\", \"off\" or \"toggle\"");
|
|
90
90
|
}
|
|
91
|
-
// Set
|
|
92
|
-
|
|
91
|
+
// Set function number in bits 0-5 per Z21 LAN protocol specification
|
|
92
|
+
// See: Z21 LAN Protocol v1.13, Section 4.2 (LAN_X_SET_LOCO_FUNCTION)
|
|
93
|
+
// DB3 byte format: bits 7-6 = switch type (00=off, 01=on, 10=toggle), bits 5-0 = function index
|
|
94
|
+
// Reference: https://www.z21.eu/media/Kwc_Basic_DownloadTag_Component/root-en-main_47-702/default/69bad87e/1712141518/z21-lan-protokoll-en.pdf
|
|
95
|
+
functionByte |= (functionNumber & 0x3F);
|
|
93
96
|
// Build the command payload
|
|
94
97
|
// E4 = set function command, 0x40 = LAN_X header, 0x00 = XpressNet command
|
|
95
98
|
// Payload format: [0x40, 0x00, 0xE4, addrH, addrL, functionByte]
|