UNPKG

signalk-to-stalk

Version:

Signal K server plugin and read-only WebApp converting navigation data to SeaTalk1 with coherent settings, waypoint, units, lights, diagnostics, and calibration advice

13 lines (12 loc) 416 B
'use strict' const { encodeCoordinate, toDatagram } = require('../stalk') module.exports = () => ({ datagram: '0x51', title: '0x51 Longitude', keys: ['navigation.position'], f(position) { if (!position || !Number.isFinite(position.longitude)) return undefined const [degrees, low, high] = encodeCoordinate(position.longitude, 180, true) return toDatagram([0x51, 0x02, degrees, low, high]) } })