ArtNet.Packet.ArtRdmSub (ArtNet v0.1.0)

View Source

Carries compressed RDM sub-device data.

This packet is used for RDM sub-device communication with command class and parameter metadata included in the payload.

Packet layout

PartFieldDescriptionDefaultSizeFormat
Headeridfixed8 bytes"Art-Net\\0"
Headerop_code0x84002 byteslittle-endian OpCode
Headerprot_ver142 bytesprotocol version
Payloadrdm_versionRDM protocol version.11 byteunsigned integer (8 bits)
Payloadfiller2Reserved byte, transmitted as zero.01 byteunsigned integer (8 bits)
PayloaduidRDM responder UID.required6 bytesbinary (6 bytes)
Payloadspare1Reserved byte, transmitted as zero.01 byteunsigned integer (8 bits)
Payloadcommand_classRDM command class.required1 byteArtNet.Packet.EnumTable.RdmCommandClass enum
Payloadparameter_idRDM parameter identifier.required2 bytesunsigned integer (16 bits)
Payloadsub_deviceRDM sub-device identifier.required2 bytesunsigned integer (16 bits)
Payloadsub_countNumber of sub-device data entries.required2 bytesunsigned integer (16 bits)
PayloadspareReserved bytes, transmitted as zero.<<0, 0, 0, 0>>4 bytesbinary (4 bytes)
PayloaddataRDM sub-device data values.requiredvariable (2 bytes each)list of unsigned integer (16 bits)

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.ArtRdmSub{
  command_class: ArtNet.Packet.EnumTable.RdmCommandClass.type(),
  data: [:integer],
  filler2: :integer,
  parameter_id: :integer,
  rdm_version: :integer,
  spare: :binary,
  spare1: :integer,
  sub_count: :integer,
  sub_device: :integer,
  uid: :binary
}

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

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.