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-good-output-b-byte

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.

find-page-by-bind-index

(find-page-by-bind-index pages bind-index base)

good-outputb-background-disabled-bit

good-outputb-continuous-bit

good-outputb-discovery-clear-mask

good-outputb-discovery-idle-bit

good-outputb-rdm-disabled-bit

nano-time

(nano-time event)

Gets current nano time from event or system default.

node-bind-index

(node-bind-index node)

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-capabilities-config

(normalize-capabilities-config capabilities)

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-bind-index

(page-bind-index page base idx)

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.

state-bind-index

(state-bind-index state)

status2-derived-mask

status2-dhcp-active-bit

status2-dhcp-capable-bit

status2-extended-port-bit

status2-output-style-bit

status2-rdm-artaddress-bit

status3-background-queue-bit

status3-derived-mask

status3-llrp-bit

status3-port-direction-bit

status3-programmable-failsafe-bit

status3-rdmnet-bit