Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compatibility with navionics which only accepts $GP for RMC #42

Merged
merged 1 commit into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentences/GGA.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = function (app) {
}

return toSentence([
'$IIGGA',
'$GPGGA',
time,
toNmeaDegreesLatitude(position.latitude),
toNmeaDegreesLongitude(position.longitude),
Expand Down
4 changes: 2 additions & 2 deletions sentences/GLL.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $IIGLL,IIII.II,a,yyyyy.yy,a,hhmmss.ss,A,A*hh
I I I___ I_Longitude, E/W
I__I_Latidude, N/S
*/
// NMEA0183 Encoder GLL $IIGLL,5943.4970,N,2444.1983,E,200001.020,A*16
// NMEA0183 Encoder GLL $GPGLL,5943.4970,N,2444.1983,E,200001.020,A*16

const nmea = require('../nmea.js')
module.exports = function (app) {
Expand All @@ -19,7 +19,7 @@ module.exports = function (app) {
var minutes = ('00' + datetime.getMinutes()).slice(-2)
var seconds = ('00' + datetime.getSeconds()).slice(-2)
return nmea.toSentence([
'$IIGLL',
'$GPGLL',
nmea.toNmeaDegreesLatitude(position.latitude),
nmea.toNmeaDegreesLongitude(position.longitude),
hours + minutes + seconds + '.020',
Expand Down
2 changes: 1 addition & 1 deletion sentences/RMC.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = function (app) {
magneticVariation = magneticVariation * -1;
}
return toSentence([
'$IIRMC',
'$GPRMC',
time,
'A',
toNmeaDegreesLatitude(position.latitude),
Expand Down
4 changes: 2 additions & 2 deletions test/GGA.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('GGA', function() {

it('works with default values', done => {
const onEmit = (event, value) => {
assert.equal(value ,'$IIGGA,172814,3723.4659,N,12202.2696,W,0,0,0,0,M,0,M,,*52')
assert.equal(value ,'$GPGGA,172814,3723.4659,N,12202.2696,W,0,0,0,0,M,0,M,,*45')
done()
}
const app = createAppWithPlugin(onEmit, 'GGA')
Expand All @@ -16,7 +16,7 @@ describe('GGA', function() {

it('works with sample values', done=> {
const onEmit = (event, value) => {
assert.equal(value ,'$IIGGA,172814,3723.4659,N,12202.2696,W,2,6,1.2,18.893,M,-25.669,M,2,0031*53')
assert.equal(value ,'$GPGGA,172814,3723.4659,N,12202.2696,W,2,6,1.2,18.893,M,-25.669,M,2,0031*44')
done()
}
const app = createAppWithPlugin(onEmit, 'GGA')
Expand Down
6 changes: 3 additions & 3 deletions test/RMC.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {createAppWithPlugin} = require ('./testutil')
describe('RMC', function () {
it('works without datetime & magneticVariation', done => {
const onEmit = (event, value) => {
assert.equal(value, '$IIRMC,,A,0600.0000,N,00500.0000,E,1.9,114.6,,,E*46')
assert.equal(value, '$GPRMC,,A,0600.0000,N,00500.0000,E,1.9,114.6,,,E*51')
done()
}
const app = createAppWithPlugin(onEmit, 'RMC')
Expand All @@ -18,7 +18,7 @@ describe('RMC', function () {

it('works with large longitude & magnetic variation', done => {
const onEmit = (event, value) => {
assert.equal(value, '$IIRMC,,A,3749.6038,N,12225.2480,W,1.9,114.6,,180.0,E*7C')
assert.equal(value, '$GPRMC,,A,3749.6038,N,12225.2480,W,1.9,114.6,,180.0,E*6B')
done()
}
const app = createAppWithPlugin(onEmit, 'RMC')
Expand All @@ -32,7 +32,7 @@ describe('RMC', function () {

it('ignores a too large longitude', done => {
const onEmit = (event, value) => {
assert.equal(value, '$IIRMC,,A,3749.6038,N,12225.2480,W,1.9,114.6,,,E*5B')
assert.equal(value, '$GPRMC,,A,3749.6038,N,12225.2480,W,1.9,114.6,,,E*4C')
done()
}
const app = createAppWithPlugin(onEmit, 'RMC')
Expand Down