signalk-ais-navionics-converter 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -329,4 +329,6 @@ Issues and pull requests are welcome!
329
329
  - AIS message types for class A / B separated
330
330
  - AIS Websocket server added
331
331
  ### Version 1.0.4
332
- - minor bug corrections for unavailable ROT / Heading
332
+ - minor bug corrections for unavailable ROT / Heading
333
+ ### Version 1.0.5
334
+ - bug fixing Heading
package/ais-encoder.js CHANGED
@@ -183,7 +183,7 @@ computeAisSogCog(sogValue, sogUnits, cogValue, cogUnits, headingValue, headingUn
183
183
  if (headingUnits) {
184
184
  const u = headingUnits.toLowerCase();
185
185
  if (u.includes("rad")) {
186
- if (units === "rad" && value > 2 * Math.PI) {
186
+ if (headingValue > 2 * Math.PI) {
187
187
  // Wert ist definitiv falsch bwz. bei 8.91863247972741 genau gleich 511 Grad === unavailable
188
188
  headingInt = HEADING_UNAVALABLE;
189
189
  }else{
@@ -370,7 +370,7 @@ computeAisRot(rateValue, rateUnits) {
370
370
 
371
371
  return this.bitsToPayload(bits);
372
372
  } catch (error) {
373
- this.app.error('Error creating position report:', error);
373
+ this.app.error('Error creating position report type 1:', error);
374
374
  return null;
375
375
  }
376
376
  }
@@ -512,7 +512,7 @@ computeAisRot(rateValue, rateUnits) {
512
512
 
513
513
  return this.bitsToPayload(bits);
514
514
  } catch (err) {
515
- this.app.error("Error creating type 19:", err);
515
+ this.app.error("Error creating position report type 19", err);
516
516
  return null;
517
517
  }
518
518
  }
package/index.js CHANGED
@@ -334,6 +334,7 @@ module.exports = function(app) {
334
334
  app.debug(`VesselFinder UDP forwarding enabled: ${options.vesselFinderHost}:${options.vesselFinderPort}`);
335
335
  }
336
336
 
337
+
337
338
  function broadcastTCP(message) {
338
339
  tcpClients.forEach(client => {
339
340
  try {
@@ -342,6 +343,8 @@ module.exports = function(app) {
342
343
  app.error(`Error broadcasting to TCP client: ${err}`);
343
344
  }
344
345
  });
346
+ // Broadcast message to SignalK TCP server on port 10110
347
+ // app.emit('nmea0183out', message)
345
348
  }
346
349
 
347
350
  function broadcastWebSocket(message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-ais-navionics-converter",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "SignalK plugin to convert AIS data to NMEA 0183 sentences to TCP clients (e.g. Navionics boating app, OpenCpn) and optional to vesselfinder.com",
5
5
  "main": "index.js",
6
6
  "keywords": [