Class: NMEAPlus::Message::AIS::VDMPayload::VDMMsgCNB

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

Overview

CNB - The Common Navigation Block, transmitted by AIS messages 1, 2, and 3.

Direct Known Subclasses

VDMMsg1, VDMMsg2, VDMMsg3

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

Method Summary

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

#course_over_groundObject (readonly)

Returns The field defined by the 12 bits starting at payload bit 116, formatted with the function Payload#_U(10, 3600, ).

Returns:

  • The field defined by the 12 bits starting at payload bit 116, formatted with the function Payload#_U(10, 3600, )



32
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 32

payload_reader :course_over_ground, 116, 12, :_U, 10, 3600

#latitudeObject (readonly)

Returns The field defined by the 27 bits starting at payload bit 89, formatted with the function Payload#_I(60 * 10**4, 91, ).

Returns:

  • The field defined by the 27 bits starting at payload bit 89, formatted with the function Payload#_I(60 * 10**4, 91, )



31
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 31

payload_reader :latitude, 89, 27, :_I, 60 * 10**4, 91

#longitudeObject (readonly)

Returns The field defined by the 28 bits starting at payload bit 61, formatted with the function Payload#_I(60 * 10**4, 181, ).

Returns:

  • The field defined by the 28 bits starting at payload bit 61, formatted with the function Payload#_I(60 * 10**4, 181, )



30
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 30

payload_reader :longitude, 61, 28, :_I, 60 * 10**4, 181

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

Returns:

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



10
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 10

payload_reader :navigational_status, 38, 4, :_u

Returns the human-readable description of navigational status.

Returns:

  • (String)

    the human-readable description of navigational status



14
15
16
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 14

def navigational_status_description
  get_navigational_status_description(navigational_status)
end

#position_10m_accuracy?Object (readonly)

Returns The field defined by the 1 bits starting at payload bit 60, formatted with the function Payload#_b(, , ).

Returns:

  • The field defined by the 1 bits starting at payload bit 60, formatted with the function Payload#_b(, , )



29
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 29

payload_reader :position_10m_accuracy?, 60, 1, :_b

#rate_of_turnFloat (readonly)

The rate of turn in degrees per minute

Returns:

  • (Float)


21
22
23
24
25
26
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 21

def rate_of_turn
  ret = _i(42, 8) # spec is wrong, we don't use I3
  return nil if ret == -128
  negative = ret < 0
  (ret / 4.733)**2 * (negative ? -1 : 1)
end

#speed_over_groundObject (readonly)

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

Returns:

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



28
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 28

payload_reader :speed_over_ground, 50, 10, :_U, 10

#true_headingObject (readonly)

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

Returns:

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



33
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg_cnb.rb', line 33

payload_reader :true_heading, 128, 9, :_u, 511