ArtNet.Packet.BitField.IpProgCommand (ArtNet v0.1.0)

View Source

Command bit field used by ArtNet.Packet.ArtIpProg.

Each boolean selects an IP programming action requested from the node.

Bit size

This bit field is encoded in 8 bits.

Bit layout

FieldDescriptionBitsDefaultValue
program_portProgram the port field.0falseboolean flag
program_subnet_maskProgram the subnet mask.1falseboolean flag
program_ipProgram the IP address.2falseboolean flag
reset_to_defaultReset network settings to defaults.3falseboolean flag
program_default_gatewayProgram the default gateway.4falseboolean flag
dhcpEnable DHCP.6falseboolean flag
enable_programmingEnable programming for the requested fields.7falseboolean flag

Summary

Functions

Returns the bit-field schema in declaration order.

Returns the total number of bits encoded by this bit field.

Decodes an unsigned integer into this bit-field struct.

Encodes this bit-field struct into an unsigned integer.

Types

t()

@type t() :: %ArtNet.Packet.BitField.IpProgCommand{
  dhcp: :boolean,
  enable_programming: :boolean,
  program_default_gateway: :boolean,
  program_ip: :boolean,
  program_port: :boolean,
  program_subnet_mask: :boolean,
  reset_to_default: :boolean
}

Functions

bit_field_schema()

@spec bit_field_schema() :: [
  {key :: atom(),
   {ArtNet.Packet.BitField.schema_type(),
    {start_bit :: non_neg_integer(), length :: pos_integer()}}}
]

Returns the bit-field schema in declaration order.

bit_size()

@spec bit_size() :: pos_integer()

Returns the total number of bits encoded by this bit field.

This bit field is encoded in 8 bits.

decode(value)

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

Decodes an unsigned integer into this bit-field struct.

encode(struct)

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

Encodes this bit-field struct into an unsigned integer.