@canboat/canboatjs 3.0.2 → 3.2.2
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/.github/workflows/publish.yml +18 -9
- package/.github/workflows/test.yml +2 -2
- package/.github/workflows/test_canboat_changes.yml +91 -0
- package/.husky/pre-commit +4 -0
- package/.mocharc.js +7 -0
- package/.prettierrc.json +5 -0
- package/README.md +5 -14
- package/dist/actisense-serial.d.ts +17 -0
- package/dist/actisense-serial.d.ts.map +1 -0
- package/dist/actisense-serial.js +569 -0
- package/dist/actisense-serial.js.map +1 -0
- package/dist/bin/actisense-file.d.ts +3 -0
- package/dist/bin/actisense-file.d.ts.map +1 -0
- package/dist/bin/actisense-file.js +49 -0
- package/dist/bin/actisense-file.js.map +1 -0
- package/dist/bin/actisense-n2k-tcp.d.ts +3 -0
- package/dist/bin/actisense-n2k-tcp.d.ts.map +1 -0
- package/dist/bin/actisense-n2k-tcp.js +46 -0
- package/dist/bin/actisense-n2k-tcp.js.map +1 -0
- package/dist/bin/actisense-serialjs.d.ts +3 -0
- package/dist/bin/actisense-serialjs.d.ts.map +1 -0
- package/dist/bin/actisense-serialjs.js +51 -0
- package/dist/bin/actisense-serialjs.js.map +1 -0
- package/dist/bin/analyzerjs.d.ts +3 -0
- package/dist/bin/analyzerjs.d.ts.map +1 -0
- package/dist/bin/analyzerjs.js +61 -0
- package/dist/bin/analyzerjs.js.map +1 -0
- package/dist/bin/candumpjs.d.ts +3 -0
- package/dist/bin/candumpjs.d.ts.map +1 -0
- package/dist/bin/candumpjs.js +73 -0
- package/dist/bin/candumpjs.js.map +1 -0
- package/dist/bin/cansend.d.ts +3 -0
- package/dist/bin/cansend.d.ts.map +1 -0
- package/dist/bin/cansend.js +123 -0
- package/dist/bin/cansend.js.map +1 -0
- package/dist/bin/ikonvert-serial.d.ts +3 -0
- package/dist/bin/ikonvert-serial.d.ts.map +1 -0
- package/dist/bin/ikonvert-serial.js +36 -0
- package/dist/bin/ikonvert-serial.js.map +1 -0
- package/dist/bin/to-pgn.d.ts +3 -0
- package/dist/bin/to-pgn.d.ts.map +1 -0
- package/dist/bin/to-pgn.js +57 -0
- package/dist/bin/to-pgn.js.map +1 -0
- package/dist/canId.d.ts +21 -0
- package/dist/canId.d.ts.map +1 -0
- package/dist/canId.js +66 -0
- package/dist/canId.js.map +1 -0
- package/dist/canId.test.d.ts +2 -0
- package/dist/canId.test.d.ts.map +1 -0
- package/dist/canId.test.js +58 -0
- package/dist/canId.test.js.map +1 -0
- package/dist/canbus.d.ts +17 -0
- package/dist/canbus.d.ts.map +1 -0
- package/dist/canbus.js +261 -0
- package/dist/canbus.js.map +1 -0
- package/dist/candevice.d.ts +23 -0
- package/dist/candevice.d.ts.map +1 -0
- package/dist/candevice.js +36 -0
- package/dist/candevice.js.map +1 -0
- package/dist/codes.d.ts +2 -0
- package/dist/codes.d.ts.map +1 -0
- package/dist/codes.js +24 -0
- package/dist/codes.js.map +1 -0
- package/dist/discovery.d.ts +17 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +119 -0
- package/dist/discovery.js.map +1 -0
- package/dist/fromPgn.d.ts +51 -0
- package/dist/fromPgn.d.ts.map +1 -0
- package/dist/fromPgn.js +989 -0
- package/dist/fromPgn.js.map +1 -0
- package/dist/fromPgnStream.d.ts +17 -0
- package/dist/fromPgnStream.d.ts.map +1 -0
- package/dist/fromPgnStream.js +47 -0
- package/dist/fromPgnStream.js.map +1 -0
- package/dist/ikonvert.d.ts +17 -0
- package/dist/ikonvert.d.ts.map +1 -0
- package/dist/ikonvert.js +224 -0
- package/dist/ikonvert.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/n2k-actisense.d.ts +24 -0
- package/dist/n2k-actisense.d.ts.map +1 -0
- package/dist/n2k-actisense.js +126 -0
- package/dist/n2k-actisense.js.map +1 -0
- package/dist/n2k-actisense.test.d.ts +2 -0
- package/dist/n2k-actisense.test.d.ts.map +1 -0
- package/dist/n2k-actisense.test.js +49 -0
- package/dist/n2k-actisense.test.js.map +1 -0
- package/dist/n2kDevice.d.ts +44 -0
- package/dist/n2kDevice.d.ts.map +1 -0
- package/dist/n2kDevice.js +436 -0
- package/dist/n2kDevice.js.map +1 -0
- package/dist/pgns.d.ts +22 -0
- package/dist/pgns.d.ts.map +1 -0
- package/dist/pgns.js +157 -0
- package/dist/pgns.js.map +1 -0
- package/dist/pgns.test.d.ts +2 -0
- package/dist/pgns.test.d.ts.map +1 -0
- package/dist/pgns.test.js +14 -0
- package/dist/pgns.test.js.map +1 -0
- package/dist/simpleCan.d.ts +17 -0
- package/dist/simpleCan.d.ts.map +1 -0
- package/dist/simpleCan.js +125 -0
- package/dist/simpleCan.js.map +1 -0
- package/dist/stringMsg.d.ts +33 -0
- package/dist/stringMsg.d.ts.map +1 -0
- package/dist/stringMsg.js +359 -0
- package/dist/stringMsg.js.map +1 -0
- package/dist/stringMsg.test.d.ts +2 -0
- package/dist/stringMsg.test.d.ts.map +1 -0
- package/dist/stringMsg.test.js +244 -0
- package/dist/stringMsg.test.js.map +1 -0
- package/dist/toPgn.d.ts +34 -0
- package/dist/toPgn.d.ts.map +1 -0
- package/dist/toPgn.js +500 -0
- package/dist/toPgn.js.map +1 -0
- package/dist/utilities.d.ts +28 -0
- package/dist/utilities.d.ts.map +1 -0
- package/dist/utilities.js +159 -0
- package/dist/utilities.js.map +1 -0
- package/dist/utilities.test.d.ts +2 -0
- package/dist/utilities.test.d.ts.map +1 -0
- package/dist/utilities.test.js +9 -0
- package/dist/utilities.test.js.map +1 -0
- package/dist/venus-mqtt.d.ts +11 -0
- package/dist/venus-mqtt.d.ts.map +1 -0
- package/dist/venus-mqtt.js +100 -0
- package/dist/venus-mqtt.js.map +1 -0
- package/dist/venus.d.ts +11 -0
- package/dist/venus.d.ts.map +1 -0
- package/dist/venus.js +71 -0
- package/dist/venus.js.map +1 -0
- package/dist/w2k01.d.ts +17 -0
- package/dist/w2k01.d.ts.map +1 -0
- package/dist/w2k01.js +119 -0
- package/dist/w2k01.js.map +1 -0
- package/dist/yddevice.d.ts +25 -0
- package/dist/yddevice.d.ts.map +1 -0
- package/dist/yddevice.js +43 -0
- package/dist/yddevice.js.map +1 -0
- package/dist/ydgw02.d.ts +17 -0
- package/dist/ydgw02.d.ts.map +1 -0
- package/dist/ydgw02.js +163 -0
- package/dist/ydgw02.js.map +1 -0
- package/dist/ydvr.d.ts +17 -0
- package/dist/ydvr.d.ts.map +1 -0
- package/dist/ydvr.js +120 -0
- package/dist/ydvr.js.map +1 -0
- package/eslint.config.js +58 -0
- package/jest.config.js +5 -0
- package/lib/actisense-serial.ts +644 -0
- package/lib/bin/actisense-file.ts +53 -0
- package/lib/bin/actisense-n2k-tcp.ts +50 -0
- package/lib/bin/actisense-serialjs.ts +55 -0
- package/{bin/analyzerjs → lib/bin/analyzerjs.ts} +16 -15
- package/{bin/candumpjs → lib/bin/candumpjs.ts} +19 -20
- package/lib/bin/cansend.ts +131 -0
- package/lib/bin/ikonvert-serial.ts +44 -0
- package/{bin/to-pgn → lib/bin/to-pgn.ts} +23 -17
- package/lib/bin/ydvr-file +33 -0
- package/lib/canId.test.js +35 -15
- package/lib/canId.ts +84 -0
- package/lib/canbus.ts +293 -0
- package/lib/candevice.ts +41 -0
- package/lib/codes.ts +21 -0
- package/lib/{discovery.js → discovery.ts} +32 -30
- package/lib/fromPgn.ts +1207 -0
- package/lib/{fromPgnStream.js → fromPgnStream.ts} +17 -12
- package/lib/{ikonvert.js → ikonvert.ts} +99 -94
- package/lib/index.ts +48 -0
- package/lib/n2k-actisense.test.js +31 -32
- package/lib/n2k-actisense.ts +152 -0
- package/lib/n2kDevice.ts +516 -0
- package/lib/pgns.test.ts +12 -0
- package/lib/pgns.ts +191 -0
- package/lib/simpleCan.ts +140 -0
- package/lib/stringMsg.test.js +58 -41
- package/lib/stringMsg.ts +464 -0
- package/lib/toPgn.ts +597 -0
- package/lib/utilities.ts +169 -0
- package/lib/venus-mqtt.js +69 -73
- package/lib/venus.js +8 -8
- package/lib/w2k01.ts +142 -0
- package/lib/{yddevice.js → yddevice.ts} +18 -16
- package/lib/{ydgw02.js → ydgw02.ts} +58 -51
- package/lib/ydvr.js +65 -147
- package/package.json +54 -18
- package/tsconfig.json +19 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/CHANGELOG.md +0 -101
- package/bin/actisense-file +0 -47
- package/bin/actisense-n2k-tcp +0 -45
- package/bin/actisense-serialjs +0 -52
- package/bin/candumpanalyzerjs +0 -29
- package/bin/cansend +0 -130
- package/bin/ikonvert-serial +0 -50
- package/bin/ydgw-analyzerjs +0 -36
- package/bin/ydvr-file +0 -33
- package/index.js +0 -53
- package/ios_canboat.js/main.js +0 -2
- package/ios_canboat.js/main.js.LICENSE.txt +0 -17
- package/ios_canboat.js/main.js.map +0 -1
- package/lib/canId.js +0 -64
- package/lib/canbus.js +0 -278
- package/lib/candevice.js +0 -51
- package/lib/codes.js +0 -69
- package/lib/codes.test.js +0 -17
- package/lib/codesMfgs.json +0 -166
- package/lib/fromPgn.js +0 -1027
- package/lib/n2k-actisense.js +0 -108
- package/lib/n2kDevice.js +0 -390
- package/lib/pgns.js +0 -196
- package/lib/pgns.test.js +0 -13
- package/lib/serial.js +0 -647
- package/lib/simpleCan.js +0 -105
- package/lib/stringMsg.js +0 -339
- package/lib/toPgn.js +0 -518
- package/lib/utilities.js +0 -111
- package/lib/w2k01.js +0 -129
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canId.test.d.ts","sourceRoot":"","sources":["../lib/canId.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { encodeCanId, parseCanId, parseEncode } = require('./canId');
|
|
3
|
+
/* globals describe test expect */
|
|
4
|
+
describe('parseCanId', () => {
|
|
5
|
+
test('Return object with canId broken into properties', () => {
|
|
6
|
+
expect(parseCanId(0x18eeff01)).toEqual({
|
|
7
|
+
canId: 0x18eeff01,
|
|
8
|
+
dst: 255,
|
|
9
|
+
src: 1,
|
|
10
|
+
pgn: 60928,
|
|
11
|
+
prio: 6
|
|
12
|
+
});
|
|
13
|
+
expect(parseCanId(0xcf004ee)).toEqual({
|
|
14
|
+
canId: 0xcf004ee,
|
|
15
|
+
dst: 255,
|
|
16
|
+
src: 0xee,
|
|
17
|
+
pgn: 0xf004,
|
|
18
|
+
prio: 0xc >> 2
|
|
19
|
+
});
|
|
20
|
+
expect(parseCanId(0x18ea2301)).toEqual({
|
|
21
|
+
canId: 0x18ea2301,
|
|
22
|
+
dst: 35,
|
|
23
|
+
src: 0x01,
|
|
24
|
+
pgn: 0xea00,
|
|
25
|
+
prio: 6
|
|
26
|
+
});
|
|
27
|
+
expect(parseCanId(0x09f8017f)).toEqual({
|
|
28
|
+
canId: 0x09f8017f,
|
|
29
|
+
dst: 255,
|
|
30
|
+
src: 127,
|
|
31
|
+
pgn: 129025,
|
|
32
|
+
prio: 2
|
|
33
|
+
});
|
|
34
|
+
expect(parseCanId(0x0df8057f)).toEqual({
|
|
35
|
+
canId: 0x0df8057f,
|
|
36
|
+
dst: 255,
|
|
37
|
+
src: 127,
|
|
38
|
+
pgn: 129029,
|
|
39
|
+
prio: 3
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('encodeCanId', () => {
|
|
44
|
+
test('Return canId number from object', () => {
|
|
45
|
+
expect(encodeCanId({ src: 1, pgn: 60928, prio: 6, dst: 255 }).toString(2)).toBe((0x18eeff01).toString(2));
|
|
46
|
+
expect(encodeCanId({ src: 238, pgn: 61444, prio: 3 })).toBe(0xcf004ee);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('parseEncode', () => {
|
|
50
|
+
test('Return exactly same number after parse and encode', () => {
|
|
51
|
+
expect(parseEncode(0x18eeff01)).toBe(0x18eeff01);
|
|
52
|
+
expect(parseEncode(0xcf004ee)).toBe(0xcf004ee);
|
|
53
|
+
expect(parseEncode(0x18ea2301)).toBe(0x18ea2301);
|
|
54
|
+
expect(parseEncode(0x09f8017f)).toBe(0x09f8017f);
|
|
55
|
+
expect(parseEncode(0x0df8057f)).toBe(0x0df8057f);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=canId.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canId.test.js","sourceRoot":"","sources":["../lib/canId.test.js"],"names":[],"mappings":";AAAA,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAEnE,kCAAkC;AAElC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,UAAU;YACjB,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,CAAC;SACR,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;YACpC,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,IAAI;YACT,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,GAAG,IAAI,CAAC;SACf,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,UAAU;YACjB,GAAG,EAAE,EAAE;YACP,GAAG,EAAE,IAAI;YACT,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,CAAC;SACR,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,U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AC,UAAU,CAAC,CAAA;QAChD,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAChD,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/canbus.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018 Scott Bender (scott@scottbender.net)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function CanbusStream(this: any, options: any): any;
|
|
17
|
+
//# sourceMappingURL=canbus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canbus.d.ts","sourceRoot":"","sources":["../lib/canbus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,OAiFnD"}
|
package/dist/canbus.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2018 Scott Bender (scott@scottbender.net)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.CanbusStream = CanbusStream;
|
|
22
|
+
const utilities_1 = require("./utilities");
|
|
23
|
+
const stream_1 = require("stream");
|
|
24
|
+
const toPgn_1 = require("./toPgn");
|
|
25
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
26
|
+
const candevice_1 = require("./candevice");
|
|
27
|
+
const utilities_2 = require("./utilities");
|
|
28
|
+
const canId_1 = require("./canId");
|
|
29
|
+
const stringMsg_1 = require("./stringMsg");
|
|
30
|
+
const util_1 = __importDefault(require("util"));
|
|
31
|
+
function CanbusStream(options) {
|
|
32
|
+
if (this === undefined) {
|
|
33
|
+
return new CanbusStream(options);
|
|
34
|
+
}
|
|
35
|
+
this.debug = (0, utilities_1.createDebug)('canboatjs:canbus', options);
|
|
36
|
+
stream_1.Transform.call(this, {
|
|
37
|
+
objectMode: true
|
|
38
|
+
});
|
|
39
|
+
this.plainText = false;
|
|
40
|
+
this.options = options;
|
|
41
|
+
this.start();
|
|
42
|
+
this.setProviderStatus =
|
|
43
|
+
options.app && options.app.setProviderStatus
|
|
44
|
+
? (msg) => {
|
|
45
|
+
options.app.setProviderStatus(options.providerId, msg);
|
|
46
|
+
}
|
|
47
|
+
: () => { };
|
|
48
|
+
this.setProviderError =
|
|
49
|
+
options.app && options.app.setProviderError
|
|
50
|
+
? (msg) => {
|
|
51
|
+
options.app.setProviderError(options.providerId, msg);
|
|
52
|
+
}
|
|
53
|
+
: () => { };
|
|
54
|
+
if (options.fromStdIn) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
59
|
+
this.socketcan = require('socketcan');
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
console.error(err);
|
|
63
|
+
const msg = 'unable to load native socketcan interface';
|
|
64
|
+
console.error(msg);
|
|
65
|
+
}
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
67
|
+
const that = this;
|
|
68
|
+
if (options.app) {
|
|
69
|
+
options.app.on(options.outEvent || 'nmea2000out', (msg) => {
|
|
70
|
+
that.sendPGN(msg);
|
|
71
|
+
});
|
|
72
|
+
options.app.on(options.jsonOutEvent || 'nmea2000JsonOut', (msg) => {
|
|
73
|
+
that.sendPGN(msg);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (this.connect() == false) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const noDataReceivedTimeout = typeof options.noDataReceivedTimeout !== 'undefined'
|
|
80
|
+
? options.noDataReceivedTimeout
|
|
81
|
+
: -1;
|
|
82
|
+
if (noDataReceivedTimeout > 0) {
|
|
83
|
+
this.noDataInterval = setInterval(() => {
|
|
84
|
+
if (this.channel &&
|
|
85
|
+
this.lastDataReceived &&
|
|
86
|
+
Date.now() - this.lastDataReceived > noDataReceivedTimeout * 1000) {
|
|
87
|
+
const channel = this.channel;
|
|
88
|
+
delete this.channel;
|
|
89
|
+
try {
|
|
90
|
+
channel.stop();
|
|
91
|
+
}
|
|
92
|
+
catch (_error) { }
|
|
93
|
+
this.setProviderError('No data received, retrying...');
|
|
94
|
+
if (this.options.app) {
|
|
95
|
+
console.error('No data received, retrying...');
|
|
96
|
+
}
|
|
97
|
+
this.connect();
|
|
98
|
+
}
|
|
99
|
+
}, noDataReceivedTimeout * 1000);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
CanbusStream.prototype.connect = function () {
|
|
103
|
+
const canDevice = this.options.canDevice || 'can0';
|
|
104
|
+
try {
|
|
105
|
+
if (this.socketcan === undefined) {
|
|
106
|
+
this.setProviderError('unable to load native socketcan interface');
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
110
|
+
const that = this;
|
|
111
|
+
this.channel = this.socketcan.createRawChannelWithOptions(canDevice, {
|
|
112
|
+
non_block_send: true
|
|
113
|
+
});
|
|
114
|
+
this.channel.addListener('onStopped', () => {
|
|
115
|
+
if (this.channel) {
|
|
116
|
+
// stoped by us?
|
|
117
|
+
delete this.channel;
|
|
118
|
+
this.setProviderError('Stopped, Retrying...');
|
|
119
|
+
if (this.options.app) {
|
|
120
|
+
console.error('socketcan stopped, retrying...');
|
|
121
|
+
}
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
this.setProviderError('Reconnecting...');
|
|
124
|
+
this.connect();
|
|
125
|
+
}, 2000);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
this.channel.addListener('onMessage', (msg) => {
|
|
129
|
+
const pgn = (0, canId_1.parseCanId)(msg.id);
|
|
130
|
+
if (this.noDataInterval) {
|
|
131
|
+
this.lastDataReceived = Date.now();
|
|
132
|
+
}
|
|
133
|
+
//always send address claims through
|
|
134
|
+
if (pgn.pgn != 60928 &&
|
|
135
|
+
that.candevice &&
|
|
136
|
+
that.candevice.cansend &&
|
|
137
|
+
pgn.src == that.candevice.address) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const timestamp = new Date().toISOString();
|
|
141
|
+
if (that.plainText) {
|
|
142
|
+
this.push((0, utilities_2.binToActisense)(pgn, timestamp, msg.data, msg.data.length));
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
that.push({ pgn, length: msg.data.length, data: msg.data });
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
this.channel.start();
|
|
149
|
+
this.setProviderStatus('Connected to socketcan');
|
|
150
|
+
this.candevice = new candevice_1.CanDevice(this, this.options);
|
|
151
|
+
this.candevice.start();
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
console.error(`unable to open canbus ${canDevice}: ${e}`);
|
|
156
|
+
console.error(e.stack);
|
|
157
|
+
this.setProviderError(e.message);
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
util_1.default.inherits(CanbusStream, stream_1.Transform);
|
|
162
|
+
CanbusStream.prototype.start = function () { };
|
|
163
|
+
CanbusStream.prototype.sendPGN = function (msg, force) {
|
|
164
|
+
if (this.candevice) {
|
|
165
|
+
//if ( !this.candevice.cansend && (_.isString(msg) || msg.pgn !== 59904) ) {
|
|
166
|
+
if (!this.candevice.cansend && force !== true) {
|
|
167
|
+
//we have not completed address claim yet
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
this.debug('sending %j', msg);
|
|
171
|
+
if (this.options.app) {
|
|
172
|
+
this.options.app.emit('connectionwrite', {
|
|
173
|
+
providerId: this.options.providerId
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const src = msg.pgn === 59904 || msg.forceSrc ? msg.src : this.candevice.address;
|
|
177
|
+
if (lodash_1.default.isString(msg)) {
|
|
178
|
+
const split = msg.split(',');
|
|
179
|
+
split[3] = src;
|
|
180
|
+
msg = split.join(',');
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
msg.src = src;
|
|
184
|
+
if (lodash_1.default.isUndefined(msg.prio)) {
|
|
185
|
+
msg.prio = 3;
|
|
186
|
+
}
|
|
187
|
+
if (lodash_1.default.isUndefined(msg.dst)) {
|
|
188
|
+
msg.dst = 255;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (this.socketCanWriter) {
|
|
192
|
+
if (lodash_1.default.isString(msg)) {
|
|
193
|
+
this.socketCanWriter.stdin.write(msg + '\n');
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
const str = (0, stringMsg_1.toActisenseSerialFormat)(msg.pgn, (0, toPgn_1.toPgn)(msg), msg.dst, msg.src);
|
|
197
|
+
this.socketCanWriter.stdin.write(str + '\n');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else if (this.channel) {
|
|
201
|
+
let canid;
|
|
202
|
+
let buffer;
|
|
203
|
+
let pgn;
|
|
204
|
+
if (lodash_1.default.isObject(msg)) {
|
|
205
|
+
canid = (0, canId_1.encodeCanId)(msg);
|
|
206
|
+
buffer = (0, toPgn_1.toPgn)(msg);
|
|
207
|
+
pgn = msg;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
pgn = (0, stringMsg_1.parseActisense)(msg);
|
|
211
|
+
canid = (0, canId_1.encodeCanId)(pgn);
|
|
212
|
+
buffer = pgn.data;
|
|
213
|
+
}
|
|
214
|
+
if (this.debug.enabled) {
|
|
215
|
+
const str = (0, stringMsg_1.toActisenseSerialFormat)(pgn.pgn, buffer, pgn.dst, pgn.src);
|
|
216
|
+
this.debug(str);
|
|
217
|
+
}
|
|
218
|
+
if (buffer === undefined) {
|
|
219
|
+
this.debug("can't convert %j", msg);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
//seems as though 126720 should always be encoded this way
|
|
223
|
+
if (buffer.length > 8 || pgn.pgn == 126720) {
|
|
224
|
+
const pgns = (0, utilities_2.getPlainPGNs)(buffer);
|
|
225
|
+
pgns.forEach((pbuffer) => {
|
|
226
|
+
this.channel.send({ id: canid, ext: true, data: pbuffer });
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
this.channel.send({ id: canid, ext: true, data: buffer });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
CanbusStream.prototype._transform = function (chunk, encoding, done) {
|
|
236
|
+
done();
|
|
237
|
+
};
|
|
238
|
+
CanbusStream.prototype.end = function () {
|
|
239
|
+
if (this.channel) {
|
|
240
|
+
const channel = this.channel;
|
|
241
|
+
delete this.channel;
|
|
242
|
+
channel.stop();
|
|
243
|
+
}
|
|
244
|
+
if (this.noDataInterval) {
|
|
245
|
+
clearInterval(this.noDataInterval);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
CanbusStream.prototype.pipe = function (pipeTo) {
|
|
249
|
+
if (!pipeTo.fromPgn) {
|
|
250
|
+
this.plainText = true;
|
|
251
|
+
}
|
|
252
|
+
/*
|
|
253
|
+
pipeTo.fromPgn.on('pgn', (pgn) => {
|
|
254
|
+
if ( this.candevice ) {
|
|
255
|
+
this.candevice.n2kMessage(pgn)
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
*/
|
|
259
|
+
return CanbusStream.super_.prototype.pipe.call(this, pipeTo);
|
|
260
|
+
};
|
|
261
|
+
//# sourceMappingURL=canbus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canbus.js","sourceRoot":"","sources":["../lib/canbus.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAaH,oCAiFC;AA3FD,2CAAyC;AACzC,mCAAkC;AAClC,mCAA+B;AAC/B,oDAAsB;AACtB,2CAAuC;AACvC,2CAA0D;AAC1D,mCAAwD;AACxD,2CAAqE;AACrE,gDAAuB;AAEvB,SAAgB,YAAY,CAAY,OAAY;IAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAK,YAAoB,CAAC,OAAO,CAAC,CAAA;IAC3C,CAAC;IAED,IAAI,CAAC,KAAK,GAAG,IAAA,uBAAW,EAAC,kBAAkB,EAAE,OAAO,CAAC,CAAA;IAErD,kBAAS,CAAC,IAAI,CAAC,IAAI,EAAE;QACnB,UAAU,EAAE,IAA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cAAc,EAAE,CAAC;QACxB,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACpC,CAAC;AACH,CAAC,CAAA;AAED,YAAY,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,MAAW;IACjD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;IACvB,CAAC;IACD;;;;;;MAME;IACF,OAAQ,YAAoB,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AACvE,CAAC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018 Scott Bender (scott@scottbender.net) and Jouni Hartikainen (jouni.hartikainen@iki.fi)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { PGN } from '@canboat/ts-pgns';
|
|
17
|
+
import { N2kDevice } from './n2kDevice';
|
|
18
|
+
export declare class CanDevice extends N2kDevice {
|
|
19
|
+
canbus: any;
|
|
20
|
+
constructor(canbus: any, options: any);
|
|
21
|
+
sendPGN(pgn: PGN, src?: number | undefined): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=candevice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candevice.d.ts","sourceRoot":"","sources":["../lib/candevice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,qBAAa,SAAU,SAAQ,SAAS;IACtC,MAAM,EAAE,GAAG,CAAA;gBAEC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IAYrC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,MAAM,GAAG,SAAqB;CAKtD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2018 Scott Bender (scott@scottbender.net) and Jouni Hartikainen (jouni.hartikainen@iki.fi)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CanDevice = void 0;
|
|
19
|
+
const n2kDevice_1 = require("./n2kDevice");
|
|
20
|
+
class CanDevice extends n2kDevice_1.N2kDevice {
|
|
21
|
+
canbus;
|
|
22
|
+
constructor(canbus, options) {
|
|
23
|
+
super(options, 'canboatjs:candevice');
|
|
24
|
+
this.canbus = canbus;
|
|
25
|
+
if (options.app) {
|
|
26
|
+
options.app.on(options.analyzerOutEvent || 'N2KAnalyzerOut', this.n2kMessage.bind(this));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
sendPGN(pgn, src = undefined) {
|
|
30
|
+
pgn.src = src || this.address;
|
|
31
|
+
this.debug('Sending PGN %j', pgn);
|
|
32
|
+
this.canbus.sendPGN(pgn, true);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.CanDevice = CanDevice;
|
|
36
|
+
//# sourceMappingURL=candevice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candevice.js","sourceRoot":"","sources":["../lib/candevice.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,2CAAuC;AAGvC,MAAa,SAAU,SAAQ,qBAAS;IACtC,MAAM,CAAK;IAEX,YAAY,MAAW,EAAE,OAAY;QACnC,KAAK,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QAEpB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,EAAE,CACZ,OAAO,CAAC,gBAAgB,IAAI,gBAAgB,EAC5C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAC3B,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAQ,EAAE,MAA0B,SAAS;QACnD,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;QACjC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AApBD,8BAoBC"}
|
package/dist/codes.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../lib/codes.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,mBAAmB,UAI/B,CAAA"}
|
package/dist/codes.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.defaultTransmitPGNs = void 0;
|
|
19
|
+
exports.defaultTransmitPGNs = [
|
|
20
|
+
126992, 128267, 129794, 129038, 129041, 127505, 127506, 127508, 129026,
|
|
21
|
+
129025, 129029, 127250, 130306, 126720, 127489, 127488, 130311, 130312,
|
|
22
|
+
127257, 128259, 127502
|
|
23
|
+
];
|
|
24
|
+
//# sourceMappingURL=codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../lib/codes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEW,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IACtE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IACtE,MAAM,EAAE,MAAM,EAAE,MAAM;CACvB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019 Scott Bender <scott@scottbender.net>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function discover(app: any): void;
|
|
17
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../lib/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,QA+FhC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.discover = discover;
|
|
22
|
+
const utilities_1 = require("./utilities");
|
|
23
|
+
const stringMsg_1 = require("./stringMsg");
|
|
24
|
+
const dgram_1 = __importDefault(require("dgram"));
|
|
25
|
+
const debug = (0, utilities_1.createDebug)('canboatjs:discovery');
|
|
26
|
+
function discover(app) {
|
|
27
|
+
if (app.config.settings.pipedProviders) {
|
|
28
|
+
const exists = app.config.settings.pipedProviders.find((provider) => {
|
|
29
|
+
return (provider.pipeElements &&
|
|
30
|
+
provider.pipeElements.length === 1 &&
|
|
31
|
+
provider.pipeElements[0].type == 'providers/simple' &&
|
|
32
|
+
provider.pipeElements[0].options &&
|
|
33
|
+
provider.pipeElements[0].options.type === 'NMEA2000' &&
|
|
34
|
+
provider.pipeElements[0].options.subOptions.type ===
|
|
35
|
+
'ydwg02-udp-canboatjs' &&
|
|
36
|
+
provider.pipeElements[0].options.subOptions.port === '2002');
|
|
37
|
+
});
|
|
38
|
+
if (!exists) {
|
|
39
|
+
const socket = dgram_1.default.createSocket('udp4');
|
|
40
|
+
socket.on('message', (buffer, _remote) => {
|
|
41
|
+
const msg = buffer.toString('utf8');
|
|
42
|
+
if ((0, stringMsg_1.isYDRAW)(msg)) {
|
|
43
|
+
socket.close();
|
|
44
|
+
app.emit('discovered', {
|
|
45
|
+
id: 'YDGW-02-UDP',
|
|
46
|
+
pipeElements: [
|
|
47
|
+
{
|
|
48
|
+
type: 'providers/simple',
|
|
49
|
+
options: {
|
|
50
|
+
logging: false,
|
|
51
|
+
type: 'NMEA2000',
|
|
52
|
+
subOptions: {
|
|
53
|
+
type: 'ydwg02-udp-canboatjs',
|
|
54
|
+
port: '2002'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
socket.on('error', (error) => {
|
|
63
|
+
debug(error);
|
|
64
|
+
});
|
|
65
|
+
socket.on('close', () => {
|
|
66
|
+
debug('close');
|
|
67
|
+
});
|
|
68
|
+
debug('looking for YDGW over UDP');
|
|
69
|
+
try {
|
|
70
|
+
socket.bind(2002);
|
|
71
|
+
}
|
|
72
|
+
catch (ex) {
|
|
73
|
+
debug(ex);
|
|
74
|
+
}
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
if (socket) {
|
|
77
|
+
socket.close();
|
|
78
|
+
}
|
|
79
|
+
}, 5000);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/*
|
|
83
|
+
if ( app.config.settings.pipedProviders ) {
|
|
84
|
+
const exists = app.config.settings.pipedProviders.find(provider => {
|
|
85
|
+
return provider.pipeElements
|
|
86
|
+
&& provider.pipeElements.length === 1
|
|
87
|
+
&& provider.pipeElements[0].type == 'providers/simple'
|
|
88
|
+
&& provider.pipeElements[0].options
|
|
89
|
+
&& provider.pipeElements[0].options.type === 'NMEA2000'
|
|
90
|
+
&& provider.pipeElements[0].options.subOptions.host === '192.168.88.99'
|
|
91
|
+
&& provider.pipeElements[0].options.subOptions.port === '1457'
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
if ( !exists )
|
|
95
|
+
{
|
|
96
|
+
setTimeout(() =>
|
|
97
|
+
app.emit('discovered', {
|
|
98
|
+
id: 'TestDiscovered',
|
|
99
|
+
pipeElements: [
|
|
100
|
+
{
|
|
101
|
+
"type": "providers/simple",
|
|
102
|
+
"options": {
|
|
103
|
+
"logging": false,
|
|
104
|
+
"type": "NMEA2000",
|
|
105
|
+
"subOptions": {
|
|
106
|
+
"type": "ydwg02-canboatjs",
|
|
107
|
+
"host": "192.168.88.99",
|
|
108
|
+
"port": "1457"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}),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