diff --git a/hooks/BWC.js b/hooks/BWC.js index b4ee813..5d431f3 100644 --- a/hooks/BWC.js +++ b/hooks/BWC.js @@ -66,6 +66,11 @@ module.exports = function BWCHook(input) { latitude, }, }) + } else { + values.push({ + path: 'navigation.courseGreatCircle.nextPoint.position', + value: null, + }) } if (parts[9] !== '' && parts[10] !== '') { diff --git a/test/BWC.js b/test/BWC.js index e1f5349..0a86f0c 100644 --- a/test/BWC.js +++ b/test/BWC.js @@ -63,6 +63,10 @@ describe('BWC', () => { delta.should.be.an('object') delta.updates[0].values.should.deep.equal([ + { + path: 'navigation.courseGreatCircle.nextPoint.position', + value: null, + }, { path: 'navigation.courseGreatCircle.nextPoint.distance', value: 40929.20003454424, @@ -80,6 +84,12 @@ describe('BWC', () => { it("Doesn't choke on an empty sentence", () => { const delta = new Parser().parse('$GPBWC,,,,,,,,,,,,*41') - should.equal(delta, undefined) + + delta.updates[0].values.should.deep.equal([ + { + path: 'navigation.courseGreatCircle.nextPoint.position', + value: null, + }, + ]) }) })