mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:57:07 +00:00
Check for invalid speed values in Hydronav header.
Related to #206. If this is indeed what is causing the alerts, we will change the logic so that it simply logs (or ignores) invalid speeds rather than throwing.
This commit is contained in:
@@ -97,6 +97,9 @@ function parse (buffer) {
|
||||
// (we convert to metres per second)
|
||||
(buf, ctx) => {
|
||||
ctx.speed = Number(buf.subarray(s+80, s+80+6).toString('ascii'));
|
||||
if (isNaN(ctx.speed)) {
|
||||
throw NavHeaderError("Unparseable speed value: "+buf.subarray(s+80, s+80+6).toString('ascii'), buf);
|
||||
}
|
||||
const units = buf.subarray(s+86, s+86+2).toString('ascii');
|
||||
switch (units.toUpperCase()) {
|
||||
case "KT":
|
||||
|
||||
Reference in New Issue
Block a user