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 +4 -4
- data/README.md +2 -2
- data/lib/nmea_plus/ais_message_factory.rb +4 -2
- data/lib/nmea_plus/message_factory.rb +6 -3
- data/lib/nmea_plus/nmea_message_factory.rb +2 -2
- data/lib/nmea_plus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64c81ca17980fff6fb15d5aef4d45e19b49a3367
|
4
|
+
data.tar.gz: c47476023d1c6b162306587e5ee94e4f32bced7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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 [
|
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 [
|
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 [
|
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
|
|
data/lib/nmea_plus/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: racc
|