ArtNet.Packet.ArtTodData (ArtNet v0.1.0)

View Source

Sends a Table of Devices for RDM discovery.

Nodes use this packet to return discovered RDM UIDs and discovery response status to a controller.

Packet layout

PartFieldDescriptionDefaultSizeFormat
Headeridfixed8 bytes"Art-Net\\0"
Headerop_code0x81002 byteslittle-endian OpCode
Headerprot_ver142 bytesprotocol version
Payloadrdm_versionRDM protocol version.11 byteunsigned integer (8 bits)
PayloadportPhysical port number for the table of devices.required1 byteunsigned integer (8 bits)
PayloadspareReserved bytes, transmitted as zero.<<0, 0, 0, 0, 0, 0>>6 bytesbinary (6 bytes)
Payloadbind_indexBind index of the node reporting the table.11 byteunsigned integer (8 bits)
PayloadnetBits 8-14 of the 15-bit Port-Address.01 byteunsigned integer (8 bits)
Payloadcommand_responseTable-of-devices response type.:tod_full1 byteArtNet.Packet.EnumTable.TodDataCommandResponse enum
PayloadaddressLow byte of the Port-Address.required1 byteunsigned integer (8 bits)
Payloaduid_totalTotal number of UIDs in the full table.required2 bytesunsigned integer (16 bits)
Payloadblock_countBlock number for segmented tables.01 byteunsigned integer (8 bits)
Payloaduid_countNumber of UIDs carried in this packet.required1 byteunsigned integer (8 bits)
PayloadtodList of discovered RDM UIDs.requiredvariable (6 bytes each)list of binary (6 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.ArtTodData{
  address: :integer,
  bind_index: :integer,
  block_count: :integer,
  command_response: ArtNet.Packet.EnumTable.TodDataCommandResponse.type(),
  net: :integer,
  port: :integer,
  rdm_version: :integer,
  spare: :binary,
  tod: [:binary],
  uid_count: :integer,
  uid_total: :integer
}

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 0x8100.

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.