Class: OpenC3::ObjectWriteConversion

Inherits:
ObjectReadConversion show all
Defined in:
lib/openc3/conversions/object_write_conversion.rb

Instance Attribute Summary

Attributes inherited from Conversion

#converted_array_size, #converted_bit_size, #converted_type

Instance Method Summary collapse

Methods inherited from ObjectReadConversion

#as_json, #initialize, #lookup_packet, #to_config, #to_s

Methods inherited from Conversion

#as_json, #initialize, #to_config, #to_s

Constructor Details

This class inherits a constructor from OpenC3::ObjectReadConversion

Instance Method Details

#call(value, _packet, buffer) ⇒ Object

Perform the conversion on the value.

Parameters:

  • value (Object)

    Hash of packet key/value pairs

  • packet (Packet)

    Unused

  • buffer (String)

    The packet buffer

Returns:

  • Raw BLOCK data



29
30
31
32
33
34
35
36
# File 'lib/openc3/conversions/object_write_conversion.rb', line 29

def call(value, _packet, buffer)
  fill_packet = lookup_packet()
  fill_packet.restore_defaults()
  value.each do |key, write_value|
    fill_packet.write(key, write_value)
  end
  return fill_packet.buffer
end