Method: OpenC3::Structure#read_item

Defined in:
lib/openc3/packets/structure.rb,
ext/openc3/ext/structure/structure.c

#read_item(*args) ⇒ Object

Read an item in the structure

Parameters:

  • item (StructureItem)

    Instance of StructureItem or one of its subclasses

  • value_type (Symbol)

    Not used. Subclasses should overload this parameter to check whether to perform conversions on the item.

  • buffer (String)

    The binary buffer to read the item from

Returns:

  • Value based on the item definition. This could be a string, integer, float, or array of values.



109
110
111
112
# File 'lib/openc3/packets/structure.rb', line 109

def read_item(item, _value_type = :RAW, buffer = @buffer)
  buffer = allocate_buffer_if_needed() unless buffer
  return @accessor.read_item(item, buffer)
end