clj-artnet.impl.protocol.codec.spec

Declarative packet specifications for Art-Net 4.

Each packet type is defined as a vector of field descriptors that mirror the Art-Net 4 protocol specification exactly. The compiler (impl.codec.compiler) consumes these specs to generate high-performance ByteBuffer operations.

Field descriptor keys: - :name -> keyword identifying the field - :type -> one of :u8, :u16le, :u16be, :fixed-string, :ipv4, :bytes, :uid - :length -> for :fixed-string and :bytes, the byte length - :value -> constant value (for headers/magic bytes) - :default -> default value when encoding if not provided - :doc -> optional documentation

art-address-spec

ArtAddress packet specification - 107 bytes

art-command-spec

ArtCommand packet specification - 16 byte header and up to 512 bytes text

art-data-reply-spec

ArtDataReply packet specification - 20 byte header and up to 512 bytes

art-data-request-spec

ArtDataRequest packet specification - 40 bytes

art-diag-data-spec

ArtDiagData packet specification - 18 byte header and up to 512 bytes text

art-directory-reply-spec

ArtDirectoryReply packet specification - replies to OpDirectory with a file list.

art-directory-spec

ArtDirectory packet specification - requests a node’s file list.

art-dmx-spec

ArtDmx packet specification - 18 byte header and up to 512 bytes payload

art-file-fn-master-spec

ArtFileFnMaster packet specification - downloads a user file from the node.

art-file-fn-reply-spec

ArtFileFnReply packet specification - server-to-node acknowledge.

art-file-tn-master-spec

ArtFileTnMaster packet specification - uploads a user file to a node. Note: Uses the same reply mechanism as ArtFirmwareReply.

art-firmware-master-spec

ArtFirmwareMaster packet specification - 40 byte header and up to 1024 bytes

art-firmware-reply-spec

ArtFirmwareReply packet specification - 36 bytes

art-input-spec

ArtInput packet specification - 20 bytes

art-ip-prog-reply-spec

ArtIpProgReply packet specification - 34 bytes

art-ip-prog-spec

ArtIpProg packet specification - 30 bytes minimum

art-mac-master-spec

ArtMacMaster packet specification - DEPRECATED per Art-Net 4. Retained for backward compatibility with legacy devices.

art-mac-slave-spec

ArtMacSlave packet specification - DEPRECATED per Art-Net 4. Retained for backward compatibility with legacy devices.

art-media-control-reply-spec

ArtMediaControlReply packet specification - unicast by Media Server to Controller. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-media-control-spec

ArtMediaControl packet specification - unicast by Controller to Media Server. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-media-patch-spec

ArtMediaPatch packet specification - unicast by Controller to Media Server. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-media-spec

ArtMedia packet specification - unicast by Media Server to Controller. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-nzs-spec

ArtNzs packet specification - 18 byte header and up to 512 bytes payload

art-poll-reply-spec

ArtPollReply packet specification - 239 bytes

art-poll-spec

ArtPoll packet specification - 22 bytes minimum

art-rdm-spec

ArtRdm packet specification - 24 byte header and RDM payload

art-rdm-sub-spec

ArtRdmSub packet specification - 32 byte header + payload

art-sync-spec

ArtSync packet specification - 14 bytes

art-time-sync-spec

ArtTimeSync packet specification - used to synchronize real time date and clock. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-timecode-spec

ArtTimeCode packet specification - 19 bytes

art-tod-control-spec

ArtTodControl packet specification - 24 bytes

art-tod-data-spec

ArtTodData packet specification - 28 byte header and UIDs

art-tod-request-spec

ArtTodRequest packet specification - 24 byte header and up to 32 addresses

art-trigger-spec

ArtTrigger packet specification - 18 byte header and up to 512 bytes payload

art-video-data-spec

ArtVideoData packet specification - display data. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-video-palette-spec

ArtVideoPalette packet specification - colour palette setup. Note: Art-Net 4 spec provides opcode but no detailed field layout.

art-video-setup-spec

ArtVideoSetup packet specification - video screen setup. Note: Art-Net 4 spec provides opcode but no detailed field layout.

artnet-id

default-port

field-by-name

(field-by-name spec field-name)

Look up a field descriptor by name

field-offset

(field-offset spec field-name)

Calculate the byte offset of a named field within a spec. Returns the offset as a long, or -1 if the field is not found.

field-size

(field-size {:keys [type length]})

Calculate the byte size of a single field

header-fields

Common 8-byte Art-Net header present in all packets

op-address

op-command

op-data-reply

op-data-request

op-diag-data

op-directory

op-directory-reply

op-dmx

op-file-fn-master

op-file-fn-reply

op-file-tn-master

op-firmware-master

op-firmware-reply

op-input

op-ip-prog

op-ip-prog-reply

op-mac-master

op-mac-slave

op-media

op-media-control

op-media-control-reply

op-media-patch

op-nzs

op-poll

op-poll-reply

op-rdm

op-rdm-sub

op-sync

op-time-sync

op-timecode

op-tod-control

op-tod-data

op-tod-request

op-trigger

op-video-data

op-video-palette

op-video-setup

packet-specs

Registry of all packet specifications keyed by opcode keyword

protocol-version

spec-header-size

(spec-header-size spec)

Calculate the total byte size of a packet spec (header only, excludes variable payload)