Class: Cosmos::ReceivedCountConversion

Inherits:
Conversion show all
Defined in:
lib/cosmos/conversions/received_count_conversion.rb

Overview

Converts the packet received count as a derived telemetry item

Instance Attribute Summary

Attributes inherited from Conversion

#converted_bit_size, #converted_type

Instance Method Summary collapse

Methods inherited from Conversion

#to_s

Constructor Details

#initializeReceivedCountConversion

Initializes converted_type to :UINT and converted_bit_size to 32



19
20
21
22
23
# File 'lib/cosmos/conversions/received_count_conversion.rb', line 19

def initialize
  super()
  @converted_type = :UINT
  @converted_bit_size = 32
end

Instance Method Details

#call(value, packet, buffer) ⇒ Integer

Returns packet.received_count.

Parameters:

  • value (Object)

    The value to convert

  • packet (Packet)

    The packet which contains the value. This can be useful to reach into the packet and use other values in the conversion.

  • buffer (String)

    The packet buffer

Returns:

  • (Integer)

    packet.received_count



27
28
29
# File 'lib/cosmos/conversions/received_count_conversion.rb', line 27

def call(value, packet, buffer)
  packet.received_count
end