clj-artnet.impl.protocol.node-state
Manages Art-Net node state, including normalization, paging, and status bits.
Provides pure functions for configuring and transforming node state, ensuring valid bitmasks and default values.
*system-nano-time*
dynamic
(*system-nano-time*)Gets current system time in nanoseconds. Override for deterministic testing.
default-network-state
(default-network-state node overrides)Constructs default network state from node config and overrides.
ensure-command-labels
(ensure-command-labels labels)Normalizes command label strings (swin/swout), removing null termination and whitespace.
node-port-addresses
(node-port-addresses node)Calculates all unique active port addreses across all pages of a node.
node-port-pages
(node-port-pages node)Calculates effective node pages based on configuration strategy (:port-pages, :ports, or logical default).
normalize-node
(normalize-node node)Normalizes node configuration map to ensure all required fields function correctly.
Populates defaults for required Art-Net node properties like IP, port, status bits, and port definitions.
page-port-addresses
(page-port-addresses page)Calculates list of active port addresses for a page.
ports->pages
(ports->pages node ports)Converts a flat list of port descriptors into a vector of Art-Net node pages.