clj-artnet.impl.protocol.dmx

Pure DMX merge and processing logic (Art-Net 4).

any-port-merging?

(any-port-merging? state)

Returns true if any port is merging multiple sources.

artsync-timeout-ns

ArtSync timeout (4s).

at-source-limit?

(at-source-limit? sources source-key)

Returns true if adding new source exceeds limit (2).

default-sync-buffer-ttl-ns

Default sync buffer TTL (1s).

dmx-source-key

(dmx-source-key sender packet)

Returns unique key host physical for DMX source.

extract-dmx-bytes

(extract-dmx-bytes packet)

Extracts DMX data as byte array from packet.

max-merge-sources

Max merge sources per port (2).

merge-htp

(merge-htp old new)

Returns new byte array with max value at each position (HTP).

merge-ltp

(merge-ltp _old new)

Returns clone of new data (LTP).

merge-source-timeout-ns

Timeout for merge sources (10s).

merge-sources

(merge-sources mode sources)

Returns merged source data using specified mode (:htp/:ltp).

merge-sources-htp

(merge-sources-htp sources)

Returns {:data bytes :length N} merged via HTP.

merge-sources-ltp

(merge-sources-ltp sources)

Returns {:data bytes :length N} from most recent source (LTP).

port-merge-mode

(port-merge-mode state port-index)

Returns merge mode for port index. Default :htp.

process-artdmx-merge

(process-artdmx-merge state packet sender timestamp)

Processes ArtDmx packet with multi-source merge tracking.

Returns map: :state - updated state :output-data - bytes :output-length - int :emit? - boolean :merging? - boolean :source-rejected? - boolean

prune-by-age

(prune-by-age m now cutoff-ns)(prune-by-age m now cutoff-ns timestamp-key)

Returns map with entries older than cutoff-ns removed.

prune-merge-sources

(prune-merge-sources sources timestamp)

Returns sources map with stale entries removed.

sync-sender-matches?

(sync-sender-matches? state sync-sender)

Returns true if ArtSync sender matches recent ArtDmx sender.