Class: NMEAPlus::Message::AIS::VDMPayload::VDMMsg8

Inherits:
VDMMsg
  • Object
show all
Defined in:
lib/nmea_plus/message/ais/vdm_payload/vdm_msg8.rb

Overview

AIS Type 8: Binary Broadcast Message

Instance Attribute Summary collapse

Attributes inherited from VDMMsg

#message_type, #repeat_indicator, #source_mmsi, #source_mmsi_info

Attributes inherited from Payload

#fill_bits, #payload_bitstring

Instance Method Summary collapse

Methods inherited from VDMMsg

#auxiliary_craft?, #get_navigational_status_description, #get_ship_cargo_type_description

Methods inherited from Payload

#_2b_data_string, #_6b_ascii, #_6b_boolean, #_6b_integer, #_6b_integer_scaled, #_6b_integer_scaled_shifted, #_6b_negated_boolean, #_6b_string, #_6b_string_nullterminated, #_6b_unsigned_integer, #_6b_unsigned_integer_scaled, #_6b_unsigned_integer_scaled_shifted, #_8b_data_string, #_access, #_bit_slices, #_get_date_mdhm, #_object_by_name, #initialize, payload_reader

Constructor Details

This class inherits a constructor from NMEAPlus::Message::AIS::VDMPayload::Payload

Instance Attribute Details

#designated_area_codeObject (readonly)

Returns The field defined by the 10 bits starting at payload bit 40, formatted with the function Payload#_u(, , ).

Returns:

  • The field defined by the 10 bits starting at payload bit 40, formatted with the function Payload#_u(, , )



16
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8.rb', line 16

payload_reader :designated_area_code, 40, 10, :_u

#dpVDMMsg8DynamicPayload (readonly)

Dynamic Payload containing fields for the appropriate message 8 subtype. This is a factory method for the container class



23
24
25
26
27
28
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8.rb', line 23

def dp
  ret = _dynamic_payload_container
  ret.payload_bitstring = payload_bitstring
  ret.fill_bits = fill_bits
  ret
end

#functional_idObject (readonly)

Returns The field defined by the 6 bits starting at payload bit 50, formatted with the function Payload#_u(, , ).

Returns:

  • The field defined by the 6 bits starting at payload bit 50, formatted with the function Payload#_u(, , )



17
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8.rb', line 17

payload_reader :functional_id, 50, 6, :_u

Instance Method Details

#_dynamic_payload_containerObject

Dynamically calculate what message subtype to use which depends on the designated_area_code and functional_id



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8.rb', line 33

def _dynamic_payload_container
  class_identifier = "NMEAPlus::Message::AIS::VDMPayload::VDMMsg8d#{designated_area_code}f#{functional_id}"
  ret = _object_by_name(class_identifier)
  return ret unless ret.nil?

  # 316 / 366
  if designated_area_code == 316
    class_identifier = "NMEAPlus::Message::AIS::VDMPayload::VDMMsg8d366f#{functional_id}"
    ret = _object_by_name(class_identifier)
    return ret unless ret.nil?
  end

  _object_by_name("NMEAPlus::Message::AIS::VDMPayload::VDMMsg8Undefined") # generic
end