nmea_plus 1.0.17 → 1.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e70e97e74e7f165b5009a4ecf770c7ed98a0dd9
4
- data.tar.gz: 7661c27f641556f2bf18766f8fd2d21fbccb52ea
3
+ metadata.gz: 64c81ca17980fff6fb15d5aef4d45e19b49a3367
4
+ data.tar.gz: c47476023d1c6b162306587e5ee94e4f32bced7f
5
5
  SHA512:
6
- metadata.gz: 94d5d256d78f0658e47d7337e6764877054030b809902373cb05cc65e35206c8571b259e9a191597fd2b796beae651fa3cc4662dd8322892c75cc9ca2e6bd1f6
7
- data.tar.gz: cea08c301a05ade507d5bb8fe102255cb2cf174da7cca23e6bebb1548cfd6bdb3b2dfb7379e6f27b81a46422c09b67f7f55a3b1ce66f151618f81ed5df1f5881
6
+ metadata.gz: 9127ce5a96e7a6ec258628e3dc23a158f94e68f69981db4c2b0dd94b6e5bb39821b3ed97734aa9efaf4f17f76b6adf36e774896f39d65fb6ce7f1574493d6dcb
7
+ data.tar.gz: 04b0f32452147f58a0fcbf7c9fa46e6334ea659570aafb34102d4bcbd01821a7af91c4a28d7cbddeeec2c0fc8e713e6b6d5e5f60f6dea1524b59eb748554c18f
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/nmea_plus.svg)](https://rubygems.org/gems/nmea_plus)
4
4
  [![Build Status](https://travis-ci.org/ifreecarve/nmea_plus.svg)](https://travis-ci.org/ifreecarve/nmea_plus)
5
- [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/nmea_plus/1.0.17)
5
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/nmea_plus/1.0.18)
6
6
 
7
7
  [NMEA Plus](https://github.com/ifreecarve/nmea_plus) is a Ruby gem for parsing and decoding "GPS" messages: NMEA, AIS, and any other similar formats of short messaging typically used by marine equipment. It provides convenient access (by name) to the fields of each message type, and a stream reader designed for use with Ruby Blocks.
8
8
 
@@ -104,7 +104,7 @@ http://catb.org/gpsd/AIVDM.html
104
104
  And some binary subtypes from the ITU spec found here:
105
105
  https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1371-4-201004-S!!PDF-E.pdf
106
106
 
107
- The AIS payload can be found in the payload field of a `VDM` message (aka `!AIVDM`, `!ABVDM`, `!SAVDM`). Currently, the following AIS message types are supported:
107
+ The AIS payload can be found in the payload field of a `VDM` message (aka `!AIVDM`, `!ABVDM`, `!SAVDM`) or `VDO` message (aka `!AIVDO`). Currently, the following AIS message types are supported:
108
108
 
109
109
  > 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 24, 27
110
110
 
@@ -16,10 +16,12 @@ module NMEAPlus
16
16
 
17
17
  # Match all AIS messages as their generic counterparts. AIVDM becomes VDM, etc.
18
18
  # @param data_type [String] The data_type of the AIS message (e.g. the AIVDM of "$AIVDM,12,3,,4,5*00")
19
- # @return [String] The data_type that we will attempt to use in decoding the message (e.g. VDM)
19
+ # @return [Array] Array of data_type strings that we will attempt to use in decoding the message
20
20
  def self.alternate_data_type(data_type)
21
21
  # match last 3 digits (get rid of talker)
22
- data_type[2..4]
22
+ ret = [data_type[2..4]]
23
+ ret << "VDM" if data_type == "AIVDO"
24
+ ret
23
25
  end
24
26
  end
25
27
  end
@@ -21,9 +21,9 @@ module NMEAPlus
21
21
  # alternate type (like GPAAM) or a generic type (like AAM). This is where we put that logic.
22
22
  # @abstract
23
23
  # @param data_type [String] The data_type of the NMEA message (e.g. the GPGLL of "$GPGLL,12,3,,4,5*00")
24
- # @return [String] The data_type that we will attempt to use in decoding the message
24
+ # @return [Array] Array of data_type strings that we will attempt to use in decoding the message
25
25
  def self.alternate_data_type(data_type)
26
- data_type # in basic implementation, there is no alternative.
26
+ [data_type] # in basic implementation, there is no alternative.
27
27
  end
28
28
 
29
29
  # Check whether a given object exists. this will work for all consts but shhhhhhhhh
@@ -49,7 +49,10 @@ module NMEAPlus
49
49
  # @return [String] The fully qualified message class name
50
50
  def self.best_match_for_data_type(data_type)
51
51
  return data_type if self.message_class_exists?(self.message_class_name(data_type))
52
- self.alternate_data_type(data_type)
52
+ self.alternate_data_type(data_type).each do |alternate_type|
53
+ return alternate_type if self.message_class_exists?(self.message_class_name(alternate_type))
54
+ end
55
+ data_type
53
56
  end
54
57
 
55
58
  # Get a message class through reflection
@@ -107,10 +107,10 @@ end
107
107
 
108
108
  # Match all NMEA messages as their generic counterparts. GPGLL becomes GLL, etc.
109
109
  # @param data_type [String] The data_type of the NMEA message (e.g. the GPGLL of "$GPGLL,12,3,,4,5*00")
110
- # @return [String] The data_type that we will attempt to use in decoding the message (e.g. GLL)
110
+ # @return [Array] Array of data_type strings that we will attempt to use in decoding the message
111
111
  def self.alternate_data_type(data_type)
112
112
  # match last 3 digits (get rid of talker)
113
- data_type[2..4]
113
+ [data_type[2..4]]
114
114
  end
115
115
  end
116
116
 
@@ -1,3 +1,3 @@
1
1
  module NMEAPlus
2
- VERSION = '1.0.17'.freeze
2
+ VERSION = '1.0.18'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nmea_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Katz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-05 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: racc