diff --git a/pgns/129794.js b/pgns/129794.js index 5ebabc6..e97c042 100644 --- a/pgns/129794.js +++ b/pgns/129794.js @@ -50,8 +50,13 @@ module.exports = [ } }, { - node: 'communication.callsignVhf', - source: 'Callsign' + node: '', + filter: n2k => n2k.fields['Callsign'], + value: n2k => ({ + communication: { + callsignVhf: n2k.fields['Callsign'] + } + }) }, { node: 'design.beam', diff --git a/pgns/129810.js b/pgns/129810.js index 17ba6de..950dea8 100644 --- a/pgns/129810.js +++ b/pgns/129810.js @@ -26,8 +26,13 @@ module.exports = [ source: 'Beam' }, { - node: 'communication.callsignVhf', - source: 'Callsign' + node: '', + filter: n2k => n2k.fields['Callsign'], + value: n2k => ({ + communication: { + callsignVhf: n2k.fields['Callsign'] + } + }) }, { node: 'sensors.ais.fromBow', diff --git a/test/129794_ais_class_a_static_data.js b/test/129794_ais_class_a_static_data.js index e544c0c..e218d85 100644 --- a/test/129794_ais_class_a_static_data.js +++ b/test/129794_ais_class_a_static_data.js @@ -53,7 +53,7 @@ describe('129794 AIS Class A Static and Voyage Related Data', function () { const valuesWithEmptyPath = delta.updates[0].values.filter( pathValue => pathValue.path === '' ) - valuesWithEmptyPath.length.should.equal(3) + valuesWithEmptyPath.length.should.equal(4) expect(valuesWithEmptyPath).to.have.deep.members([ { path: '', @@ -61,6 +61,14 @@ describe('129794 AIS Class A Static and Voyage Related Data', function () { name: 'SILVER GWEN' } }, + { + path: '', + value: { + communication: { + callsignVhf: '3FJJ4' + } + } + }, { path: '', value: { @@ -91,7 +99,6 @@ describe('129794 AIS Class A Static and Voyage Related Data', function () { ) tree.should.have.nested.property('sensors.ais.fromBow.value', 147.0) tree.should.have.nested.property('sensors.ais.fromCenter.value', 8) - tree.should.have.nested.property('communication.callsignVhf.value', '3FJJ4') delete tree.design.aisShipType //TODO enable when sensors.ais.class is in the schema //tree.should.be.validSignalKVesselIgnoringIdentity