UNPKG

@canboat/canboatjs

Version:

Native javascript version of canboat

40 lines 1.44 kB
"use strict"; /** * Copyright 2025 Scott Bender (scott@scottbender.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.YdDevice = void 0; const n2kDevice_1 = require("./n2kDevice"); class YdDevice extends n2kDevice_1.N2kDevice { yd; app; constructor(yd, options) { super(options, 'canboatjs:yddevice'); this.yd = yd; this.app = options.app; const analyzerOutEvent = options.analyzerOutEvent || 'N2KAnalyzerOut'; this.app.on(analyzerOutEvent, this.n2kMessage.bind(this)); } sendPGN(pgn, src = undefined) { pgn.src = src || this.address; const ppgn = pgn; //FIXME?? ppgn.ydFullFormat = true; ppgn.forceSend = true; this.debug('Sending PGN %j', pgn); this.yd.sendPGN(pgn, true); } } exports.YdDevice = YdDevice; //# sourceMappingURL=yddevice.js.map