tirecheck-device-sdk 0.2.39 → 0.2.41
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/index.cjs +9 -10
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +9 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -881,8 +881,7 @@ const bridgeCommandStructures = {
|
|
|
881
881
|
baudRate: {
|
|
882
882
|
size: 2,
|
|
883
883
|
description: "Baud rate",
|
|
884
|
-
|
|
885
|
-
version: "1.0.5"
|
|
884
|
+
version: "1.0.6"
|
|
886
885
|
}
|
|
887
886
|
}
|
|
888
887
|
},
|
|
@@ -3794,7 +3793,7 @@ function getSimulatedBridgeTemplate() {
|
|
|
3794
3793
|
transparentFilteredMode: "01",
|
|
3795
3794
|
spnsPgnsBitmap: "00000000"
|
|
3796
3795
|
},
|
|
3797
|
-
workshopCANSettings: { canTermination: "01", baudRate:
|
|
3796
|
+
workshopCANSettings: { canTermination: "01", baudRate: "0000" },
|
|
3798
3797
|
customerPressureThresholds: {
|
|
3799
3798
|
axle01: "32190912",
|
|
3800
3799
|
axle02: "32190912",
|
|
@@ -4052,6 +4051,13 @@ function normalizeSimulatedDevice(device) {
|
|
|
4052
4051
|
throw new Error(`Simulator is not supported for device type: ${device.type}`);
|
|
4053
4052
|
}
|
|
4054
4053
|
function calculateEceStatusByte(positionId, simulatorData, advertisingData) {
|
|
4054
|
+
const sensor = simulatorData.sensors[positionId];
|
|
4055
|
+
if ([254, 255].includes(sensor.eceStatus)) return sensor.eceStatus;
|
|
4056
|
+
const axleIndex = Math.floor(positionId / 100) - 1;
|
|
4057
|
+
const axle = simulatorData.vehicle.axles[axleIndex];
|
|
4058
|
+
if (!sensor.pressure || !axle || axle.targetPressure === void 0) return 0;
|
|
4059
|
+
const sensorPressure = sensor.pressure.meas ?? sensor.pressure.bar;
|
|
4060
|
+
const percentageDifference = (sensorPressure - axle.targetPressure) / axle.targetPressure * 100;
|
|
4055
4061
|
const customerPressureThresholdsDecimal = bridgeTools.hexToDecimalArray(
|
|
4056
4062
|
simulatorData.configuration.customerPressureThresholds.axle01
|
|
4057
4063
|
);
|
|
@@ -4061,13 +4067,6 @@ function calculateEceStatusByte(positionId, simulatorData, advertisingData) {
|
|
|
4061
4067
|
underinflationWarning: customerPressureThresholdsDecimal[2],
|
|
4062
4068
|
underinflationCritical: customerPressureThresholdsDecimal[3]
|
|
4063
4069
|
};
|
|
4064
|
-
const sensor = simulatorData.sensors[positionId];
|
|
4065
|
-
const axleIndex = Math.floor(positionId / 100) - 1;
|
|
4066
|
-
const axle = simulatorData.vehicle.axles[axleIndex];
|
|
4067
|
-
if (!axle || axle.targetPressure === void 0) return 0;
|
|
4068
|
-
if (!sensor.pressure) return 0;
|
|
4069
|
-
const sensorPressure = sensor.pressure.meas ?? sensor.pressure.bar;
|
|
4070
|
-
const percentageDifference = (sensorPressure - axle.targetPressure) / axle.targetPressure * 100;
|
|
4071
4070
|
const usesNewValues = (advertisingData.fwVersion || "") > "0.8.F";
|
|
4072
4071
|
if (percentageDifference >= pressureThresholds.overinflationCritical) {
|
|
4073
4072
|
return usesNewValues ? 3 : 4;
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -874,8 +874,7 @@ const bridgeCommandStructures = {
|
|
|
874
874
|
baudRate: {
|
|
875
875
|
size: 2,
|
|
876
876
|
description: "Baud rate",
|
|
877
|
-
|
|
878
|
-
version: "1.0.5"
|
|
877
|
+
version: "1.0.6"
|
|
879
878
|
}
|
|
880
879
|
}
|
|
881
880
|
},
|
|
@@ -3787,7 +3786,7 @@ function getSimulatedBridgeTemplate() {
|
|
|
3787
3786
|
transparentFilteredMode: "01",
|
|
3788
3787
|
spnsPgnsBitmap: "00000000"
|
|
3789
3788
|
},
|
|
3790
|
-
workshopCANSettings: { canTermination: "01", baudRate:
|
|
3789
|
+
workshopCANSettings: { canTermination: "01", baudRate: "0000" },
|
|
3791
3790
|
customerPressureThresholds: {
|
|
3792
3791
|
axle01: "32190912",
|
|
3793
3792
|
axle02: "32190912",
|
|
@@ -4045,6 +4044,13 @@ function normalizeSimulatedDevice(device) {
|
|
|
4045
4044
|
throw new Error(`Simulator is not supported for device type: ${device.type}`);
|
|
4046
4045
|
}
|
|
4047
4046
|
function calculateEceStatusByte(positionId, simulatorData, advertisingData) {
|
|
4047
|
+
const sensor = simulatorData.sensors[positionId];
|
|
4048
|
+
if ([254, 255].includes(sensor.eceStatus)) return sensor.eceStatus;
|
|
4049
|
+
const axleIndex = Math.floor(positionId / 100) - 1;
|
|
4050
|
+
const axle = simulatorData.vehicle.axles[axleIndex];
|
|
4051
|
+
if (!sensor.pressure || !axle || axle.targetPressure === void 0) return 0;
|
|
4052
|
+
const sensorPressure = sensor.pressure.meas ?? sensor.pressure.bar;
|
|
4053
|
+
const percentageDifference = (sensorPressure - axle.targetPressure) / axle.targetPressure * 100;
|
|
4048
4054
|
const customerPressureThresholdsDecimal = bridgeTools.hexToDecimalArray(
|
|
4049
4055
|
simulatorData.configuration.customerPressureThresholds.axle01
|
|
4050
4056
|
);
|
|
@@ -4054,13 +4060,6 @@ function calculateEceStatusByte(positionId, simulatorData, advertisingData) {
|
|
|
4054
4060
|
underinflationWarning: customerPressureThresholdsDecimal[2],
|
|
4055
4061
|
underinflationCritical: customerPressureThresholdsDecimal[3]
|
|
4056
4062
|
};
|
|
4057
|
-
const sensor = simulatorData.sensors[positionId];
|
|
4058
|
-
const axleIndex = Math.floor(positionId / 100) - 1;
|
|
4059
|
-
const axle = simulatorData.vehicle.axles[axleIndex];
|
|
4060
|
-
if (!axle || axle.targetPressure === void 0) return 0;
|
|
4061
|
-
if (!sensor.pressure) return 0;
|
|
4062
|
-
const sensorPressure = sensor.pressure.meas ?? sensor.pressure.bar;
|
|
4063
|
-
const percentageDifference = (sensorPressure - axle.targetPressure) / axle.targetPressure * 100;
|
|
4064
4063
|
const usesNewValues = (advertisingData.fwVersion || "") > "0.8.F";
|
|
4065
4064
|
if (percentageDifference >= pressureThresholds.overinflationCritical) {
|
|
4066
4065
|
return usesNewValues ? 3 : 4;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tirecheck-device-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
4
4
|
"description": "SDK for working with various devices produced by Tirecheck via Bluetooth (CAN Bridge, Routers, Sensors, FlexiGauge, PressureStick, etc)",
|
|
5
5
|
"author": "Leonid Buneev <leonid.buneev@tirecheck.com>",
|
|
6
6
|
"license": "ISC",
|