You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Canboat's analyser says it sees 2 items: 2021-11-18-13:12:35.467 7 6 255 129285 Navigation - Route/WP Information: Start RPS# = Unknown; nItems = 2; Database ID = Unknown; Route ID = Unknown; Navigation direction in route = Unknown; Supplementary Route/WP data available = 1; Route Name = ; WP ID 1 = 0; WP Name 1 = ; WP Latitude 1 = Unknown; WP Longitude 1 = Unknown; WP ID 2 = 1; WP Name 2 = MOB AIS SART-9727773; WP Latitude 2 = 52.4601828; WP Longitude 2 = 5.0445865
Canboatjs says it finds 3 items, of which the 3rd seems to be a misread of the stuffing 0xff packets: canboatjs:fromPgn parsed pgn {"canId":502859014,"prio":7,"src":6,"dst":255,"pgn":129285,"timestamp":"2022-01-11T20:10:37.492Z","input":[],"fields":{"nItems":2,"Supplementary Route/WP data available":1,"Reserved1":"14","Route Name":"\u0000","Reserved2":"131","list":[{"WP ID":0,"WP Name":"\u0000"},{"WP ID":1,"WP Name":"MOB AIS SART-9727773","WP Latitude":52.4601828,"WP Longitude":5.0445865},{"WP Name":"","WP Latitude":0.0000255}]},"description":"Navigation - Route/WP Information"} +0ms
If I remove the overwrite of the packet.size, it works fine: canboatjs:fromPgn parsed pgn {"canId":502859014,"prio":7,"src":6,"dst":255,"pgn":129285,"timestamp":"2022-01-11T20:11:24.837Z","input":[],"fields":{"nItems":2,"Supplementary Route/WP data available":1,"Reserved1":"14","Route Name":"\u0000","Reserved2":"131","list":[{"WP ID":0,"WP Name":"\u0000"},{"WP ID":1,"WP Name":"MOB AIS SART-9727773","WP Latitude":52.4601828,"WP Longitude":5.0445865}]},"description":"Navigation - Route/WP Information"} +1ms
So I'm wondering why the given (and correct) packet.size is not honoured and used for the buffer...
Changing to: var newSize = packet.size
makes it work as expected.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While investigating why canboat and canboatjs are treating a MOB pgn Route/Navigation route differently I noticed this:
canboatjs/lib/fromPgn.js
Line 147 in f541d1b
Observe the different behaviour.
Here's a full 129285 packet coming from my MFD:
Canboat's analyser says it sees 2 items:
2021-11-18-13:12:35.467 7 6 255 129285 Navigation - Route/WP Information: Start RPS# = Unknown; nItems = 2; Database ID = Unknown; Route ID = Unknown; Navigation direction in route = Unknown; Supplementary Route/WP data available = 1; Route Name = ; WP ID 1 = 0; WP Name 1 = ; WP Latitude 1 = Unknown; WP Longitude 1 = Unknown; WP ID 2 = 1; WP Name 2 = MOB AIS SART-9727773; WP Latitude 2 = 52.4601828; WP Longitude 2 = 5.0445865
Canboatjs says it finds 3 items, of which the 3rd seems to be a misread of the stuffing 0xff packets:
canboatjs:fromPgn parsed pgn {"canId":502859014,"prio":7,"src":6,"dst":255,"pgn":129285,"timestamp":"2022-01-11T20:10:37.492Z","input":[],"fields":{"nItems":2,"Supplementary Route/WP data available":1,"Reserved1":"14","Route Name":"\u0000","Reserved2":"131","list":[{"WP ID":0,"WP Name":"\u0000"},{"WP ID":1,"WP Name":"MOB AIS SART-9727773","WP Latitude":52.4601828,"WP Longitude":5.0445865},{"WP Name":"","WP Latitude":0.0000255}]},"description":"Navigation - Route/WP Information"} +0ms
If I remove the overwrite of the packet.size, it works fine:
canboatjs:fromPgn parsed pgn {"canId":502859014,"prio":7,"src":6,"dst":255,"pgn":129285,"timestamp":"2022-01-11T20:11:24.837Z","input":[],"fields":{"nItems":2,"Supplementary Route/WP data available":1,"Reserved1":"14","Route Name":"\u0000","Reserved2":"131","list":[{"WP ID":0,"WP Name":"\u0000"},{"WP ID":1,"WP Name":"MOB AIS SART-9727773","WP Latitude":52.4601828,"WP Longitude":5.0445865}]},"description":"Navigation - Route/WP Information"} +1ms
So I'm wondering why the given (and correct) packet.size is not honoured and used for the buffer...
Changing to:
var newSize = packet.size
makes it work as expected.
Beta Was this translation helpful? Give feedback.
All reactions