@kb1rma/libcomm14cux-ts 0.1.0 → 0.2.0-beta.6
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/dist/decoders/faultCodes.d.ts +9 -3
- package/dist/decoders/faultCodes.d.ts.map +1 -1
- package/dist/decoders/faultCodes.js +6 -1
- package/dist/decoders/faultCodes.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/decoders/faultCodes.ts +14 -3
- package/src/version.ts +1 -1
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
declare const FAULT_BITS: readonly [readonly [0, 0, "romChecksumFailure"], readonly [0, 1, "lambdaSensorOdd"], readonly [0, 2, "lambdaSensorEven"], readonly [0, 4, "misfireOddBank"], readonly [0, 5, "misfireEvenBank"], readonly [0, 6, "airflowMeter"], readonly [0, 7, "tuneResistorOutOfRange"], readonly [1, 0, "injectorOddBank"], readonly [1, 2, "injectorEvenBank"], readonly [1, 3, "coolantTempSensor"], readonly [1, 4, "throttlePot"], readonly [1, 5, "throttlePotHiMafLo"], readonly [1, 6, "throttlePotLoMafHi"], readonly [1, 7, "purgeValveLeak"], readonly [2, 1, "mixtureTooLean"], readonly [2, 3, "intakeAirLeak"], readonly [3, 0, "lowFuelPressure"], readonly [3, 4, "idleValveStepperMotor"], readonly [3, 6, "roadSpeedSensor"], readonly [3, 7, "neutralSwitch"], readonly [4, 4, "lowFuelPressureOrAirLeak"], readonly [4, 5, "fuelTempSensor"], readonly [5, 6, "batteryDisconnected"], readonly [5, 7, "ramChecksumFailure"]];
|
|
1
|
+
declare const FAULT_BITS: readonly [readonly [0, 0, "romChecksumFailure"], readonly [0, 1, "lambdaSensorOdd"], readonly [0, 2, "lambdaSensorEven"], readonly [0, 3, "misfireGeneral"], readonly [0, 4, "misfireOddBank"], readonly [0, 5, "misfireEvenBank"], readonly [0, 6, "airflowMeter"], readonly [0, 7, "tuneResistorOutOfRange"], readonly [1, 0, "injectorOddBank"], readonly [1, 2, "injectorEvenBank"], readonly [1, 3, "coolantTempSensor"], readonly [1, 4, "throttlePot"], readonly [1, 5, "throttlePotHiMafLo"], readonly [1, 6, "throttlePotLoMafHi"], readonly [1, 7, "purgeValveLeak"], readonly [2, 1, "mixtureTooLean"], readonly [2, 3, "intakeAirLeak"], readonly [3, 0, "lowFuelPressure"], readonly [3, 4, "idleValveStepperMotor"], readonly [3, 6, "roadSpeedSensor"], readonly [3, 7, "neutralSwitch"], readonly [4, 4, "lowFuelPressureOrAirLeak"], readonly [4, 5, "fuelTempSensor"], readonly [5, 6, "batteryDisconnected"], readonly [5, 7, "ramChecksumFailure"]];
|
|
2
2
|
/**
|
|
3
3
|
* Name of a fault flag in {@link FaultCodes}, taken from the field names of
|
|
4
|
-
* the C `c14cux_faultcodes` struct.
|
|
4
|
+
* the C `c14cux_faultcodes` struct. `misfireGeneral` has no C field.
|
|
5
5
|
*/
|
|
6
6
|
export type FaultCodeName = (typeof FAULT_BITS)[number][2];
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Fault code flags (`c14cux_faultcodes`); `true` means the fault is set.
|
|
9
|
+
*
|
|
10
|
+
* `misfireGeneral` (fault code 25, bit 3 of 0x0049) is not in the C struct.
|
|
11
|
+
* The firmware disassembly shows that only builds before R3360 set it, so it
|
|
12
|
+
* is not expected to be set on later firmware.
|
|
13
|
+
*/
|
|
8
14
|
export type FaultCodes = Record<FaultCodeName, boolean>;
|
|
9
15
|
/** Number of bytes in the fault code block at 0x0049. */
|
|
10
16
|
export declare const FAULT_CODE_BLOCK_SIZE = 6;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faultCodes.d.ts","sourceRoot":"","sources":["../../src/decoders/faultCodes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"faultCodes.d.ts","sourceRoot":"","sources":["../../src/decoders/faultCodes.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,UAAU,y6BA6BN,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAExD,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAQ9D"}
|
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
// Copyright (C) Colin Bourassa. Licensed under the GNU GPL v3.
|
|
4
4
|
// Ported to TypeScript and modified for comm14cux-ts, 2026.
|
|
5
5
|
// [byte offset from 0x0049, bit (0 = LSB), name]. Spare bits are omitted.
|
|
6
|
-
// Names follow the field names of `c14cux_faultcodes
|
|
6
|
+
// Names follow the field names of `c14cux_faultcodes`, except `misfireGeneral`,
|
|
7
|
+
// which has no C field.
|
|
7
8
|
const FAULT_BITS = [
|
|
8
9
|
[0, 0, 'romChecksumFailure'],
|
|
9
10
|
[0, 1, 'lambdaSensorOdd'],
|
|
10
11
|
[0, 2, 'lambdaSensorEven'],
|
|
12
|
+
// Fault code 25. libcomm14cux treats this bit as spare, but the firmware
|
|
13
|
+
// disassembly (ignitionInt.asm, faults.asm) sets it on a misfire in builds
|
|
14
|
+
// before R3360. R3360 and later never set it.
|
|
15
|
+
[0, 3, 'misfireGeneral'],
|
|
11
16
|
[0, 4, 'misfireOddBank'],
|
|
12
17
|
[0, 5, 'misfireEvenBank'],
|
|
13
18
|
[0, 6, 'airflowMeter'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faultCodes.js","sourceRoot":"","sources":["../../src/decoders/faultCodes.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,4EAA4E;AAC5E,+DAA+D;AAC/D,4DAA4D;AAE5D,0EAA0E;A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B,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACzB,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC;IACvB,CAAC,CAAC,EAAE,CAAC,EAAE,0BAA0B,CAAC;IAClC,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACxB,CAAC,CAAC,EAAE,CAAC,EAAE,qBAAqB,CAAC;IAC7B,CAAC,CAAC,EAAE,CAAC,EAAE,oBAAoB,CAAC;CACpB,CAAC;AAiBX,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAiB;IAChD,MAAM,KAAK,GAAG,EAAgB,CAAC;IAE/B,KAAK,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// SPDX-License-Identifier: GPL-3.0-only\n// Derived from libcomm14cux (https://github.com/colinbourassa/libcomm14cux)\n// Copyright (C) Colin Bourassa. Licensed under the GNU GPL v3.\n// Ported to TypeScript and modified for comm14cux-ts, 2026.\n\n// [byte offset from 0x0049, bit (0 = LSB), name]. Spare bits are omitted.\n// Names follow the field names of `c14cux_faultcodes`, except `misfireGeneral`,\n// which has no C field.\nconst FAULT_BITS = [\n [0, 0, 'romChecksumFailure'],\n [0, 1, 'lambdaSensorOdd'],\n [0, 2, 'lambdaSensorEven'],\n // Fault code 25. libcomm14cux treats this bit as spare, but the firmware\n // disassembly (ignitionInt.asm, faults.asm) sets it on a misfire in builds\n // before R3360. R3360 and later never set it.\n [0, 3, 'misfireGeneral'],\n [0, 4, 'misfireOddBank'],\n [0, 5, 'misfireEvenBank'],\n [0, 6, 'airflowMeter'],\n [0, 7, 'tuneResistorOutOfRange'],\n [1, 0, 'injectorOddBank'],\n [1, 2, 'injectorEvenBank'],\n [1, 3, 'coolantTempSensor'],\n [1, 4, 'throttlePot'],\n [1, 5, 'throttlePotHiMafLo'],\n [1, 6, 'throttlePotLoMafHi'],\n [1, 7, 'purgeValveLeak'],\n [2, 1, 'mixtureTooLean'],\n [2, 3, 'intakeAirLeak'],\n [3, 0, 'lowFuelPressure'],\n [3, 4, 'idleValveStepperMotor'],\n [3, 6, 'roadSpeedSensor'],\n [3, 7, 'neutralSwitch'],\n [4, 4, 'lowFuelPressureOrAirLeak'],\n [4, 5, 'fuelTempSensor'],\n [5, 6, 'batteryDisconnected'],\n [5, 7, 'ramChecksumFailure'],\n] as const;\n\n/**\n * Name of a fault flag in {@link FaultCodes}, taken from the field names of\n * the C `c14cux_faultcodes` struct. `misfireGeneral` has no C field.\n */\nexport type FaultCodeName = (typeof FAULT_BITS)[number][2];\n\n/**\n * Fault code flags (`c14cux_faultcodes`); `true` means the fault is set.\n *\n * `misfireGeneral` (fault code 25, bit 3 of 0x0049) is not in the C struct.\n * The firmware disassembly shows that only builds before R3360 set it, so it\n * is not expected to be set on later firmware.\n */\nexport type FaultCodes = Record<FaultCodeName, boolean>;\n\n/** Number of bytes in the fault code block at 0x0049. */\nexport const FAULT_CODE_BLOCK_SIZE = 6;\n\n/**\n * Decodes the fault code block into named flags. Spare bits are ignored.\n *\n * @param bytes - The six bytes read from 0x0049.\n * @returns A flag for each fault; `true` means the fault is set.\n */\nexport function decodeFaultCodes(bytes: Uint8Array): FaultCodes {\n const codes = {} as FaultCodes;\n\n for (const [byteIndex, bit, name] of FAULT_BITS) {\n codes[name] = (((bytes[byteIndex] ?? 0) >> bit) & 1) === 1;\n }\n\n return codes;\n}\n"]}
|
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
// Copyright (C) 2026 comm14cux-ts contributors
|
|
3
3
|
/** Updated by release-please; must match `version` in package.json (enforced by a test). */
|
|
4
|
-
const PACKAGE_VERSION = '0.
|
|
4
|
+
const PACKAGE_VERSION = '0.2.0'; // x-release-please-version
|
|
5
5
|
const [major = 0, minor = 0, patch = 0] = PACKAGE_VERSION.split('.').map(Number);
|
|
6
6
|
export /**
|
|
7
7
|
*
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,+CAA+C;AAkB/C,4FAA4F;AAC5F,MAAM,eAAe,GAAG,OAAO,CAAC,CAAC,2BAA2B;AAE5D,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GACrC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,CAAC;;GAEJ,CACH,MAAM,eAAe,GAAY,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC","sourcesContent":["// SPDX-License-Identifier: GPL-3.0-only\n// Copyright (C) 2026 comm14cux-ts contributors\n\n/** Major/minor/patch version of this library (`c14cux_version`). */\nexport interface Version {\n /**\n * Major version number.\n */\n major: number;\n /**\n * Minor version number.\n */\n minor: number;\n /**\n * Patch version number.\n */\n patch: number;\n}\n\n/** Updated by release-please; must match `version` in package.json (enforced by a test). */\nconst PACKAGE_VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,+CAA+C;AAkB/C,4FAA4F;AAC5F,MAAM,eAAe,GAAG,OAAO,CAAC,CAAC,2BAA2B;AAE5D,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GACrC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,CAAC;;GAEJ,CACH,MAAM,eAAe,GAAY,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC","sourcesContent":["// SPDX-License-Identifier: GPL-3.0-only\n// Copyright (C) 2026 comm14cux-ts contributors\n\n/** Major/minor/patch version of this library (`c14cux_version`). */\nexport interface Version {\n /**\n * Major version number.\n */\n major: number;\n /**\n * Minor version number.\n */\n minor: number;\n /**\n * Patch version number.\n */\n patch: number;\n}\n\n/** Updated by release-please; must match `version` in package.json (enforced by a test). */\nconst PACKAGE_VERSION = '0.2.0'; // x-release-please-version\n\nconst [major = 0, minor = 0, patch = 0] =\n PACKAGE_VERSION.split('.').map(Number);\n\nexport /**\n *\n */\nconst LIBRARY_VERSION: Version = { major, minor, patch };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kb1rma/libcomm14cux-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-beta.6",
|
|
4
4
|
"description": "TypeScript library for communicating with the Lucas 14CUX engine ECU over a serial port using the Web Serial API",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
// Ported to TypeScript and modified for comm14cux-ts, 2026.
|
|
5
5
|
|
|
6
6
|
// [byte offset from 0x0049, bit (0 = LSB), name]. Spare bits are omitted.
|
|
7
|
-
// Names follow the field names of `c14cux_faultcodes
|
|
7
|
+
// Names follow the field names of `c14cux_faultcodes`, except `misfireGeneral`,
|
|
8
|
+
// which has no C field.
|
|
8
9
|
const FAULT_BITS = [
|
|
9
10
|
[0, 0, 'romChecksumFailure'],
|
|
10
11
|
[0, 1, 'lambdaSensorOdd'],
|
|
11
12
|
[0, 2, 'lambdaSensorEven'],
|
|
13
|
+
// Fault code 25. libcomm14cux treats this bit as spare, but the firmware
|
|
14
|
+
// disassembly (ignitionInt.asm, faults.asm) sets it on a misfire in builds
|
|
15
|
+
// before R3360. R3360 and later never set it.
|
|
16
|
+
[0, 3, 'misfireGeneral'],
|
|
12
17
|
[0, 4, 'misfireOddBank'],
|
|
13
18
|
[0, 5, 'misfireEvenBank'],
|
|
14
19
|
[0, 6, 'airflowMeter'],
|
|
@@ -34,11 +39,17 @@ const FAULT_BITS = [
|
|
|
34
39
|
|
|
35
40
|
/**
|
|
36
41
|
* Name of a fault flag in {@link FaultCodes}, taken from the field names of
|
|
37
|
-
* the C `c14cux_faultcodes` struct.
|
|
42
|
+
* the C `c14cux_faultcodes` struct. `misfireGeneral` has no C field.
|
|
38
43
|
*/
|
|
39
44
|
export type FaultCodeName = (typeof FAULT_BITS)[number][2];
|
|
40
45
|
|
|
41
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Fault code flags (`c14cux_faultcodes`); `true` means the fault is set.
|
|
48
|
+
*
|
|
49
|
+
* `misfireGeneral` (fault code 25, bit 3 of 0x0049) is not in the C struct.
|
|
50
|
+
* The firmware disassembly shows that only builds before R3360 set it, so it
|
|
51
|
+
* is not expected to be set on later firmware.
|
|
52
|
+
*/
|
|
42
53
|
export type FaultCodes = Record<FaultCodeName, boolean>;
|
|
43
54
|
|
|
44
55
|
/** Number of bytes in the fault code block at 0x0049. */
|
package/src/version.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface Version {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/** Updated by release-please; must match `version` in package.json (enforced by a test). */
|
|
21
|
-
const PACKAGE_VERSION = '0.
|
|
21
|
+
const PACKAGE_VERSION = '0.2.0'; // x-release-please-version
|
|
22
22
|
|
|
23
23
|
const [major = 0, minor = 0, patch = 0] =
|
|
24
24
|
PACKAGE_VERSION.split('.').map(Number);
|