1
1
# Java Marine API
2
2
[ ![ License] ( https://img.shields.io/badge/License-LGPL%20v3-brightgreen.svg )] ( ./LICENSE )
3
- [ ![ Build Status ] ( https://travis-ci.org /ktuukkan/marine-api.png )] ( https://travis-ci.org /ktuukkan/marine-api )
3
+ [ ![ Build] ( https://github.com /ktuukkan/marine-api/actions/workflows/test.yml/badge.svg )] ( https://github.com /ktuukkan/marine-api/actions/workflows/test.yml )
4
4
[ ![ Maven Central] ( https://maven-badges.herokuapp.com/maven-central/net.sf.marineapi/marineapi/badge.svg )] ( https://maven-badges.herokuapp.com/maven-central/net.sf.marineapi/marineapi )
5
5
[ ![ Download Java Marine API] ( https://img.shields.io/sourceforge/dm/marineapi.svg )] ( https://sourceforge.net/projects/marineapi/files/Releases/ )
6
6
[ ![ Javadocs] ( http://www.javadoc.io/badge/net.sf.marineapi/marineapi.svg )] ( http://www.javadoc.io/doc/net.sf.marineapi/marineapi )
7
7
[ ![ Sponsored by Spice] ( https://img.shields.io/badge/sponsored%20by-Spice-brightgreen.svg )] ( http://www.spiceprogram.org )
8
8
9
- - [ About] ( #about )
9
+ - [ Java Marine API] ( #java-marine-api )
10
+ - [ About] ( #about )
10
11
- [ Features] ( #features )
11
- - [ Licensing] ( #licensing )
12
- - [ Disclaimer] ( #disclaimer )
13
- - [ Requirements] ( #requirements )
14
- - [ Usage] ( #usage )
15
- - [ Supported Protocols] ( #supported-protocols )
12
+ - [ Licensing] ( #licensing )
13
+ - [ Disclaimer] ( #disclaimer )
14
+ - [ Requirements] ( #requirements )
15
+ - [ Usage] ( #usage )
16
+ - [ Supported Protocols] ( #supported-protocols )
16
17
- [ NMEA 0183] ( #nmea-0183 )
17
18
- [ AIS] ( #ais )
18
- - [ Raymarine SeaTalk] ( #raymarine-seatalk1 )
19
- - [ Distribution] ( #distribution )
19
+ - [ Raymarine SeaTalk<sup >1</sup >] ( #raymarine-seatalksup1sup )
20
+ - [ u-blox] ( #u-blox )
21
+ - [ Distribution] ( #distribution )
20
22
- [ Pre-built JARs] ( #pre-built-jars )
21
23
- [ Maven] ( #maven )
22
- - [ Contributing] ( #contributing )
23
- - [ References] ( #references )
24
+ - [ Snapshots] ( #snapshots )
25
+ - [ Contributing] ( #contributing )
26
+ - [ References] ( #references )
27
+ - [ National Marine Electronics Association] ( #national-marine-electronics-association )
28
+ - [ Navigation Center of U.S. Department of Homeland Security] ( #navigation-center-of-us-department-of-homeland-security )
29
+ - [ Product Manuals and User Guides] ( #product-manuals-and-user-guides )
30
+ - [ Wikipedia] ( #wikipedia )
31
+ - [ Miscellaneus] ( #miscellaneus )
32
+ - [ No longer available] ( #no-longer-available )
24
33
25
34
## About
26
35
@@ -76,43 +85,60 @@ should never be your only reference.
76
85
77
86
### Requirements
78
87
79
- * Java 2 SE JRE/JDK v1.8.0 or newer
80
- * For serial port communication:
81
-
82
- * [ Neuron Robotics Java Serial Library] ( https://github.com/NeuronRobotics/nrjavaserial )
83
- * [ PureJavaComm] ( http://www.sparetimelabs.com/purejavacomm )
84
- * [ RXTX library] ( http://rxtx.qbang.org )
85
- * [ Java Communications API] ( http://www.oracle.com/technetwork/java/index-jsp-141752.html )
88
+ * Java 2 SE JRE/JDK 11 or newer
89
+ * For serial port communication (choose one):
90
+ * [ Neuron Robotics Java Serial Library] ( https://github.com/NeuronRobotics/nrjavaserial )
91
+ * [ PureJavaComm] ( http://www.sparetimelabs.com/purejavacomm )
92
+ * [ RXTX library] ( http://rxtx.qbang.org )
93
+ * [ Java Communications API] ( http://www.oracle.com/technetwork/java/index-jsp-141752.html )
86
94
87
95
### Usage
88
96
89
97
Write a listener:
90
98
91
- class GGAListener extends AbstractSentenceListener<GGASentence> {
92
- public void sentenceRead( GGASentence gga) {
93
- Position pos = gga.getPosition();
94
- // .. your code
95
- }
99
+ ``` java
100
+ class GGAListener extends AbstractSentenceListener< GGASentence > {
101
+ public void sentenceRead ( GGASentence gga ) {
102
+ Position pos = gga . getPosition();
103
+ // .. your code
96
104
}
105
+ }
106
+ ```
97
107
98
108
Set up the reader:
99
109
100
- File file = new File("/var/log/nmea.log");
101
- SentenceReader reader = new SentenceReader(new FileInputStream(file));
102
- reader.addSentenceListener(new GGAListener());
103
- reader.start();
110
+ ``` java
111
+ File file = new File (" /var/log/nmea.log" );
112
+ SentenceReader reader = new SentenceReader (new FileInputStream (file));
113
+ reader. addSentenceListener(new GGAListener ());
114
+ reader. start();
115
+ ```
104
116
105
117
Manual parsing:
106
118
107
- String nmea = "$GPGSA,A,3,03,05,07,08,10,15,18,19,21,28,,,1.4,0.9,1.1*3A";
108
- SentenceFactory sf = SentenceFactory.getInstance();
109
- GSASentence gsa = (GSASentence) sf.createParser(nmea);
119
+ ``` java
120
+ String nmea = " $GPGSA,A,3,03,05,07,08,10,15,18,19,21,28,,,1.4,0.9,1.1*3A" ;
121
+ SentenceFactory sf = SentenceFactory . getInstance();
122
+ GSASentence gsa = (GSASentence ) sf. createParser(nmea);
123
+ ```
124
+
125
+ Recommended Android Proguard settings when ` minifyEnabled ` is set ` true ` :
126
+
127
+ ```
128
+ -keep class net.sf.marineapi.** { *; }
129
+ -keep interface net.sf.marineapi.** { *; }
130
+ -keepattributes MethodParameters
131
+ -dontwarn gnu.io.CommPortIdentifier
132
+ -dontwarn gnu.io.RXTXPort
133
+ -dontwarn gnu.io.SerialPort
134
+ ```
110
135
111
136
See also:
112
137
- [ Examples] ( src/main/java/net/sf/marineapi/example )
113
138
- [ Javadocs] ( http://www.javadoc.io/doc/net.sf.marineapi/marineapi )
114
139
- [ Graphical User Interface] ( https://github.com/aitov/gps-info ) using marine-api by @aitov
115
140
141
+
116
142
## Supported Protocols
117
143
118
144
### NMEA 0183
@@ -152,12 +178,15 @@ the library. See wiki for
152
178
|MTW |Water temperature in degrees Celcius
153
179
|MWD |Wind speed and direction.
154
180
|MWV |Wind speed and angle
181
+ |OSD |Own ship data
155
182
|RMB |Recommended minimum navigation information "type B"
156
183
|RMC |Recommended minimum navigation information "type C"
157
184
|ROT |Vessel's rate of turn
158
185
|RPM |Engine or shaft revolutions
159
186
|RSA |Rudder angle in degrees
187
+ |RSD |Radar system data
160
188
|RTE |GPS route data with list of waypoints
189
+ |TLB |Target label
161
190
|TTM |Tracked target message
162
191
|TXT |Text message
163
192
|VBW |Dual ground/water speed.
@@ -191,6 +220,7 @@ messages are decoded.
191
220
|19 |Extended Class B Equipment Position Report
192
221
|21 |Aid-to-Navigation Report
193
222
|24 |Static Data Report
223
+ |27 |Position Report for long range applications
194
224
195
225
### Raymarine SeaTalk<sup >1</sup >
196
226
@@ -200,6 +230,15 @@ Only the NMEA layer is currently supported, see
200
230
[ STALKSentence] ( src/main/java/net/sf/marineapi/nmea/sentence/STALKSentence.java )
201
231
and [ Issue #67 ] ( https://github.com/ktuukkan/marine-api/issues/67 ) .
202
232
233
+ ### u-blox
234
+
235
+ The following [ u-blox] ( https://www.u-blox.com/ )
236
+ vendor extension messages are supported:
237
+
238
+ | ID | Description
239
+ |--- |---
240
+ | PUBX,01 |Lat/Long Position Data
241
+ | PUBX,03 |Satellite Status
203
242
204
243
## Distribution
205
244
@@ -222,41 +261,47 @@ package naming.
222
261
Both releases and snapshots are deployed to [ Maven Central Repository] ( https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22net.sf.marineapi%22 )
223
262
and may be imported by adding the following dependency in your ` pom.xml ` .
224
263
225
- <dependency>
226
- <groupId>net.sf.marineapi</groupId>
227
- <artifactId>marineapi</artifactId>
228
- <version>0.10.0</version>
229
- <type>bundle</type>
230
- </dependency>
264
+ ``` xml
265
+ <dependency >
266
+ <groupId >net.sf.marineapi</groupId >
267
+ <artifactId >marineapi</artifactId >
268
+ <version >0.10.0</version >
269
+ <type >bundle</type >
270
+ </dependency >
271
+ ```
231
272
232
273
#### Snapshots
233
274
234
275
The snapshots should be mostly stable, but they are still * Work In Progress* and
235
276
should be considered as a preview of the next release.
236
277
237
- See [ changelog] ( changelog.txt ) for the current ` SNAPSHOT ` version. Notice that
278
+ See [ changelog.txt ] ( changelog.txt ) for the current ` SNAPSHOT ` version. Notice that
238
279
you may need to tweak your [ Maven settings] ( https://gist.github.com/ktuukkan/8cf2de1e915185118c60 )
239
280
to enable snapshot dependencies.
240
281
241
- <dependency>
242
- <groupId>net.sf.marineapi</groupId>
243
- <artifactId>marineapi</artifactId>
244
- <version>0.11.0-SNAPSHOT</version>
245
- <type>bundle</type>
246
- </dependency>
282
+ ``` xml
283
+ <dependency >
284
+ <groupId >net.sf.marineapi</groupId >
285
+ <artifactId >marineapi</artifactId >
286
+ <version >0.11.0-SNAPSHOT</version >
287
+ <type >bundle</type >
288
+ </dependency >
289
+ ```
247
290
248
291
Snapshots may also be downloaded manually from the
249
292
[ repository] ( https://oss.sonatype.org/content/repositories/snapshots/net/sf/marineapi/marineapi/ ) .
250
293
294
+
251
295
## Contributing
252
296
253
297
Any feedback or contribution is welcome. You have several options:
254
298
255
299
- [ Contact me] ( https://github.com/ktuukkan )
256
300
- [ Report a bug] ( https://github.com/ktuukkan/marine-api/issues )
257
- - [ Fork] ( https://help.github.com/articles/fork-a-repo/ ) and open a [ pullrequest ] ( https://help.github.com/articles/about-pull-requests/ )
301
+ - [ Fork] ( https://help.github.com/articles/fork-a-repo/ ) and open a [ pull request ] ( https://help.github.com/articles/about-pull-requests/ )
258
302
to share improvements.
259
303
304
+
260
305
## References
261
306
262
307
All information and specifications for this library has been gathered from the
@@ -265,11 +310,6 @@ following documents, availability last checked on 2020-03-15.
265
310
* Notice: any warnings regarding the accuracy of the information in below
266
311
documents apply equally to Java Marine API.*
267
312
268
- ### Wikipedia
269
-
270
- * [ NMEA 0183] ( http://en.wikipedia.org/wiki/NMEA_0183 )
271
- * [ Automatic Identification System] ( https://en.wikipedia.org/wiki/Automatic_identification_system )
272
-
273
313
### National Marine Electronics Association
274
314
275
315
* [ Amendment to NMEA 0183 v4.10 # 20130814] ( https://www.nmea.org/Assets/21030814%20nmea%200183_man%20overboard%20notification_mob_sentence%20amendment.pdf )
@@ -295,19 +335,25 @@ documents apply equally to Java Marine API.*
295
335
* [ SeaTalk/NMEA/RS232 Converter Manual] ( https://community.atmel.com/sites/default/files/project_files/ManualV3-5.pdf ) by gadgetPool
296
336
* [ SiRF NMEA Reference Manual] ( https://www.sparkfun.com/datasheets/GPS/NMEA%20Reference%20Manual-Rev2.1-Dec07.pdf ) by SiRF Technology, Inc.
297
337
* [ The NMEA Information Sheet] ( https://www.actisense.com/wp-content/uploads/2020/01/NMEA-0183-Information-sheet-issue-4-1-1.pdf ) by Actisense
338
+ * [ ZED-F9P F9 high precision GNSS receiver Interface Description] ( https://www.u-blox.com/en/docs/UBX-18010854 ) by u-blox
339
+
340
+ ### Wikipedia
341
+
342
+ * [ NMEA 0183] ( http://en.wikipedia.org/wiki/NMEA_0183 )
343
+ * [ Automatic Identification System] ( https://en.wikipedia.org/wiki/Automatic_identification_system )
298
344
299
345
### Miscellaneus
300
346
301
- * [ NMEA Revealed] ( http://catb.org/gpsd/NMEA.html ) by Eric S. Raymond
302
- * [ AIVDM/AIVDO protocol decoding] ( http://catb.org/gpsd/AIVDM.html ) by Eric S. Raymond
303
- * [ NMEA Data] ( http://www.gpsinformation.org/dale/nmea.htm ) by Dale DePriest
347
+ * [ AIVDM/AIVDO protocol decoding] ( https://gpsd.gitlab.io/gpsd/AIVDM.html ) by Eric S. Raymond
348
+ * [ NMEA Revealed] ( https://gpsd.gitlab.io/gpsd/NMEA.html ) by Eric S. Raymond
304
349
* [ SeaTalk Technical Reference] ( http://www.thomasknauf.de/seatalk.htm ) by Thomas Knauf
305
350
306
351
### No longer available
307
352
308
- * [ RS232/SeaTalk/NMEA Converter manual] ( http://www.gadgetpool.de/nuke/downloads/ManualRS232.pdf )
309
- by gadgetPool (not found)
310
- * [ NMEA Sentence Information] ( http://home.mira.net/~gnb/gps/nmea.html )
311
- by Glenn Baddeley (not found)
312
- * [ The NMEA FAQ] ( http://vancouver-webpages.com/peter/nmeafaq.txt )
313
- by Peter Bennett (see [ older copy] ( http://www.eoss.org/pubs/nmeafaq.htm ) )
353
+ * [ NMEA Data] ( http://www.gpsinformation.org/dale/nmea.htm ) by Dale DePriest
354
+ * [ NMEA Sentence Information] ( http://home.mira.net/~gnb/gps/nmea.html ) by Glenn Baddeley (not found)
355
+ * [ RS232/SeaTalk/NMEA Converter manual] ( http://www.gadgetpool.de/nuke/downloads/ManualRS232.pdf ) by gadgetPool (not found)
356
+ * [ The NMEA FAQ] ( http://vancouver-webpages.com/peter/nmeafaq.txt ) by Peter Bennett (see [ older copy] ( http://www.eoss.org/pubs/nmeafaq.htm ) )
357
+
358
+
359
+ ---
0 commit comments