Class: SDN::Message::ILT2::PostIRConfig

Inherits:
SDN::Message show all
Defined in:
lib/sdn/message/ilt2/post.rb

Overview

Response carrying the configured ILT2 IR channel bitmask.

Direct Known Subclasses

SetIRConfig

Constant Summary collapse

MSG =

Protocol message number

0x69
PARAMS_LENGTH =

Number of protocol parameter bytes expected

1

Instance Attribute Summary collapse

Attributes inherited from SDN::Message

#ack_requested, #dest, #node_type, #src

Instance Method Summary collapse

Methods inherited from SDN::Message

#==, expected_response?, #inspect, parse, #serialize

Methods included from Helpers

#checksum, #from_number, #from_string, #group_address?, #node_type_from_number, #node_type_to_number, #node_type_to_string, #parse_address, #print_address, #to_number, #to_string, #transform_param

Constructor Details

#initialize(channels = nil) ⇒ PostIRConfig

Creates an ILT2 IR configuration response.

Parameters:

  • channels (Integer, nil) (defaults to: nil)

    bitmask of enabled IR channels



23
24
25
26
# File 'lib/sdn/message/ilt2/post.rb', line 23

def initialize(channels = nil, **)
  super(**)
  self.channels = channels
end

Instance Attribute Details

#channelsInteger?

IR channel bitmask.

Returns:

  • (Integer, nil)


18
19
20
# File 'lib/sdn/message/ilt2/post.rb', line 18

def channels
  @channels
end

Instance Method Details

#class_inspectString?

Returns the protocol-specific portion of the inspection string.

Returns:

  • (String, nil)


44
45
46
# File 'lib/sdn/message/ilt2/post.rb', line 44

def class_inspect
  ", @channels=#{channels.chr.unpack1("b8")}"
end

#params<Integer>

Returns the protocol-specific payload bytes for this message.

Returns:

  • (<Integer>)


39
40
41
# File 'lib/sdn/message/ilt2/post.rb', line 39

def params
  transform_param(channels)
end

#parse(params) ⇒ void

This method returns an undefined value.

Parses protocol-specific parameter bytes into this message instance.

Parameters:

  • params (<Integer>)

    raw parameter bytes

Raises:



33
34
35
36
# File 'lib/sdn/message/ilt2/post.rb', line 33

def parse(params)
  super
  self.channels = to_number(params[0])
end