From f5f8b04ffb94c9751754178241fb92060e433dec Mon Sep 17 00:00:00 2001 From: Scott Bender Date: Sat, 22 Jul 2023 15:14:26 -0400 Subject: [PATCH] feature: add the option to output null values (#236) --- bin/analyzerjs | 20 ++++++++++++++++++-- lib/fromPgn.js | 7 ++++++- test/pgns/126208.js | 2 +- test/pgns/126720.js | 2 +- test/pgns/126992.js | 2 +- test/pgns/127237.js | 2 +- test/pgns/127245.js | 2 +- test/pgns/127250.js | 2 +- test/pgns/127251.js | 2 +- test/pgns/127257.js | 2 +- test/pgns/127258.js | 2 +- test/pgns/127488.js | 2 +- test/pgns/127489.js | 5 ++--- test/pgns/127497.js | 2 +- test/pgns/127501.js | 2 +- test/pgns/127505.js | 2 +- test/pgns/127506.js | 2 +- test/pgns/127507.js | 2 +- test/pgns/127508.js | 2 +- test/pgns/128259.js | 2 +- test/pgns/128267.js | 2 +- test/pgns/128275.js | 2 +- test/pgns/129026.js | 2 +- test/pgns/129029.js | 4 ++-- test/pgns/129038.js | 2 +- test/pgns/129039.js | 2 +- test/pgns/129041.js | 2 +- test/pgns/129283.js | 2 +- test/pgns/129284.js | 2 +- test/pgns/129285.js | 2 +- test/pgns/129291.js | 2 +- test/pgns/129539.js | 2 +- test/pgns/129540.js | 4 ++-- test/pgns/129793.js | 2 +- test/pgns/129794.js | 2 +- test/pgns/129809.js | 2 +- test/pgns/129810.js | 2 +- test/pgns/130306.js | 2 +- test/pgns/130310.js | 2 +- test/pgns/130311.js | 2 +- test/pgns/130312.js | 2 +- test/pgns/130313.js | 2 +- test/pgns/130314.js | 2 +- test/pgns/130577.js | 2 +- test/pgns/130820.js | 4 ++-- test/pgns/130821.js | 2 +- test/pgns/130824.js | 2 +- test/pgns/130842.js | 2 +- test/pgns/59392.js | 2 +- test/pgns/65280.js | 2 +- test/pgns/65359.js | 2 +- test/pgns/65360.js | 2 +- test/pgns/65379.js | 2 +- test/pgns/65408.js | 2 +- test/pgns/65410.js | 2 +- test/test.js | 2 +- 56 files changed, 82 insertions(+), 62 deletions(-) diff --git a/bin/analyzerjs b/bin/analyzerjs index 8c77ae1..3bde538 100755 --- a/bin/analyzerjs +++ b/bin/analyzerjs @@ -1,9 +1,25 @@ #!/usr/bin/env node -const argv = require('minimist')(process.argv.slice(2)) +const argv = require('minimist')(process.argv.slice(2), { + alias: { h: 'help' }, + boolean: ['n'] +}) + +if ( argv['help'] ) { + console.error(`Usage: ${process.argv[1]} [options] + +Options: + -c don't check for invalid values + -n output null values + -h, --help output usage information`) + process.exit(1) +} const Parser = require('../index').FromPgn -var parser = new Parser() +var parser = new Parser( { + returnNulls: argv['n'] === true, + checkForInvalidFields: argv['n'] +}) parser.on('error', (pgn, error) => { console.error(`Error parsing ${pgn.pgn} ${error}`) diff --git a/lib/fromPgn.js b/lib/fromPgn.js index 68b0cfc..669019e 100644 --- a/lib/fromPgn.js +++ b/lib/fromPgn.js @@ -60,6 +60,10 @@ class Parser extends EventEmitter { super() this.options = _.isUndefined(opts) ? {} : opts + if ( this.options.returnNulls === undefined ) { + this.options.returnNulls = false + } + this.name = pkg.name this.version = pkg.version this.author = pkg.author @@ -235,7 +239,8 @@ class Parser extends EventEmitter { } } - if ( !_.isUndefined(value) && value != null ) { + if ( !_.isUndefined(value) && (value != null || + this.options.returnNulls) ) { pgn.fields[field.Name] = value } } diff --git a/test/pgns/126208.js b/test/pgns/126208.js index 2b4571c..27054b5 100644 --- a/test/pgns/126208.js +++ b/test/pgns/126208.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"prio":2,"pgn":126208,"dst":67,"src":0,"timestamp":"2020-04-19T00:35:55.571Z","fields":{"Function Code":"Command","PGN":126998,"Number of Parameters":1,"list":[{"Parameter":2,"Value":"YD:VOLUME 60"}]},"description":"NMEA - Command group function"}, + "expected": {"prio":2,"pgn":126208,"dst":67,"src":0,"timestamp":"2020-04-19T00:35:55.571Z","fields":{"Function Code":"Command","PGN":126998,"Number of Parameters":1,"Priority":null,"Reserved1":null,"list":[{"Parameter":2,"Value":"YD:VOLUME 60"}]},"description":"NMEA - Command group function"}, "input": "2020-04-19T00:35:55.571Z,2,126208,0,67,21,01,16,f0,01,ff,01,02,0e,01,59,44,3a,56,4f,4c,55,4d,45,20,36,30" }] diff --git a/test/pgns/126720.js b/test/pgns/126720.js index 87323cc..98e058c 100644 --- a/test/pgns/126720.js +++ b/test/pgns/126720.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T16:02:48.913Z","prio":7,"src":1,"dst":255,"pgn":126720,"description":"Seatalk1: Device Identification","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Proprietary ID":"0x81f0","command":"0x90","device":"S100"}}, + "expected": {"timestamp":"2017-04-15T16:02:48.913Z","prio":7,"src":1,"dst":255,"pgn":126720,"description":"Seatalk1: Device Identification","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Proprietary ID":"0x81f0","command":"0x90","device":"S100","Reserved1":null,"Reserved2":null}}, "input": "2017-04-15T16:02:48.913Z,7,126720,1,255,7,3b,9f,f0,81,90,ff,03" }] diff --git a/test/pgns/126992.js b/test/pgns/126992.js index 851b31d..f235033 100644 --- a/test/pgns/126992.js +++ b/test/pgns/126992.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.471Z","prio":3,"src":3,"dst":255,"pgn":126992,"description":"System Time","fields":{"Date":"2017.04.15", "Time": "14:57:57"}}, + "expected": {"timestamp":"2017-04-15T14:57:58.471Z","prio":3,"src":3,"dst":255,"pgn":126992,"description":"System Time","fields":{"Date":"2017.04.15", "Time": "14:57:57","Reserved1":null,"SID":null,"Source":null}}, "input": "2017-04-15T14:57:58.471Z,3,126992,3,255,8,ff,ff,77,43,50,fa,1c,20" }] diff --git a/test/pgns/127237.js b/test/pgns/127237.js index 90bdff5..f99043a 100644 --- a/test/pgns/127237.js +++ b/test/pgns/127237.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":2,"src":172,"dst":255,"pgn":127237,"description":"Heading/Track control","fields":{"Rudder Limit Exceeded":"No","Override":"No","Steering Mode":"Follow-Up Device","Turn Mode":"Rudder limit controlled","Commanded Rudder Direction":"Move to starboard","Commanded Rudder Angle":-0.0015}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":2,"src":172,"dst":255,"pgn":127237,"description":"Heading/Track control","fields":{"Rudder Limit Exceeded":"No","Override":"No","Steering Mode":"Follow-Up Device","Turn Mode":"Rudder limit controlled","Commanded Rudder Direction":"Move to starboard","Commanded Rudder Angle":-0.0015,"Heading Reference":null,"Heading-To-Steer (Course)":null,"Off-Heading Limit":null,"Off-Heading Limit Exceeded":null,"Off-Track Limit":null,"Off-Track Limit Exceeded":null,"Radius of Turn Order":null,"Rate of Turn Order":null,"Reserved1":null,"Rudder Limit":null,"Vessel Heading":null,"Track":null}}, "input": "2017-04-15T14:57:58.469Z,2,127237,172,255,21,3c,c2,3f,f1,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,7f,ff,7f,ff,7f,ff,ff" }] diff --git a/test/pgns/127245.js b/test/pgns/127245.js index 9822bc2..698a23b 100644 --- a/test/pgns/127245.js +++ b/test/pgns/127245.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":172,"dst":255,"pgn":127245,"description":"Rudder","fields":{"Instance":252,"Direction Order":4,"Angle Order":-0.0021,"Position":-0.0029}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":172,"dst":255,"pgn":127245,"description":"Rudder","fields":{"Instance":252,"Direction Order":4,"Angle Order":-0.0021,"Position":-0.0029,"Reserved1":null,"Reserved2":null}}, "input": "2017-04-15T14:57:58.468Z,2,127245,172,255,8,fc,fc,eb,ff,e3,ff,ff,ff" }] diff --git a/test/pgns/127250.js b/test/pgns/127250.js index 46ca0d3..cc075df 100644 --- a/test/pgns/127250.js +++ b/test/pgns/127250.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":204,"dst":255,"pgn":127250,"description":"Vessel Heading","fields":{"Heading":2.4600,"Reference":"Magnetic"}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":204,"dst":255,"pgn":127250,"description":"Vessel Heading","fields":{"Heading":2.4600,"Reference":"Magnetic","Deviation":null,"Reserved1":null,"Variation":null,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,2,127250,204,255,8,ff,18,60,ff,7f,ff,7f,fd" }] diff --git a/test/pgns/127251.js b/test/pgns/127251.js index c88d876..3201741 100644 --- a/test/pgns/127251.js +++ b/test/pgns/127251.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":204,"dst":255,"pgn":127251,"description":"Rate of Turn","fields":{"Rate":0.00069103, "Reserved1": 16777215}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":204,"dst":255,"pgn":127251,"description":"Rate of Turn","fields":{"Rate":0.00069103, "Reserved1": 16777215,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,2,127251,204,255,8,ff,61,56,00,00,ff,ff,ff" }] diff --git a/test/pgns/127257.js b/test/pgns/127257.js index b98a79a..53b9667 100644 --- a/test/pgns/127257.js +++ b/test/pgns/127257.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":204,"dst":255,"pgn":127257,"description":"Attitude","fields":{"Yaw":2.4600,"Pitch":0.0303,"Roll":0.0001}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":204,"dst":255,"pgn":127257,"description":"Attitude","fields":{"Yaw":2.4600,"Pitch":0.0303,"Roll":0.0001,"Reserved1":null,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,2,127257,204,255,8,ff,18,60,2f,01,01,00,ff" }] diff --git a/test/pgns/127258.js b/test/pgns/127258.js index 9e9c9e9..51598d0 100644 --- a/test/pgns/127258.js +++ b/test/pgns/127258.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":3,"dst":255,"pgn":127258,"description":"Magnetic Variation","fields":{"Source":"WMM 2015","Age of service":"2015.01.01","Variation":-0.1955}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":3,"dst":255,"pgn":127258,"description":"Magnetic Variation","fields":{"Source":"WMM 2015","Age of service":"2015.01.01","Variation":-0.1955,"Reserved1":null,"Reserved2":null,"SID":null}}, "input": "2017-04-15T14:57:58.469Z,6,127258,3,255,8,ff,f7,34,40,5d,f8,ff,ff" }] diff --git a/test/pgns/127488.js b/test/pgns/127488.js index 7ded7fd..a517818 100644 --- a/test/pgns/127488.js +++ b/test/pgns/127488.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":17,"dst":255,"pgn":127488,"description":"Engine Parameters, Rapid Update","fields":{"Instance":"Dual Engine Starboard","Speed":0.0}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":17,"dst":255,"pgn":127488,"description":"Engine Parameters, Rapid Update","fields":{"Instance":"Dual Engine Starboard","Speed":0.0,"Boost Pressure":null,"Reserved1":null,"Tilt/Trim":null}}, "input": "2017-04-15T14:57:58.468Z,2,127488,17,255,8,01,00,00,ff,ff,7f,ff,ff" }] diff --git a/test/pgns/127489.js b/test/pgns/127489.js index 271e8a6..b0ab245 100644 --- a/test/pgns/127489.js +++ b/test/pgns/127489.js @@ -1,11 +1,10 @@ -//fixme: add "Total Engine hours" when implemented module.exports = [{ - "expected": {"timestamp":"2023-04-01T17:24:51.634Z","prio":2,"src":16,"dst":255,"pgn":127489,"description":"Engine Parameters, Dynamic","fields":{"Instance":"Single Engine or Dual Engine Port","Oil pressure":158300,"Temperature":296.67,"Alternator Potential":13.82,"Discrete Status 1":["Over Temperature","Low Oil Pressure"],"Discrete Status 2": [], "Total Engine hours":"00:10:00"}}, + "expected": {"timestamp":"2023-04-01T17:24:51.634Z","prio":2,"src":16,"dst":255,"pgn":127489,"description":"Engine Parameters, Dynamic","fields":{"Instance":"Single Engine or Dual Engine Port","Oil pressure":158300,"Temperature":296.67,"Alternator Potential":13.82,"Discrete Status 1":["Over Temperature","Low Oil Pressure"],"Discrete Status 2": [], "Total Engine hours":"00:10:00","Coolant Pressure":null,"Engine Load":null,"Engine Torque":null,"Fuel Pressure":null,"Fuel Rate":null,"Oil temperature":null,"Reserved1":null}}, "input": "2023-04-01T17:24:51.634Z,2,127489,16,255,26,00,2f,06,ff,ff,e3,73,66,05,ff,7f,58,02,00,00,ff,ff,ff,ff,ff,06,00,00,00,7f,7f" }, { - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":2,"src":17,"dst":255,"pgn":127489,"description":"Engine Parameters, Dynamic","fields":{"Instance":"Single Engine or Dual Engine Port","Oil pressure":393000,"Temperature":330.43,"Discrete Status 1": [],"Discrete Status 2": []}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":2,"src":17,"dst":255,"pgn":127489,"description":"Engine Parameters, Dynamic","fields":{"Instance":"Single Engine or Dual Engine Port","Oil pressure":393000,"Temperature":330.43,"Discrete Status 1": [],"Discrete Status 2": [],"Alternator Potential":null,"Coolant Pressure":null,"Engine Load":null,"Engine Torque":null,"Fuel Pressure":null,"Fuel Rate":null,"Oil temperature":null,"Reserved1":null,"Total Engine hours":null}}, "input": "2017-04-15T14:57:58.469Z,2,127489,17,255,26,00,5a,0f,ff,ff,13,81,ff,7f,ff,7f,ff,ff,ff,ff,ff,ff,ff,ff,ff,00,00,00,00,7f,7f" } ] diff --git a/test/pgns/127497.js b/test/pgns/127497.js index b449cfa..aa973fa 100644 --- a/test/pgns/127497.js +++ b/test/pgns/127497.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"prio":5,"pgn":127497,"dst":255,"src":57,"timestamp":"2020-03-31T02:34:18.529Z","fields":{"Instance":224,"Trip Fuel Used":9,"Fuel Rate, Average":-3100.2,"Instantaneous Fuel Economy":-0.1},"description":"Trip Parameters, Engine"}, + "expected": {"prio":5,"pgn":127497,"dst":255,"src":57,"timestamp":"2020-03-31T02:34:18.529Z","fields":{"Instance":224,"Trip Fuel Used":9,"Fuel Rate, Average":-3100.2,"Instantaneous Fuel Economy":-0.1,"Fuel Rate, Economy":null},"description":"Trip Parameters, Engine"}, "input": "2020-03-31T02:34:18.529Z,5,127497,57,255,9,e0,09,00,e6,86,ff,7f,ff,ff" }] diff --git a/test/pgns/127501.js b/test/pgns/127501.js index 4653888..ec150f7 100644 --- a/test/pgns/127501.js +++ b/test/pgns/127501.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.481Z","prio":3,"src":60,"dst":255,"pgn":127501,"description":"Binary Switch Bank Status","fields":{"Instance":1,"Indicator1":"Off"}}, + "expected": {"timestamp":"2016-02-28T19:57:02.481Z","prio":3,"src":60,"dst":255,"pgn":127501,"description":"Binary Switch Bank Status","fields":{"Instance":1,"Indicator1":"Off","Indicator10": null,"Indicator11": null,"Indicator12": null,"Indicator13": null,"Indicator14": null,"Indicator15": null,"Indicator16": null,"Indicator17": null,"Indicator18": null,"Indicator19": null,"Indicator2": null,"Indicator20": null,"Indicator21": null,"Indicator22": null,"Indicator23": null,"Indicator24": null,"Indicator25": null,"Indicator26": null,"Indicator27": null,"Indicator28": null,"Indicator3": null,"Indicator4": null,"Indicator5": null,"Indicator6": null,"Indicator7": null,"Indicator8": null,"Indicator9": null}}, "input": "2016-02-28T19:57:02.481Z,3,127501,60,255,8,01,fc,ff,ff,ff,ff,ff,ff" }] diff --git a/test/pgns/127505.js b/test/pgns/127505.js index cbe944e..6433472 100644 --- a/test/pgns/127505.js +++ b/test/pgns/127505.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":17,"dst":255,"pgn":127505,"description":"Fluid Level","fields":{"Instance":0,"Type":"Fuel","Level":56.264,"Capacity":49.0}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":17,"dst":255,"pgn":127505,"description":"Fluid Level","fields":{"Instance":0,"Type":"Fuel","Level":56.264,"Capacity":49.0,"Reserved1":null}}, "input": "2017-04-15T14:57:58.469Z,6,127505,17,255,8,00,f2,36,ea,01,00,00,ff" }] diff --git a/test/pgns/127506.js b/test/pgns/127506.js index 9d6fb20..120b08d 100644 --- a/test/pgns/127506.js +++ b/test/pgns/127506.js @@ -1,5 +1,5 @@ module.exports = [{ - "expected": {"timestamp":"2023-04-01T17:28:01.128Z","prio":2,"src":60,"dst":255,"pgn":127506,"description":"DC Detailed Status","fields":{"Instance":3,"State of Charge":100, "Time Remaining": "00:20:00"}}, + "expected": {"timestamp":"2023-04-01T17:28:01.128Z","prio":2,"src":60,"dst":255,"pgn":127506,"description":"DC Detailed Status","fields":{"Instance":3,"State of Charge":100, "Time Remaining": "00:20:00","DC Type":null,"Remaining capacity":null,"Ripple Voltage":null,"SID":null,"State of Health":null}}, "input": "2023-04-01T17:28:01.128Z,2,127506,60,255,11,ff,03,ff,64,ff,14,00,ff,ff,ff,ff" //"2016-02-28T19:57:02.829Z,6,127506,60,255,11,ff,03,ff,64,ff,ff,ff,ff,ff,ff,ff" }] diff --git a/test/pgns/127507.js b/test/pgns/127507.js index 3376c00..e9b130e 100644 --- a/test/pgns/127507.js +++ b/test/pgns/127507.js @@ -1,4 +1,4 @@ module.exports = [{ -"expected": {"timestamp":"2016-02-28T19:57:02.829Z","prio":6,"src":129,"dst":255,"pgn":127507,"description":"Charger Status","fields":{"Instance":114,"Battery Instance":6,"Operating State":"Disabled","Charge Mode":"Standalone","Enabled":"Off"}}, +"expected": {"timestamp":"2016-02-28T19:57:02.829Z","prio":6,"src":129,"dst":255,"pgn":127507,"description":"Charger Status","fields":{"Instance":114,"Battery Instance":6,"Operating State":"Disabled","Charge Mode":"Standalone","Enabled":"Off","Reserved1":null,"Equalization Pending":null,"Equalization Time Remaining":null}}, "input": "2016-02-28T19:57:02.829Z,6,127507,129,255,6,72,06,08,fc,ff,ff" }] diff --git a/test/pgns/127508.js b/test/pgns/127508.js index 174c432..a89033d 100644 --- a/test/pgns/127508.js +++ b/test/pgns/127508.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.473Z","prio":6,"src":17,"dst":255,"pgn":127508,"description":"Battery Status","fields":{"Instance":1,"Voltage":14.62,"SID":0}}, + "expected": {"timestamp":"2017-04-15T14:57:58.473Z","prio":6,"src":17,"dst":255,"pgn":127508,"description":"Battery Status","fields":{"Instance":1,"Voltage":14.62,"SID":0,"Current":null,"Temperature":null}}, "input": "2017-04-15T14:57:58.473Z,6,127508,17,255,8,01,b6,05,ff,7f,ff,ff,00" }] diff --git a/test/pgns/128259.js b/test/pgns/128259.js index db25f26..935256f 100644 --- a/test/pgns/128259.js +++ b/test/pgns/128259.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":2,"src":35,"dst":255,"pgn":128259,"description":"Speed","fields":{"SID":20,"Speed Water Referenced":0.00,"Speed Water Referenced Type":"Paddle wheel"}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":2,"src":35,"dst":255,"pgn":128259,"description":"Speed","fields":{"SID":20,"Speed Water Referenced":0.00,"Speed Water Referenced Type":"Paddle wheel","Reserved1":null,"Speed Direction":null,"Speed Ground Referenced":null}}, "input": "2017-04-15T14:57:58.469Z,2,128259,35,255,8,14,00,00,ff,ff,00,ff,ff" }] diff --git a/test/pgns/128267.js b/test/pgns/128267.js index a324cee..893caed 100644 --- a/test/pgns/128267.js +++ b/test/pgns/128267.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":3,"src":35,"dst":255,"pgn":128267,"description":"Water Depth","fields":{"SID":18,"Depth":4.46,"Offset":0.121}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":3,"src":35,"dst":255,"pgn":128267,"description":"Water Depth","fields":{"SID":18,"Depth":4.46,"Offset":0.121,"Range":null}}, "input": "2017-04-15T14:57:58.469Z,3,128267,35,255,8,12,be,01,00,00,79,00,ff" }] diff --git a/test/pgns/128275.js b/test/pgns/128275.js index 4e9e4b1..1a17a32 100644 --- a/test/pgns/128275.js +++ b/test/pgns/128275.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":35,"dst":255,"pgn":128275,"description":"Distance Log","fields":{"Log":0,"Trip Log":0}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":35,"dst":255,"pgn":128275,"description":"Distance Log","fields":{"Log":0,"Trip Log":0,"Time":null,"Date":null}}, "input": "2017-04-15T14:57:58.469Z,6,128275,35,255,14,ff,ff,ff,ff,ff,ff,00,00,00,00,00,00,00,00" }] diff --git a/test/pgns/129026.js b/test/pgns/129026.js index 40c5ffd..089e3fa 100644 --- a/test/pgns/129026.js +++ b/test/pgns/129026.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":3,"dst":255,"pgn":129026,"description":"COG & SOG, Rapid Update","fields":{"COG Reference":"True","COG":2.0961,"SOG":2.46}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":3,"dst":255,"pgn":129026,"description":"COG & SOG, Rapid Update","fields":{"COG Reference":"True","COG":2.0961,"SOG":2.46,"Reserved1":null,"Reserved2":null,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,2,129026,3,255,8,ff,fc,e1,51,f6,00,ff,ff" }] diff --git a/test/pgns/129029.js b/test/pgns/129029.js index 82116f7..032143b 100644 --- a/test/pgns/129029.js +++ b/test/pgns/129029.js @@ -1,10 +1,10 @@ module.exports = [ { - "expected": {"timestamp":"2017-04-15T14:57:58.470Z","prio":3,"src":3,"dst":255,"pgn":129029,"description":"GNSS Position Data","fields":{"SID":155,"Date":"2017.04.15", "Time": "14:57:56.89500","Latitude":39.0700875,"Longitude":-76.4640319,"GNSS type":"GPS+SBAS/WAAS","Method":"DGNSS fix","Integrity":"No integrity checking","Number of SVs":18,"HDOP":0.65,"Reference Stations": 0, "list":[]}}, + "expected": {"timestamp":"2017-04-15T14:57:58.470Z","prio":3,"src":3,"dst":255,"pgn":129029,"description":"GNSS Position Data","fields":{"SID":155,"Date":"2017.04.15", "Time": "14:57:56.89500","Latitude":39.0700875,"Longitude":-76.4640319,"GNSS type":"GPS+SBAS/WAAS","Method":"DGNSS fix","Integrity":"No integrity checking","Number of SVs":18,"HDOP":0.65,"Reference Stations": 0,"Reserved1":null,"Altitude":null,"Geoidal Separation":null,"PDOP":null, "list":[]}}, "input":"2017-04-15T14:57:58.470Z,3,129029,3,255,43,9b,77,43,36,f6,1c,20,00,2e,cf,33,60,0c,6c,05,ff,49,10,5d,ae,73,63,f5,ff,ff,ff,ff,ff,ff,ff,7f,23,fc,12,41,00,ff,7f,ff,ff,ff,7f,00" }, { - "expected": {"canId":234358051,"prio":3,"src":35,"dst":255,"pgn":129029,"fields":{"SID":126,"Date":"2020.03.09","Time":"17:47:47.80000","Latitude":42.4913166,"Longitude":-70.8850733,"Altitude":41.4,"GNSS type":"GPS+SBAS/WAAS","Method":"DGNSS fix","Integrity":"No integrity checking","Number of SVs":10,"HDOP":0.9,"PDOP":1.6,"Geoidal Separation":-30.9,"Reference Stations":0,"list":[{"Reference Station ID":15}]},"description":"GNSS Position Data"}, + "expected": {"canId":234358051,"prio":3,"src":35,"dst":255,"pgn":129029,"fields":{"SID":126,"Date":"2020.03.09","Time":"17:47:47.80000","Latitude":42.4913166,"Longitude":-70.8850733,"Altitude":41.4,"GNSS type":"GPS+SBAS/WAAS","Method":"DGNSS fix","Integrity":"No integrity checking","Number of SVs":10,"HDOP":0.9,"PDOP":1.6,"Geoidal Separation":-30.9,"Reference Stations":0,"Reserved1":null,"list":[{"Reference Station ID":15}]},"description":"GNSS Position Data"}, "format": 0, "input": ['can0 0DF80523 [8] C0 2B 7E 9A 47 70 F8 2F', 'can0 0DF80523 [8] C1 26 00 0C D1 EF 45 98', diff --git a/test/pgns/129038.js b/test/pgns/129038.js index d261b2b..36ae4bf 100644 --- a/test/pgns/129038.js +++ b/test/pgns/129038.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2019-04-15T15:12:21.553Z","prio":4,"pgn":129038,"src":43,"dst":255,"fields":{"Message ID":"Scheduled Class A position report","Repeat Indicator":"Initial","User ID":367306490,"Longitude":-76.5379949,"Latitude":39.241965,"Position Accuracy":"Low","RAIM":"not in use","Time Stamp":"22","COG":5.4297,"SOG":1.95,"Communication State":2257,"AIS Transceiver information":"Channel B VDL reception","Special Maneuver Indicator":"Not available","Reserved1":0,"Spare":0,"Reserved2":0},"description":"AIS Class A Position Report" }, + "expected": {"timestamp":"2019-04-15T15:12:21.553Z","prio":4,"pgn":129038,"src":43,"dst":255,"fields":{"Message ID":"Scheduled Class A position report","Repeat Indicator":"Initial","User ID":367306490,"Longitude":-76.5379949,"Latitude":39.241965,"Position Accuracy":"Low","RAIM":"not in use","Time Stamp":"22","COG":5.4297,"SOG":1.95,"Communication State":2257,"AIS Transceiver information":"Channel B VDL reception","Special Maneuver Indicator":"Not available","Reserved1":0,"Spare":0,"Reserved2":0,"Sequence ID":null,"Rate of Turn":null,"Rate of Turn":null,"Nav Status":null,"Heading":null},"description":"AIS Class A Position Report" }, "input": "2019-04-15T15:12:21.553Z,4,129038,43,255,28,01,fa,a6,e4,15,93,3a,61,d2,42,d9,63,17,58,19,d4,c3,00,d1,08,08,ff,ff,ff,7f,0f,00,ff" }] diff --git a/test/pgns/129039.js b/test/pgns/129039.js index ae101a8..2bab152 100644 --- a/test/pgns/129039.js +++ b/test/pgns/129039.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:59.409Z","prio":4,"src":43,"dst":255,"pgn":129039,"description":"AIS Class B Position Report","fields":{"Message ID":"Standard Class B position report","Repeat Indicator":"Initial","User ID":338184312,"Longitude":-76.4640032,"Latitude":39.0700267,"Position Accuracy":"High","RAIM":"in use","Time Stamp":"59","COG":2.1206,"SOG":2.46,"Communication State":393222,"AIS Transceiver information":"Own information not broadcast","Regional Application":0,"Regional Application B":0,"Unit type":"CS","Integrated Display":"No","DSC":"Yes","Band":"Entire marine band","Can handle Msg 22":"Yes","AIS mode":"Autonomous","AIS communication state":"ITDMA"}}, + "expected": {"timestamp":"2017-04-15T14:57:59.409Z","prio":4,"src":43,"dst":255,"pgn":129039,"description":"AIS Class B Position Report","fields":{"Message ID":"Standard Class B position report","Repeat Indicator":"Initial","User ID":338184312,"Longitude":-76.4640032,"Latitude":39.0700267,"Position Accuracy":"High","RAIM":"in use","Time Stamp":"59","COG":2.1206,"SOG":2.46,"Communication State":393222,"AIS Transceiver information":"Own information not broadcast","Regional Application":0,"Regional Application B":0,"Unit type":"CS","Integrated Display":"No","DSC":"Yes","Band":"Entire marine band","Can handle Msg 22":"Yes","AIS mode":"Autonomous","AIS communication state":"ITDMA","Reserved1":null,"Heading":null}}, "input": "2017-04-15T14:57:59.409Z,4,129039,43,255,27,12,78,48,28,14,e0,84,6c,d2,eb,9c,49,17,ef,d6,52,f6,00,06,00,26,ff,ff,00,74,ff,ff" }] diff --git a/test/pgns/129041.js b/test/pgns/129041.js index 4e6083b..a6ca4d4 100644 --- a/test/pgns/129041.js +++ b/test/pgns/129041.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2019-04-15T15:13:37.159Z","prio":4,"pgn":129041,"src":43,"dst":255,"fields":{"Message ID":"ATON report","Repeat Indicator":"Initial","User ID":993672312,"Longitude":-76.5295832,"Latitude":39.2160667,"Position Accuracy":"High","RAIM":"not in use","Time Stamp":"Manual input mode","AtoN Type":"Fixed beacon: port hand","Off Position Indicator":"No","Virtual AtoN Flag":"Yes","Assigned Mode Flag":"Autonomous and continuous","Spare":0,"Position Fixing Device Type":"Surveyed","Reserved1":0,"AtoN Status":0,"AIS Transceiver information":"Channel A VDL reception","Reserved2":0,"AtoN Name":"SC"},"description":"AIS Aids to Navigation (AtoN) Report"}, + "expected": {"timestamp":"2019-04-15T15:13:37.159Z","prio":4,"pgn":129041,"src":43,"dst":255,"fields":{"Message ID":"ATON report","Repeat Indicator":"Initial","User ID":993672312,"Longitude":-76.5295832,"Latitude":39.2160667,"Position Accuracy":"High","RAIM":"not in use","Time Stamp":"Manual input mode","AtoN Type":"Fixed beacon: port hand","Off Position Indicator":"No","Virtual AtoN Flag":"Yes","Assigned Mode Flag":"Autonomous and continuous","Spare":0,"Position Fixing Device Type":"Surveyed","Reserved1":0,"AtoN Status":0,"AIS Transceiver information":"Channel A VDL reception","Reserved2":0,"AtoN Name":"SC","Position Reference from True North Facing Edge":null,"Position Reference from Starboard Edge":null,"Length/Diameter":null,"Beam/Diameter":null},"description":"AIS Aids to Navigation (AtoN) Report"}, "input": "2019-04-15T15:13:37.159Z,4,129041,43,255,46,15,78,3c,3a,3b,28,83,62,d2,9b,e5,5f,17,f5,ff,ff,ff,ff,ff,ff,ff,ff,4d,0e,00,00,14,01,53,43,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20" }] diff --git a/test/pgns/129283.js b/test/pgns/129283.js index 1774d81..37c6e1f 100644 --- a/test/pgns/129283.js +++ b/test/pgns/129283.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":3,"src":3,"dst":255,"pgn":129283,"description":"Cross Track Error","fields":{"XTE mode":"Autonomous","Navigation Terminated":"No","XTE":-0.75}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":3,"src":3,"dst":255,"pgn":129283,"description":"Cross Track Error","fields":{"XTE mode":"Autonomous","Navigation Terminated":"No","XTE":-0.75,"Reserved1":null,"Reserved2":null,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,3,129283,3,255,8,ff,30,b5,ff,ff,ff,ff,ff" }] diff --git a/test/pgns/129284.js b/test/pgns/129284.js index a998bbb..4a6a8fb 100644 --- a/test/pgns/129284.js +++ b/test/pgns/129284.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":3,"src":3,"dst":255,"pgn":129284,"description":"Navigation Data","fields":{"SID":11,"Distance to Waypoint":3234.00,"Course/Bearing reference":"True","Perpendicular Crossed":"No","Arrival Circle Entered":"No","Calculation Type":"Great Circle", "ETA Time": "15:19:50","ETA Date":"2017.04.15","Bearing, Origin to Destination Waypoint":2.0961,"Bearing, Position to Destination Waypoint":2.0961,"Destination Waypoint Number":2,"Destination Latitude":39.0554743,"Destination Longitude":-76.4316303,"Waypoint Closing Velocity":2.46}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":3,"src":3,"dst":255,"pgn":129284,"description":"Navigation Data","fields":{"SID":11,"Distance to Waypoint":3234.00,"Course/Bearing reference":"True","Perpendicular Crossed":"No","Arrival Circle Entered":"No","Calculation Type":"Great Circle", "ETA Time": "15:19:50","ETA Date":"2017.04.15","Bearing, Origin to Destination Waypoint":2.0961,"Bearing, Position to Destination Waypoint":2.0961,"Destination Waypoint Number":2,"Destination Latitude":39.0554743,"Destination Longitude":-76.4316303,"Waypoint Closing Velocity":2.46,"Origin Waypoint Number":null}}, "input": "2017-04-15T14:57:58.468Z,3,129284,3,255,34,0b,48,ef,04,00,00,60,53,e5,20,77,43,e1,51,e1,51,ff,ff,ff,ff,02,00,00,00,77,64,47,17,71,75,71,d2,f6,00" }] diff --git a/test/pgns/129285.js b/test/pgns/129285.js index 6585d77..f01b0cb 100644 --- a/test/pgns/129285.js +++ b/test/pgns/129285.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"prio":6,"pgn":129285,"dst":255,"src":3,"timestamp":"2017-04-15T16:16:45.897Z","fields":{"Start RPS#":3,"nItems":3,"Database ID":0,"Route ID":0,"Supplementary Route/WP data available":"Off","Reserved1":0,"Route Name":"Route","list":[{"WP ID":3,"WP Name":"ORIGIN","WP Latitude":39.0525373,"WP Longitude":-76.4183194},{"WP ID":4,"WP Name":"Waypoint 168","WP Latitude":39.0598473,"WP Longitude":-76.2794236},{"WP ID":5,"WP Name":"Waypoint 245","WP Latitude":39.0190642,"WP Longitude":-76.2520773}]},"description":"Navigation - Route/WP Information"}, + "expected": {"prio":6,"pgn":129285,"dst":255,"src":3,"timestamp":"2017-04-15T16:16:45.897Z","fields":{"Start RPS#":3,"nItems":3,"Database ID":0,"Route ID":0,"Supplementary Route/WP data available":"Off","Reserved1":0,"Route Name":"Route","Reserved2":null,"Navigation direction in route":null,"list":[{"WP ID":3,"WP Name":"ORIGIN","WP Latitude":39.0525373,"WP Longitude":-76.4183194},{"WP ID":4,"WP Name":"Waypoint 168","WP Latitude":39.0598473,"WP Longitude":-76.2794236},{"WP ID":5,"WP Name":"Waypoint 245","WP Latitude":39.0190642,"WP Longitude":-76.2520773}]},"description":"Navigation - Route/WP Information"}, "input": "2017-04-15T16:16:45.897Z,6,129285,3,255,83,03,00,03,00,00,00,00,00,07,07,01,52,6f,75,74,65,ff,03,00,08,01,4f,52,49,47,49,4e,bd,f1,46,17,66,7d,73,d2,04,00,0e,01,57,61,79,70,6f,69,6e,74,20,31,36,38,49,0f,48,17,04,af,88,d2,05,00,0e,01,57,61,79,70,6f,69,6e,74,20,32,34,35,32,d6,41,17,3b,db,8c,d2" }] diff --git a/test/pgns/129291.js b/test/pgns/129291.js index fcb4134..1e24faf 100644 --- a/test/pgns/129291.js +++ b/test/pgns/129291.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:59.385Z","prio":3,"src":3,"dst":255,"pgn":129291,"description":"Set & Drift, Rapid Update","fields":{"Set Reference":"True","Set":2.0972,"Drift":2.45}}, + "expected": {"timestamp":"2017-04-15T14:57:59.385Z","prio":3,"src":3,"dst":255,"pgn":129291,"description":"Set & Drift, Rapid Update","fields":{"Set Reference":"True","Set":2.0972,"Drift":2.45,"Reserved1":null,"Reserved2":null,"SID":null}}, "input": "2017-04-15T14:57:59.385Z,3,129291,3,255,8,ff,fc,ec,51,f5,00,ff,ff" }] diff --git a/test/pgns/129539.js b/test/pgns/129539.js index 8de9175..ca9b4a0 100644 --- a/test/pgns/129539.js +++ b/test/pgns/129539.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:03.429Z","prio":6,"src":33,"dst":255,"pgn":129539,"description":"GNSS DOPs","fields":{"SID":199,"Desired Mode":"Auto","Actual Mode":"3D","HDOP":0.79,"VDOP":1.22}}, + "expected": {"timestamp":"2016-02-28T19:57:03.429Z","prio":6,"src":33,"dst":255,"pgn":129539,"description":"GNSS DOPs","fields":{"SID":199,"Desired Mode":"Auto","Actual Mode":"3D","HDOP":0.79,"VDOP":1.22,"Reserved1":null,"TDOP":null}}, "input": "2016-02-28T19:57:03.429Z,6,129539,33,255,8,c7,d3,4f,00,7a,00,ff,7f" }] diff --git a/test/pgns/129540.js b/test/pgns/129540.js index 0ee4ba6..006f2ba 100644 --- a/test/pgns/129540.js +++ b/test/pgns/129540.js @@ -1,8 +1,8 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":3,"dst":255,"pgn":129540,"description":"GNSS Sats in View","fields":{"SID":184,"Sats in View":18,"list":[{"PRN":3,"Elevation":0.5585,"Azimuth":5.3407,"SNR":31,"Range residuals":0,"Status":"Used+Diff"},{"PRN":4,"Elevation":1.0297,"Azimuth":3.002,"SNR":28,"Range residuals":0,"Status":"Used+Diff"},{"PRN":10,"Elevation":0.1047,"Azimuth":2.8972,"SNR":28,"Range residuals":0,"Status":"Used+Diff"},{"PRN":14,"Elevation":1.1519,"Azimuth":1.5359,"SNR":30,"Range residuals":0,"Status":"Used+Diff"},{"PRN":16,"Elevation":0.4014,"Azimuth":3.4383,"SNR":33,"Range residuals":0,"Status":"Used+Diff"},{"PRN":22,"Elevation":0.8029,"Azimuth":4.8346,"SNR":31,"Range residuals":0,"Status":"Used+Diff"},{"PRN":25,"Elevation":0.4538,"Azimuth":0.7679,"SNR":33,"Range residuals":0,"Status":"Used+Diff"},{"PRN":26,"Elevation":0.9076,"Azimuth":3.2463,"SNR":26,"Range residuals":0,"Status":"Used+Diff"},{"PRN":31,"Elevation":1.2217,"Azimuth":0.2269,"SNR":31,"Range residuals":0,"Status":"Used+Diff"},{"PRN":67,"Elevation":0.7505,"Azimuth":2.7751,"SNR":32,"Range residuals":0,"Status":"Used+Diff"},{"PRN":68,"Elevation":1.309,"Azimuth":5.2709,"SNR":34,"Range residuals":0,"Status":"Used+Diff"},{"PRN":69,"Elevation":0.4014,"Azimuth":5.7072,"SNR":26,"Range residuals":0,"Status":"Used+Diff"},{"PRN":77,"Elevation":0.5934,"Azimuth":0.6109,"SNR":29,"Range residuals":0,"Status":"Used+Diff"},{"PRN":78,"Elevation":1.2392,"Azimuth":5.2011,"SNR":27,"Range residuals":0,"Status":"Used+Diff"},{"PRN":79,"Elevation":0.6632,"Azimuth":4.2761,"SNR":35,"Range residuals":0,"Status":"Used+Diff"},{"PRN":46,"Elevation":0.6632,"Azimuth":3.6826,"SNR":30,"Range residuals":0,"Status":"Used+Diff"},{"PRN":48,"Elevation":0.2967,"Azimuth":4.311,"SNR":29,"Range residuals":0,"Status":"Used+Diff"},{"PRN":51,"Elevation":0.6109,"Azimuth":3.9095,"SNR":35,"Range residuals":0,"Status":"Used+Diff"}]}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":6,"src":3,"dst":255,"pgn":129540,"description":"GNSS Sats in View","fields":{"SID":184,"Sats in View":18,"Reserved1":null,"Range Residual Mode":null,"list":[{"PRN":3,"Elevation":0.5585,"Azimuth":5.3407,"SNR":31,"Range residuals":0,"Status":"Used+Diff"},{"PRN":4,"Elevation":1.0297,"Azimuth":3.002,"SNR":28,"Range residuals":0,"Status":"Used+Diff"},{"PRN":10,"Elevation":0.1047,"Azimuth":2.8972,"SNR":28,"Range residuals":0,"Status":"Used+Diff"},{"PRN":14,"Elevation":1.1519,"Azimuth":1.5359,"SNR":30,"Range residuals":0,"Status":"Used+Diff"},{"PRN":16,"Elevation":0.4014,"Azimuth":3.4383,"SNR":33,"Range residuals":0,"Status":"Used+Diff"},{"PRN":22,"Elevation":0.8029,"Azimuth":4.8346,"SNR":31,"Range residuals":0,"Status":"Used+Diff"},{"PRN":25,"Elevation":0.4538,"Azimuth":0.7679,"SNR":33,"Range residuals":0,"Status":"Used+Diff"},{"PRN":26,"Elevation":0.9076,"Azimuth":3.2463,"SNR":26,"Range residuals":0,"Status":"Used+Diff"},{"PRN":31,"Elevation":1.2217,"Azimuth":0.2269,"SNR":31,"Range residuals":0,"Status":"Used+Diff"},{"PRN":67,"Elevation":0.7505,"Azimuth":2.7751,"SNR":32,"Range residuals":0,"Status":"Used+Diff"},{"PRN":68,"Elevation":1.309,"Azimuth":5.2709,"SNR":34,"Range residuals":0,"Status":"Used+Diff"},{"PRN":69,"Elevation":0.4014,"Azimuth":5.7072,"SNR":26,"Range residuals":0,"Status":"Used+Diff"},{"PRN":77,"Elevation":0.5934,"Azimuth":0.6109,"SNR":29,"Range residuals":0,"Status":"Used+Diff"},{"PRN":78,"Elevation":1.2392,"Azimuth":5.2011,"SNR":27,"Range residuals":0,"Status":"Used+Diff"},{"PRN":79,"Elevation":0.6632,"Azimuth":4.2761,"SNR":35,"Range residuals":0,"Status":"Used+Diff"},{"PRN":46,"Elevation":0.6632,"Azimuth":3.6826,"SNR":30,"Range residuals":0,"Status":"Used+Diff"},{"PRN":48,"Elevation":0.2967,"Azimuth":4.311,"SNR":29,"Range residuals":0,"Status":"Used+Diff"},{"PRN":51,"Elevation":0.6109,"Azimuth":3.9095,"SNR":35,"Range residuals":0,"Status":"Used+Diff"}]}}, "input": "2017-04-15T14:57:58.469Z,6,129540,3,255,219,b8,ff,12,03,d1,15,9f,d0,1c,0c,00,00,00,00,f5,04,39,28,44,75,f0,0a,00,00,00,00,f5,0a,17,04,2c,71,f0,0a,00,00,00,00,f5,0e,ff,2c,ff,3b,b8,0b,00,00,00,00,f5,10,ae,0f,4f,86,e4,0c,00,00,00,00,f5,16,5d,1f,da,bc,1c,0c,00,00,00,00,f5,19,ba,11,ff,1d,e4,0c,00,00,00,00,f5,1a,74,23,cf,7e,28,0a,00,00,00,00,f5,1f,b9,2f,dd,08,1c,0c,00,00,00,00,f5,43,51,1d,67,6c,80,0c,00,00,00,00,f5,44,22,33,e5,cd,48,0d,00,00,00,00,f5,45,ae,0f,f0,de,28,0a,00,00,00,00,f5,4d,2e,17,dd,17,54,0b,00,00,00,00,f5,4e,68,30,2b,cb,8c,0a,00,00,00,00,f5,4f,e8,19,09,a7,ac,0d,00,00,00,00,f5,2e,e8,19,da,8f,b8,0b,00,00,00,00,f5,30,97,0b,66,a8,54,0b,00,00,00,00,f5,33,dd,17,b7,98,ac,0d,00,00,00,00,f5" }, { - "expected": {"prio":6,"pgn":129540,"dst":255,"src":1,"timestamp":"2020-08-16T09:00:00.364Z","fields":{"SID":82,"Range Residual Mode":2,"Sats in View":12,"list":[{"PRN":7,"Elevation":0.2443,"Azimuth":5.6199,"SNR":33,"Range residuals":0,"Status":"Used"},{"PRN":10,"Elevation":0.6632,"Azimuth":3.0543,"SNR":35,"Range residuals":0,"Status":"Used"},{"PRN":13,"Elevation":0.3141,"Azimuth":0.5934,"SNR":37,"Range residuals":0,"Status":"Used"},{"PRN":15,"Elevation":0.4363,"Azimuth":1.1693,"SNR":39,"Range residuals":0,"Status":"Used"},{"PRN":16,"Elevation":0.8028,"Azimuth":4.0142,"SNR":31,"Range residuals":0,"Status":"Used"},{"PRN":18,"Elevation":0.8203,"Azimuth":1.4311,"SNR":32,"Range residuals":0,"Status":"Used"},{"PRN":20,"Elevation":1.0471,"Azimuth":2.3038,"SNR":36,"Range residuals":0,"Status":"Used"},{"PRN":21,"Elevation":0.9599,"Azimuth":4.2935,"SNR":28,"Range residuals":0,"Status":"Used"},{"PRN":26,"Elevation":0.3316,"Azimuth":3.4557,"SNR":35,"Range residuals":0,"Status":"Used"},{"PRN":27,"Elevation":1.0471,"Azimuth":4.8869,"SNR":35,"Range residuals":0,"Status":"Used"},{"PRN":8,"Elevation":0.4886,"Azimuth":5.1661,"SNR":24,"Range residuals":0,"Status":"Used"},{"PRN":87,"Elevation":1.2217,"Azimuth":5.2359,"SNR":28,"Range residuals":0,"Status":"Used"},{"SNR":2.55,"Elevation": -0.0001}]},"description":"GNSS Sats in View"}, + "expected": {"prio":6,"pgn":129540,"dst":255,"src":1,"timestamp":"2020-08-16T09:00:00.364Z","fields":{"Reserved1":null,"SID":82,"Range Residual Mode":2,"Sats in View":12,"list":[{"PRN":7,"Elevation":0.2443,"Azimuth":5.6199,"SNR":33,"Range residuals":0,"Status":"Used"},{"PRN":10,"Elevation":0.6632,"Azimuth":3.0543,"SNR":35,"Range residuals":0,"Status":"Used"},{"PRN":13,"Elevation":0.3141,"Azimuth":0.5934,"SNR":37,"Range residuals":0,"Status":"Used"},{"PRN":15,"Elevation":0.4363,"Azimuth":1.1693,"SNR":39,"Range residuals":0,"Status":"Used"},{"PRN":16,"Elevation":0.8028,"Azimuth":4.0142,"SNR":31,"Range residuals":0,"Status":"Used"},{"PRN":18,"Elevation":0.8203,"Azimuth":1.4311,"SNR":32,"Range residuals":0,"Status":"Used"},{"PRN":20,"Elevation":1.0471,"Azimuth":2.3038,"SNR":36,"Range residuals":0,"Status":"Used"},{"PRN":21,"Elevation":0.9599,"Azimuth":4.2935,"SNR":28,"Range residuals":0,"Status":"Used"},{"PRN":26,"Elevation":0.3316,"Azimuth":3.4557,"SNR":35,"Range residuals":0,"Status":"Used"},{"PRN":27,"Elevation":1.0471,"Azimuth":4.8869,"SNR":35,"Range residuals":0,"Status":"Used"},{"PRN":8,"Elevation":0.4886,"Azimuth":5.1661,"SNR":24,"Range residuals":0,"Status":"Used"},{"PRN":87,"Elevation":1.2217,"Azimuth":5.2359,"SNR":28,"Range residuals":0,"Status":"Used"},{"SNR":2.55,"Elevation": -0.0001}]},"description":"GNSS Sats in View"}, "format": 0, "input": [ '2020-08-16T09:00:00.333Z,6,129540,1,255,8,20,93,52,fe,0c,07,8b,09', diff --git a/test/pgns/129793.js b/test/pgns/129793.js index efa286a..f342b6a 100644 --- a/test/pgns/129793.js +++ b/test/pgns/129793.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:58:00.590Z","prio":7,"src":43,"dst":255,"pgn":129793,"description":"AIS UTC and Date Report","fields":{"Message ID":"Base station report","Repeat Indicator":"Initial","User ID":3660611,"Longitude":-76.4541382,"Latitude":38.9789700,"Position Accuracy":"High","RAIM":"in use", "Position Time": "14:58:00","Communication State":82201,"AIS Transceiver information":"Channel A VDL reception","Position Date":"2017.04.15","Spare":0}}, + "expected": {"timestamp":"2017-04-15T14:58:00.590Z","prio":7,"src":43,"dst":255,"pgn":129793,"description":"AIS UTC and Date Report","fields":{"Message ID":"Base station report","Repeat Indicator":"Initial","User ID":3660611,"Longitude":-76.4541382,"Latitude":38.9789700,"Position Accuracy":"High","RAIM":"in use", "Position Time": "14:58:00","Communication State":82201,"AIS Transceiver information":"Channel A VDL reception","Position Date":"2017.04.15","Spare":0,"Reserved1":null,"Reserved2":null,"GNSS type":null}}, "input": "2017-04-15T14:58:00.590Z,7,129793,43,255,25,04,43,db,37,00,3a,06,6e,d2,04,b8,3b,17,ff,80,6f,1d,20,19,41,01,77,43,ff,00" }] diff --git a/test/pgns/129794.js b/test/pgns/129794.js index e245104..5a813c7 100644 --- a/test/pgns/129794.js +++ b/test/pgns/129794.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:58:37.235Z","prio":6,"src":43,"dst":255,"pgn":129794,"description":"AIS Class A Static and Voyage Related Data","fields":{"Message ID":"Static and voyage related data","Repeat Indicator":"Initial","User ID":367307850,"IMO number":0,"Callsign":"WDD9171","Name":"ATLANTIC COAST","Type of ship":"Tug","Length":30.0,"Beam":7.0,"Position reference from Starboard":0.0,"Position reference from Bow":9.0,"ETA Date":"2018.03.01", "ETA Time": "06:00:00","Draft":4.20,"Destination":"BALTIMORE","AIS version indicator":"ITU-R M.1371-1","GNSS type":"GPS","DTE":"Available","AIS Transceiver information":"Channel B VDL reception","Reserved1": 1}}, + "expected": {"timestamp":"2017-04-15T14:58:37.235Z","prio":6,"src":43,"dst":255,"pgn":129794,"description":"AIS Class A Static and Voyage Related Data","fields":{"Message ID":"Static and voyage related data","Repeat Indicator":"Initial","User ID":367307850,"IMO number":0,"Callsign":"WDD9171","Name":"ATLANTIC COAST","Type of ship":"Tug","Length":30.0,"Beam":7.0,"Position reference from Starboard":0.0,"Position reference from Bow":9.0,"ETA Date":"2018.03.01", "ETA Time": "06:00:00","Draft":4.20,"Destination":"BALTIMORE","AIS version indicator":"ITU-R M.1371-1","GNSS type":"GPS","DTE":"Available","AIS Transceiver information":"Channel B VDL reception","Reserved1": 1,"Reserved2":null}}, "input": "2017-04-15T14:58:37.235Z,6,129794,43,255,75,05,4a,ac,e4,15,00,00,00,00,57,44,44,39,31,37,31,41,54,4c,41,4e,54,49,43,20,43,4f,41,53,54,ff,ff,ff,ff,ff,ff,34,2c,01,46,00,00,00,5a,00,b7,44,00,e6,df,0c,a4,01,42,41,4c,54,49,4d,4f,52,45,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,84,e1" }] diff --git a/test/pgns/129809.js b/test/pgns/129809.js index 05186c1..18f0e61 100644 --- a/test/pgns/129809.js +++ b/test/pgns/129809.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2019-04-15T15:16:46.572Z","prio":6,"pgn":129809,"src":43,"dst":255,"fields":{"Message ID":"Static data report","Repeat Indicator":"Initial","User ID":338184312,"Name":"WILHELM","AIS Transceiver information":"Channel A VDL transmission","Reserved1":0},"description":"AIS Class B static data (msg 24 Part A)"}, + "expected": {"timestamp":"2019-04-15T15:16:46.572Z","prio":6,"pgn":129809,"src":43,"dst":255,"fields":{"Message ID":"Static data report","Repeat Indicator":"Initial","User ID":338184312,"Name":"WILHELM","AIS Transceiver information":"Channel A VDL transmission","Reserved1":0,"Sequence ID":null},"description":"AIS Class B static data (msg 24 Part A)"}, "input": "2019-04-15T15:16:46.572Z,6,129809,43,255,27,18,78,48,28,14,57,49,4c,48,45,4c,4d,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,02,ff" }] diff --git a/test/pgns/129810.js b/test/pgns/129810.js index 43bfdea..2d50be7 100644 --- a/test/pgns/129810.js +++ b/test/pgns/129810.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2023-07-22T13:41:17.102Z","prio":6,"pgn":129810,"src":43,"dst":255,"fields":{"Message ID":"Static data report","Repeat Indicator":"Initial","User ID":338254261,"Type of ship":"Pleasure","Vendor ID":"GARMIN","Callsign":"","Length":14,"Beam":27,"Position reference from Starboard":25,"Position reference from Bow":6,"Mothership User ID":338254262,"Reserved1":0,"Spare":0,"AIS Transceiver information":"Channel B VDL reception","Reserved2":0},"description":"AIS Class B static data (msg 24 Part B)"}, + "expected": {"timestamp":"2023-07-22T13:41:17.102Z","prio":6,"pgn":129810,"src":43,"dst":255,"fields":{"Message ID":"Static data report","Repeat Indicator":"Initial","User ID":338254261,"Type of ship":"Pleasure","Vendor ID":"GARMIN","Callsign":"","Length":14,"Beam":27,"Position reference from Starboard":25,"Position reference from Bow":6,"Mothership User ID":338254262,"Reserved1":0,"Spare":0,"AIS Transceiver information":"Channel B VDL reception","Reserved2":0,"Sequence ID":null},"description":"AIS Class B static data (msg 24 Part B)"}, "input":"2023-07-22T13:41:17.102Z,6,129810,43,255,35,18,b5,59,29,14,25,47,41,52,4d,49,4e,ff,40,40,40,40,40,40,40,8c,00,0e,01,fa,00,3c,00,b6,59,29,14,00,01,ff" }] diff --git a/test/pgns/130306.js b/test/pgns/130306.js index 60f246f..cca477a 100644 --- a/test/pgns/130306.js +++ b/test/pgns/130306.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":3,"dst":255,"pgn":130306,"description":"Wind Data","fields":{"Wind Speed":6.38,"Wind Angle":0.4014,"Reference":"Apparent"}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":2,"src":3,"dst":255,"pgn":130306,"description":"Wind Data","fields":{"Wind Speed":6.38,"Wind Angle":0.4014,"Reference":"Apparent","Reserved1":null,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,2,130306,3,255,8,ff,7e,02,ae,0f,fa,ff,ff" }] diff --git a/test/pgns/130310.js b/test/pgns/130310.js index 37fb6ad..30bc20d 100644 --- a/test/pgns/130310.js +++ b/test/pgns/130310.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.824Z","prio":5,"src":130,"dst":255,"pgn":130310,"description":"Environmental Parameters (obsolete)","fields":{"SID":4,"Outside Ambient Air Temperature":300.85,"Atmospheric Pressure":101000}}, + "expected": {"timestamp":"2016-02-28T19:57:02.824Z","prio":5,"src":130,"dst":255,"pgn":130310,"description":"Environmental Parameters (obsolete)","fields":{"SID":4,"Outside Ambient Air Temperature":300.85,"Atmospheric Pressure":101000,"Reserved1":null,"Water Temperature":null}}, "input": "2016-02-28T19:57:02.824Z,5,130310,130,255,8,04,ff,ff,85,75,f2,03,ff" }] diff --git a/test/pgns/130311.js b/test/pgns/130311.js index 5c51f48..b19a088 100644 --- a/test/pgns/130311.js +++ b/test/pgns/130311.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2023-07-20T19:01:57.251Z","prio":5,"src":35,"dst":255,"pgn":130311,"description":"Environmental Parameters","fields":{"SID":20,"Humidity": 56.068}}, + "expected": {"timestamp":"2023-07-20T19:01:57.251Z","prio":5,"src":35,"dst":255,"pgn":130311,"description":"Environmental Parameters","fields":{"SID":20,"Humidity": 56.068,"Atmospheric Pressure":null,"Humidity Source":null,"Temperature":null,"Temperature Source":null}}, "input": "2023-07-20T19:01:57.251Z,5,130311,35,255,8,14,ff,ff,ff,c1,36,ff,ff" }] diff --git a/test/pgns/130312.js b/test/pgns/130312.js index 0e118d6..bfbe2db 100644 --- a/test/pgns/130312.js +++ b/test/pgns/130312.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.473Z","prio":6,"src":45,"dst":255,"pgn":130312,"description":"Temperature","fields":{"SID":142,"Instance":0,"Source":"Engine Room Temperature","Actual Temperature":273.15}}, + "expected": {"timestamp":"2017-04-15T14:57:58.473Z","prio":6,"src":45,"dst":255,"pgn":130312,"description":"Temperature","fields":{"SID":142,"Instance":0,"Source":"Engine Room Temperature","Actual Temperature":273.15,"Reserved1":null,"Set Temperature":null}}, "input": "2017-04-15T14:57:58.473Z,6,130312,45,255,8,8e,00,03,b3,6a,ff,ff,ff" }] diff --git a/test/pgns/130313.js b/test/pgns/130313.js index 6da7590..95e3295 100644 --- a/test/pgns/130313.js +++ b/test/pgns/130313.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2023-07-20T19:07:54.802Z","prio":5,"src":130,"dst":255,"pgn":130313,"description":"Humidity","fields":{"SID":23,"Instance":0,"Source":"Outside","Actual Humidity":60.116,"Set Humidity": 78.068}}, + "expected": {"timestamp":"2023-07-20T19:07:54.802Z","prio":5,"src":130,"dst":255,"pgn":130313,"description":"Humidity","fields":{"SID":23,"Instance":0,"Source":"Outside","Actual Humidity":60.116,"Set Humidity": 78.068,"Reserved1":null}}, "input": "2023-07-20T19:07:54.802Z,5,130313,130,255,8,17,00,01,b5,3a,3d,4c,ff" }] diff --git a/test/pgns/130314.js b/test/pgns/130314.js index d45c5f5..e8fdda3 100644 --- a/test/pgns/130314.js +++ b/test/pgns/130314.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.825Z","prio":5,"src":88,"dst":255,"pgn":130314,"description":"Actual Pressure","fields":{"SID":100,"Instance":0,"Source":"Hydraulic","Pressure":93633}}, + "expected": {"timestamp":"2016-02-28T19:57:02.825Z","prio":5,"src":88,"dst":255,"pgn":130314,"description":"Actual Pressure","fields":{"SID":100,"Instance":0,"Source":"Hydraulic","Pressure":93633,"Reserved1":null}}, "input": "2016-02-28T19:57:02.825Z,5,130314,88,255,8,64,00,04,8a,49,0e,00,ff" }] diff --git a/test/pgns/130577.js b/test/pgns/130577.js index 689e4af..cdffb8b 100644 --- a/test/pgns/130577.js +++ b/test/pgns/130577.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":3,"src":3,"dst":255,"pgn":130577,"description":"Direction Data","fields":{"Data Mode":"Autonomous","COG Reference":"True","SID":156,"COG":2.0961,"SOG":2.46,"Set":2.0914,"Drift":2.45}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":3,"src":3,"dst":255,"pgn":130577,"description":"Direction Data","fields":{"Data Mode":"Autonomous","COG Reference":"True","SID":156,"COG":2.0961,"SOG":2.46,"Set":2.0914,"Drift":2.45,"Reserved1":null,"Heading":null,"Speed through Water":null}}, "input": "2017-04-15T14:57:58.468Z,3,130577,3,255,14,c0,9c,e1,51,f6,00,ff,ff,ff,ff,b2,51,f5,00" }] diff --git a/test/pgns/130820.js b/test/pgns/130820.js index 7f178c7..a527cfc 100644 --- a/test/pgns/130820.js +++ b/test/pgns/130820.js @@ -1,7 +1,7 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Power State","fields":{"Manufacturer Code":"Fusion Electronics","Industry Code":"Marine Industry","Message ID":"Power","A":128,"State":"On"}}, + "expected": {"timestamp":"2017-04-15T14:57:58.469Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Power State","fields":{"Manufacturer Code":"Fusion Electronics","Industry Code":"Marine Industry","Message ID":"Power","A":128,"State":"On","Reserved1":null}}, "input": "2017-04-15T14:57:58.469Z,7,130820,10,255,5,a3,99,20,80,01" },{ - "expected": {"prio":7,"pgn":130820,"dst":255,"src":11,"timestamp":"2023-03-30T18:28:03.510Z","fields":{"Manufacturer Code":"Fusion Electronics","Industry Code":"Marine Industry","Message ID":"Source","A":128,"Source ID":1,"Current Source ID":11,"D":1,"E":197,"Source":"FM"},"description":"Fusion: Source Name"}, + "expected": {"prio":7,"pgn":130820,"dst":255,"src":11,"timestamp":"2023-03-30T18:28:03.510Z","fields":{"Manufacturer Code":"Fusion Electronics","Industry Code":"Marine Industry","Message ID":"Source","A":128,"Source ID":1,"Current Source ID":11,"D":1,"E":197,"Source":"FM","Reserved1":null},"description":"Fusion: Source Name"}, "input": "2023-03-30T18:28:03.510Z,7,130820,11,255,12,a3,99,02,80,01,0b,01,c5,02,46,4d,00"} ] diff --git a/test/pgns/130821.js b/test/pgns/130821.js index 069b61a..39b52be 100644 --- a/test/pgns/130821.js +++ b/test/pgns/130821.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:04.816Z","prio":7,"src":8,"dst":255,"pgn":130821,"description":"Furuno: Unknown 130821","fields":{"Manufacturer Code":"Furuno","Industry Code":"Marine Industry","SID":19,"A":0,"B":207,"C":227,"D":54,"E":17,"F":0,"G":190,"H":160,"I":192}}, + "expected": {"timestamp":"2016-02-28T19:57:04.816Z","prio":7,"src":8,"dst":255,"pgn":130821,"description":"Furuno: Unknown 130821","fields":{"Manufacturer Code":"Furuno","Industry Code":"Marine Industry","SID":19,"A":0,"B":207,"C":227,"D":54,"E":17,"F":0,"G":190,"H":160,"I":192,"Reserved1":null}}, "input": "2016-02-28T19:57:04.816Z,7,130821,8,255,12,3f,9f,13,00,cf,e3,36,11,00,be,a0,c0" }] diff --git a/test/pgns/130824.js b/test/pgns/130824.js index 4e804cc..d7f9958 100644 --- a/test/pgns/130824.js +++ b/test/pgns/130824.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:03.931Z","prio":2,"src":24,"dst":255,"pgn":130824,"description":"Maretron: Annunciator","fields":{"Manufacturer Code":"Maretron","Industry Code":"Marine Industry","Field 4":0,"Field 5":0,"list":[]}}, + "expected": {"timestamp":"2016-02-28T19:57:03.931Z","prio":2,"src":24,"dst":255,"pgn":130824,"description":"Maretron: Annunciator","fields":{"Manufacturer Code":"Maretron","Industry Code":"Marine Industry","Field 4":0,"Field 5":0,"Reserved1":null,"list":[]}}, "input": "2016-02-28T19:57:03.931Z,2,130824,24,255,9,89,98,00,00,ff,ff,ff,ff,ff" }] diff --git a/test/pgns/130842.js b/test/pgns/130842.js index ba2a4c4..b81cef5 100644 --- a/test/pgns/130842.js +++ b/test/pgns/130842.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T15:00:51.300Z","prio":6,"src":43,"dst":255,"pgn":130842,"description":"Simnet: AIS Class B static data (msg 24 Part A)","fields":{"Manufacturer Code":"Simrad","Industry Code":"Marine Industry","Message ID":"Msg 24 Part A","Repeat Indicator":"Second retransmission","E":24,"User ID":338184312,"Name":"WILHELM"}}, + "expected": {"timestamp":"2017-04-15T15:00:51.300Z","prio":6,"src":43,"dst":255,"pgn":130842,"description":"Simnet: AIS Class B static data (msg 24 Part A)","fields":{"Manufacturer Code":"Simrad","Industry Code":"Marine Industry","Message ID":"Msg 24 Part A","Repeat Indicator":"Second retransmission","E":24,"User ID":338184312,"Name":"WILHELM", "D":null, "Reserved1": null}}, "input": "2017-04-15T15:00:51.300Z,6,130842,43,255,29,41,9f,80,ff,18,78,48,28,14,57,49,4c,48,45,4c,4d,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff" }] diff --git a/test/pgns/59392.js b/test/pgns/59392.js index e941351..8e24154 100644 --- a/test/pgns/59392.js +++ b/test/pgns/59392.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.825Z","prio":6,"src":60,"dst":41,"pgn":59392,"description":"ISO Acknowledgement","fields":{"Control":"NAK","PGN":126998, "Reserved1": 16777215}}, + "expected": {"timestamp":"2016-02-28T19:57:02.825Z","prio":6,"src":60,"dst":41,"pgn":59392,"description":"ISO Acknowledgement","fields":{"Control":"NAK","PGN":126998, "Reserved1": 16777215,"Group Function":null}}, "input": "2016-02-28T19:57:02.825Z,6,59392,60,41,8,01,ff,ff,ff,ff,16,f0,01" }] diff --git a/test/pgns/65280.js b/test/pgns/65280.js index e7b1987..8755fa1 100644 --- a/test/pgns/65280.js +++ b/test/pgns/65280.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.364Z","prio":7,"src":7,"dst":255,"pgn":65280,"description":"Furuno: Heave","fields":{ "Manufacturer Code": "Furuno","Industry Code":"Marine Industry","Heave": 0.018}}, + "expected": {"timestamp":"2016-02-28T19:57:02.364Z","prio":7,"src":7,"dst":255,"pgn":65280,"description":"Furuno: Heave","fields":{ "Manufacturer Code": "Furuno","Industry Code":"Marine Industry","Heave": 0.018,"Reserved1":null,"Reserved2":null}}, "input": "2016-02-28T19:57:02.364Z,7,65280,7,255,8,3f,9f,12,00,00,00,ff,ff" }] diff --git a/test/pgns/65359.js b/test/pgns/65359.js index 66e1182..39a5100 100644 --- a/test/pgns/65359.js +++ b/test/pgns/65359.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":7,"src":204,"dst":255,"pgn":65359,"description":"Seatalk: Pilot Heading","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Heading Magnetic":2.4600}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":7,"src":204,"dst":255,"pgn":65359,"description":"Seatalk: Pilot Heading","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Heading Magnetic":2.4600,"Heading True":null,"Reserved1":null,"Reserved2":null,"SID":null}}, "input": "2017-04-15T14:57:58.468Z,7,65359,204,255,8,3b,9f,ff,ff,ff,18,60,ff" }] diff --git a/test/pgns/65360.js b/test/pgns/65360.js index 5f441bd..00853b5 100644 --- a/test/pgns/65360.js +++ b/test/pgns/65360.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":7,"src":204,"dst":255,"pgn":65360,"description":"Seatalk: Pilot Locked Heading","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Target Heading Magnetic":2.4599}}, + "expected": {"timestamp":"2017-04-15T14:57:58.468Z","prio":7,"src":204,"dst":255,"pgn":65360,"description":"Seatalk: Pilot Locked Heading","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Target Heading Magnetic":2.4599,"Reserved1":null,"Reserved2":null,"SID":null,"SID":null,"Target Heading True":null}}, "input": "2017-04-15T14:57:58.468Z,7,65360,204,255,8,3b,9f,ff,ff,ff,17,60,ff" }] diff --git a/test/pgns/65379.js b/test/pgns/65379.js index a2be337..f95ca7c 100644 --- a/test/pgns/65379.js +++ b/test/pgns/65379.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2017-04-15T14:57:59.360Z","prio":7,"src":204,"dst":255,"pgn":65379,"description":"Seatalk: Pilot Mode","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Pilot Mode":129,"Sub Mode":1,"Pilot Mode Data":0,"Reserved2": 16777215}}, + "expected": {"timestamp":"2017-04-15T14:57:59.360Z","prio":7,"src":204,"dst":255,"pgn":65379,"description":"Seatalk: Pilot Mode","fields":{"Manufacturer Code":"Raymarine","Industry Code":"Marine Industry","Pilot Mode":129,"Sub Mode":1,"Pilot Mode Data":0,"Reserved2": 16777215,"Reserved1":null}}, "input": "2017-04-15T14:57:59.360Z,7,65379,204,255,8,3b,9f,81,01,00,ff,ff,ff" }] diff --git a/test/pgns/65408.js b/test/pgns/65408.js index b14cc1d..2fe8136 100644 --- a/test/pgns/65408.js +++ b/test/pgns/65408.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.828Z","prio":7,"src":36,"dst":255,"pgn":65408,"description":"Airmar: Depth Quality Factor","fields":{"Manufacturer Code":"Airmar","Industry Code":"Marine Industry","SID":22,"Depth Quality Factor":"Quality 100%"}}, + "expected": {"timestamp":"2016-02-28T19:57:02.828Z","prio":7,"src":36,"dst":255,"pgn":65408,"description":"Airmar: Depth Quality Factor","fields":{"Manufacturer Code":"Airmar","Industry Code":"Marine Industry","SID":22,"Depth Quality Factor":"Quality 100%","Reserved1":null,"Reserved2":null}}, "input": "2016-02-28T19:57:02.828Z,7,65408,36,255,8,87,98,16,fa,ff,ff,ff,ff" }] diff --git a/test/pgns/65410.js b/test/pgns/65410.js index 432e241..8793432 100644 --- a/test/pgns/65410.js +++ b/test/pgns/65410.js @@ -1,4 +1,4 @@ module.exports = [{ - "expected": {"timestamp":"2016-02-28T19:57:02.828Z","prio":7,"src":36,"dst":255,"pgn":65410,"description":"Airmar: Device Information","fields":{"Manufacturer Code":"Airmar","Industry Code":"Marine Industry","SID":46,"Internal Device Temperature":317.59,"Supply Voltage":12.30}}, + "expected": {"timestamp":"2016-02-28T19:57:02.828Z","prio":7,"src":36,"dst":255,"pgn":65410,"description":"Airmar: Device Information","fields":{"Manufacturer Code":"Airmar","Industry Code":"Marine Industry","SID":46,"Internal Device Temperature":317.59,"Supply Voltage":12.30,"Reserved1":null,"Reserved2":null}}, "input": "2016-02-28T19:57:02.828Z,7,65410,36,255,8,87,98,2e,0f,7c,ce,04,ff" }] diff --git a/test/test.js b/test/test.js index 432d418..775ccfd 100644 --- a/test/test.js +++ b/test/test.js @@ -41,7 +41,7 @@ describe('from pgn test data converts', function () { let format = typeof data.format !== 'undefined' ? data.format : 1 - var fromPgn = new FromPgn({format}) + var fromPgn = new FromPgn({format, returnNulls: true}) fromPgn.on('error', (pgn, error) => { console.error(`Error parsing ${pgn.pgn} ${error}`)