ArtNet.Packet.ArtDirectoryReply (ArtNet v0.1.0)

View Source

Replies to ArtNet.Packet.ArtDirectory with file list information.

The payload describes a file entry, including name, description, length, and data metadata.

Packet layout

PartFieldDescriptionDefaultSizeFormat
Headeridfixed8 bytes"Art-Net\\0"
Headerop_code0x9B002 byteslittle-endian OpCode
Headerprot_ver142 bytesprotocol version
PayloadfillerReserved bytes, transmitted as zero.<<0, 0>>2 bytesbinary (2 bytes)
PayloadflagsDirectory entry status flags.required1 byteunsigned integer (8 bits)
PayloadfileDirectory file index for this entry.required2 bytesunsigned integer (16 bits)
PayloadnameDirectory entry file name.required16 bytesnull-padded string (16 bytes)
PayloaddescriptionHuman-readable directory entry description.required64 bytesnull-padded string (64 bytes)
PayloadlengthLength of the directory entry data in bytes.required8 bytesunsigned integer (64 bits)
PayloaddataDirectory entry data block.required64 bytesbinary (64 bytes)

Summary

Functions

Decodes a complete Art-Net binary as this packet type.

Encodes this packet struct into a complete Art-Net binary.

Builds a validated packet struct from a map or keyword list.

Builds a validated packet struct from a map or keyword list.

Returns the Art-Net OpCode value for this packet module.

Returns whether this packet includes the Art-Net protocol version header.

Returns the packet payload schema in declaration order.

Types

t()

@type t() :: %ArtNet.Packet.ArtDirectoryReply{
  data: :binary,
  description: String.t(),
  file: :integer,
  filler: :binary,
  flags: :integer,
  length: :integer,
  name: String.t()
}

Functions

decode(data)

@spec decode(binary()) :: {:ok, t()} | :error

Decodes a complete Art-Net binary as this packet type.

encode(packet)

@spec encode(t()) :: {:ok, binary()} | :error

Encodes this packet struct into a complete Art-Net binary.

new(attrs)

@spec new(map() | Keyword.t()) :: {:ok, t()} | {:error, ArtNet.EncodeError.t()}

Builds a validated packet struct from a map or keyword list.

new!(attrs)

@spec new!(map() | Keyword.t()) :: t()

Builds a validated packet struct from a map or keyword list.

Raises ArtNet.EncodeError when validation fails.

op_code()

@spec op_code() :: pos_integer()

Returns the Art-Net OpCode value for this packet module.

The OpCode is 0x9B00.

require_version_header?()

@spec require_version_header?() :: boolean()

Returns whether this packet includes the Art-Net protocol version header.

schema()

Returns the packet payload schema in declaration order.