tirecheck-device-sdk 0.2.68 → 0.2.70

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 CHANGED
@@ -254,7 +254,7 @@ const bridgeTools = {
254
254
  },
255
255
  convertBarToKpaByte(deviceId, value) {
256
256
  if (!value) return 0;
257
- const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
257
+ const bitValue = bridgeUsesKpaPressure(deviceId) ? 1 : 5.0625;
258
258
  return ___default.round((value + 1) * 100 / bitValue);
259
259
  },
260
260
  convertSensorIdForBridge(sensorId) {
@@ -277,7 +277,7 @@ const bridgeTools = {
277
277
  if (!___default.isNumber(value)) {
278
278
  throw new TypeError("Value has to be a number");
279
279
  }
280
- const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
280
+ const bitValue = bridgeUsesKpaPressure(deviceId) ? 1 : 5.0625;
281
281
  const rawBar = value * bitValue / 100;
282
282
  return ___default.round(Math.max(rawBar - decrementValue, 0), 1);
283
283
  },
@@ -292,7 +292,7 @@ const bridgeTools = {
292
292
  return false;
293
293
  },
294
294
  usesKpaPressure(deviceId) {
295
- return this.isVersionGreaterThan(deviceId, "1.1.F");
295
+ return bridgeUsesKpaPressure(deviceId);
296
296
  },
297
297
  convertSensorIdFromBridge(sensorId) {
298
298
  if (sensorId.startsWith("B")) {
@@ -374,6 +374,9 @@ function getBridgeFromStore(deviceId) {
374
374
  if (deviceData.type !== "bridge") throw new Error("Device is not bridge");
375
375
  return deviceData;
376
376
  }
377
+ function bridgeUsesKpaPressure(deviceId) {
378
+ return getBridgeFromStore(deviceId).name === "030717";
379
+ }
377
380
  function getDefaultTyreLabels() {
378
381
  const tyreLabelsStr = "_L;_R;_LO;_LI;_RI;_RO;_";
379
382
  const tyreLabelsStrLoc = tyreLabelsStr;
@@ -1274,7 +1277,7 @@ const bridgeCommandStructures = {
1274
1277
  }
1275
1278
  },
1276
1279
  /**
1277
- * kPa per-axle pressure layout used from FW 1.2.0 onwards (same sub-command 0x30 as `pressuresPerAxle`).
1280
+ * kPa per-axle pressure layout used by the 030717 bridge model (same sub-command 0x30 as `pressuresPerAxle`).
1278
1281
  * Each axle packs the same three values (set; min; max) but every value is a 2-byte little-endian raw kPa
1279
1282
  * uint16 (no 5.0625 bit scaling), so each axle is 6 bytes instead of 3. Selected at runtime via
1280
1283
  * `bridgeTools.usesKpaPressure(deviceId)`.
@@ -1513,64 +1516,64 @@ const bridgeCommandStructures = {
1513
1516
  name: "autolearnUnknownSensors",
1514
1517
  structure: {
1515
1518
  sensor01: {
1516
- size: 8,
1517
- description: "Unknown sensor data"
1519
+ size: 13,
1520
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1518
1521
  },
1519
1522
  sensor02: {
1520
- size: 8,
1521
- description: "Unknown sensor data"
1523
+ size: 13,
1524
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1522
1525
  },
1523
1526
  sensor03: {
1524
- size: 8,
1525
- description: "Unknown sensor data"
1527
+ size: 13,
1528
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1526
1529
  },
1527
1530
  sensor04: {
1528
- size: 8,
1529
- description: "Unknown sensor data"
1531
+ size: 13,
1532
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1530
1533
  },
1531
1534
  sensor05: {
1532
- size: 8,
1533
- description: "Unknown sensor data"
1535
+ size: 13,
1536
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1534
1537
  },
1535
1538
  sensor06: {
1536
- size: 8,
1537
- description: "Unknown sensor data"
1539
+ size: 13,
1540
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1538
1541
  },
1539
1542
  sensor07: {
1540
- size: 8,
1541
- description: "Unknown sensor data"
1543
+ size: 13,
1544
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1542
1545
  },
1543
1546
  sensor08: {
1544
- size: 8,
1545
- description: "Unknown sensor data"
1547
+ size: 13,
1548
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1546
1549
  },
1547
1550
  sensor09: {
1548
- size: 8,
1549
- description: "Unknown sensor data"
1551
+ size: 13,
1552
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1550
1553
  },
1551
1554
  sensor10: {
1552
- size: 8,
1553
- description: "Unknown sensor data"
1555
+ size: 13,
1556
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1554
1557
  },
1555
1558
  sensor11: {
1556
- size: 8,
1557
- description: "Unknown sensor data"
1559
+ size: 13,
1560
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1558
1561
  },
1559
1562
  sensor12: {
1560
- size: 8,
1561
- description: "Unknown sensor data"
1563
+ size: 13,
1564
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1562
1565
  },
1563
1566
  sensor13: {
1564
- size: 8,
1565
- description: "Unknown sensor data"
1567
+ size: 13,
1568
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1566
1569
  },
1567
1570
  sensor14: {
1568
- size: 8,
1569
- description: "Unknown sensor data"
1571
+ size: 13,
1572
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1570
1573
  },
1571
1574
  sensor15: {
1572
- size: 8,
1573
- description: "Unknown sensor data"
1575
+ size: 13,
1576
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1574
1577
  }
1575
1578
  }
1576
1579
  },
@@ -1718,6 +1721,48 @@ const bridgeCommandStructures = {
1718
1721
  }
1719
1722
  }
1720
1723
  },
1724
+ errorHistoryCounter: {
1725
+ id: [98, 112],
1726
+ name: "errorHistoryCounter",
1727
+ structure: {
1728
+ hwErrorCounter: {
1729
+ size: 1,
1730
+ description: "HW Error Counter",
1731
+ display: "decimal"
1732
+ },
1733
+ powerUpCounter: {
1734
+ size: 1,
1735
+ description: "Power-up Counter",
1736
+ display: "decimal"
1737
+ },
1738
+ configErrorCounter: {
1739
+ size: 1,
1740
+ description: "Config. Error Counter",
1741
+ display: "decimal"
1742
+ },
1743
+ swErrorCounter: {
1744
+ size: 1,
1745
+ description: "SW Error Counter",
1746
+ display: "decimal"
1747
+ }
1748
+ }
1749
+ },
1750
+ eolStatus: {
1751
+ id: [98, 128],
1752
+ name: "eolStatus",
1753
+ structure: {
1754
+ eolStatus: {
1755
+ size: 1,
1756
+ description: "End of Line status code",
1757
+ display: "decimal"
1758
+ },
1759
+ eolCounter: {
1760
+ size: 1,
1761
+ description: "End of Line counter value",
1762
+ display: "decimal"
1763
+ }
1764
+ }
1765
+ },
1721
1766
  firmwareVersion: {
1722
1767
  id: [98, 144],
1723
1768
  name: "firmwareVersion",
@@ -2150,7 +2195,10 @@ const bridgeCommands = {
2150
2195
  },
2151
2196
  async getAutolearnUnknownSensors(deviceId) {
2152
2197
  const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2153
- const result = await this.readCommand(deviceData, subCommandIds.autolearnUnknownSensors);
2198
+ const result = await this.readCommand(deviceData, subCommandIds.autolearnUnknownSensors, {
2199
+ headerLength: 5,
2200
+ footerLength: 4
2201
+ });
2154
2202
  const structurized = bridgeTools.convertBytesToStructure(
2155
2203
  bridgeCommandStructures.autolearnUnknownSensors.structure,
2156
2204
  result.data,
@@ -2231,7 +2279,7 @@ const bridgeCommands = {
2231
2279
  const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2232
2280
  const result = await this.readCommand(deviceData, subCommandIds.firmwareVersion, {
2233
2281
  headerLength: 5,
2234
- footerLength: 0
2282
+ footerLength: 4
2235
2283
  });
2236
2284
  return bridgeTools.convertBytesToStructure(
2237
2285
  bridgeCommandStructures.firmwareVersion.structure,
@@ -2239,6 +2287,28 @@ const bridgeCommands = {
2239
2287
  deviceData.advertisingData.fwVersion
2240
2288
  );
2241
2289
  },
2290
+ async getErrorHistoryCounter(deviceId) {
2291
+ const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2292
+ const result = await this.readCommand(deviceData, subCommandIds.errorHistoryCounter, {
2293
+ headerLength: 5,
2294
+ footerLength: 4
2295
+ });
2296
+ return bridgeTools.convertBytesToStructure(
2297
+ bridgeCommandStructures.errorHistoryCounter.structure,
2298
+ result.data,
2299
+ deviceData.advertisingData.fwVersion
2300
+ );
2301
+ },
2302
+ async getEolStatus(deviceId) {
2303
+ const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2304
+ const result = await this.readCommand(deviceData, subCommandIds.eolStatus);
2305
+ const structurized = bridgeTools.convertBytesToStructure(
2306
+ bridgeCommandStructures.eolStatus.structure,
2307
+ result.data,
2308
+ deviceData.advertisingData.fwVersion
2309
+ );
2310
+ return { ...structurized, isFactory: result.isFactory };
2311
+ },
2242
2312
  async getSensorMeasurement(deviceId, positionId) {
2243
2313
  const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2244
2314
  const isSpare = String(positionId).endsWith("0");
@@ -2407,9 +2477,15 @@ async function getConfiguration(deviceId, includeVehicleData = false) {
2407
2477
  const customerImbalanceThresholds = await bridgeCommands.getCustomerImbalanceThresholds(deviceId);
2408
2478
  const pressuresPerAxle = await bridgeCommands.getPressuresPerAxle(deviceId);
2409
2479
  let autolearnSettings;
2480
+ let errorHistoryCounter;
2481
+ let eolStatus;
2410
2482
  if (bridgeTools.isVersionGreaterThan(deviceId, "0.9.7")) {
2411
2483
  autolearnSettings = await bridgeCommands.getAutolearnSettings(deviceId);
2412
2484
  }
2485
+ if (bridgeTools.isVersionGreaterThan(deviceId, "1.1.F")) {
2486
+ errorHistoryCounter = await bridgeCommands.getErrorHistoryCounter(deviceId);
2487
+ eolStatus = await bridgeCommands.getEolStatus(deviceId);
2488
+ }
2413
2489
  const configuration = {
2414
2490
  customerCANSettings,
2415
2491
  workshopCANSettings,
@@ -2417,7 +2493,9 @@ async function getConfiguration(deviceId, includeVehicleData = false) {
2417
2493
  customerTemperatureThresholds,
2418
2494
  customerImbalanceThresholds,
2419
2495
  pressuresPerAxle,
2420
- autolearnSettings
2496
+ autolearnSettings,
2497
+ errorHistoryCounter,
2498
+ eolStatus
2421
2499
  };
2422
2500
  if (includeVehicleData) {
2423
2501
  configuration.vehicleLayout = await bridgeCommands.getVehicleLayout(deviceId);
package/dist/index.d.cts CHANGED
@@ -420,7 +420,7 @@ declare const _default: {
420
420
  };
421
421
  };
422
422
  /**
423
- * kPa per-axle pressure layout used from FW 1.2.0 onwards (same sub-command 0x30 as `pressuresPerAxle`).
423
+ * kPa per-axle pressure layout used by the 030717 bridge model (same sub-command 0x30 as `pressuresPerAxle`).
424
424
  * Each axle packs the same three values (set; min; max) but every value is a 2-byte little-endian raw kPa
425
425
  * uint16 (no 5.0625 bit scaling), so each axle is 6 bytes instead of 3. Selected at runtime via
426
426
  * `bridgeTools.usesKpaPressure(deviceId)`.
@@ -863,6 +863,48 @@ declare const _default: {
863
863
  };
864
864
  };
865
865
  };
866
+ errorHistoryCounter: {
867
+ id: number[];
868
+ name: string;
869
+ structure: {
870
+ hwErrorCounter: {
871
+ size: number;
872
+ description: string;
873
+ display: "decimal";
874
+ };
875
+ powerUpCounter: {
876
+ size: number;
877
+ description: string;
878
+ display: "decimal";
879
+ };
880
+ configErrorCounter: {
881
+ size: number;
882
+ description: string;
883
+ display: "decimal";
884
+ };
885
+ swErrorCounter: {
886
+ size: number;
887
+ description: string;
888
+ display: "decimal";
889
+ };
890
+ };
891
+ };
892
+ eolStatus: {
893
+ id: number[];
894
+ name: string;
895
+ structure: {
896
+ eolStatus: {
897
+ size: number;
898
+ description: string;
899
+ display: "decimal";
900
+ };
901
+ eolCounter: {
902
+ size: number;
903
+ description: string;
904
+ display: "decimal";
905
+ };
906
+ };
907
+ };
866
908
  firmwareVersion: {
867
909
  id: number[];
868
910
  name: string;
@@ -970,6 +1012,10 @@ interface BridgeConfiguration {
970
1012
  customerTemperatureThresholds: BridgeCommandStructurized<typeof _default.axleTemperatureThresholds.structure>;
971
1013
  customerImbalanceThresholds: BridgeCommandStructurized<typeof _default.axleImbalanceThresholds.structure>;
972
1014
  pressuresPerAxle: BridgeCommandStructurized<typeof _default.pressuresPerAxle.structure>;
1015
+ /** only available after 1.1.F fw */
1016
+ errorHistoryCounter?: BridgeCommandStructurized<typeof _default.errorHistoryCounter.structure>;
1017
+ /** only available after 1.1.F fw */
1018
+ eolStatus?: BridgeCommandStructurized<typeof _default.eolStatus.structure>;
973
1019
  /** only available after 0.9.8 fw */
974
1020
  autolearnSettings?: BridgeCommandStructurized<typeof _default.autolearnSettings.structure>;
975
1021
  vehicleLayout?: BridgeCommandStructurized<typeof _default.vehicleLayout.structure>;
package/dist/index.d.mts CHANGED
@@ -420,7 +420,7 @@ declare const _default: {
420
420
  };
421
421
  };
422
422
  /**
423
- * kPa per-axle pressure layout used from FW 1.2.0 onwards (same sub-command 0x30 as `pressuresPerAxle`).
423
+ * kPa per-axle pressure layout used by the 030717 bridge model (same sub-command 0x30 as `pressuresPerAxle`).
424
424
  * Each axle packs the same three values (set; min; max) but every value is a 2-byte little-endian raw kPa
425
425
  * uint16 (no 5.0625 bit scaling), so each axle is 6 bytes instead of 3. Selected at runtime via
426
426
  * `bridgeTools.usesKpaPressure(deviceId)`.
@@ -863,6 +863,48 @@ declare const _default: {
863
863
  };
864
864
  };
865
865
  };
866
+ errorHistoryCounter: {
867
+ id: number[];
868
+ name: string;
869
+ structure: {
870
+ hwErrorCounter: {
871
+ size: number;
872
+ description: string;
873
+ display: "decimal";
874
+ };
875
+ powerUpCounter: {
876
+ size: number;
877
+ description: string;
878
+ display: "decimal";
879
+ };
880
+ configErrorCounter: {
881
+ size: number;
882
+ description: string;
883
+ display: "decimal";
884
+ };
885
+ swErrorCounter: {
886
+ size: number;
887
+ description: string;
888
+ display: "decimal";
889
+ };
890
+ };
891
+ };
892
+ eolStatus: {
893
+ id: number[];
894
+ name: string;
895
+ structure: {
896
+ eolStatus: {
897
+ size: number;
898
+ description: string;
899
+ display: "decimal";
900
+ };
901
+ eolCounter: {
902
+ size: number;
903
+ description: string;
904
+ display: "decimal";
905
+ };
906
+ };
907
+ };
866
908
  firmwareVersion: {
867
909
  id: number[];
868
910
  name: string;
@@ -970,6 +1012,10 @@ interface BridgeConfiguration {
970
1012
  customerTemperatureThresholds: BridgeCommandStructurized<typeof _default.axleTemperatureThresholds.structure>;
971
1013
  customerImbalanceThresholds: BridgeCommandStructurized<typeof _default.axleImbalanceThresholds.structure>;
972
1014
  pressuresPerAxle: BridgeCommandStructurized<typeof _default.pressuresPerAxle.structure>;
1015
+ /** only available after 1.1.F fw */
1016
+ errorHistoryCounter?: BridgeCommandStructurized<typeof _default.errorHistoryCounter.structure>;
1017
+ /** only available after 1.1.F fw */
1018
+ eolStatus?: BridgeCommandStructurized<typeof _default.eolStatus.structure>;
973
1019
  /** only available after 0.9.8 fw */
974
1020
  autolearnSettings?: BridgeCommandStructurized<typeof _default.autolearnSettings.structure>;
975
1021
  vehicleLayout?: BridgeCommandStructurized<typeof _default.vehicleLayout.structure>;
package/dist/index.d.ts CHANGED
@@ -420,7 +420,7 @@ declare const _default: {
420
420
  };
421
421
  };
422
422
  /**
423
- * kPa per-axle pressure layout used from FW 1.2.0 onwards (same sub-command 0x30 as `pressuresPerAxle`).
423
+ * kPa per-axle pressure layout used by the 030717 bridge model (same sub-command 0x30 as `pressuresPerAxle`).
424
424
  * Each axle packs the same three values (set; min; max) but every value is a 2-byte little-endian raw kPa
425
425
  * uint16 (no 5.0625 bit scaling), so each axle is 6 bytes instead of 3. Selected at runtime via
426
426
  * `bridgeTools.usesKpaPressure(deviceId)`.
@@ -863,6 +863,48 @@ declare const _default: {
863
863
  };
864
864
  };
865
865
  };
866
+ errorHistoryCounter: {
867
+ id: number[];
868
+ name: string;
869
+ structure: {
870
+ hwErrorCounter: {
871
+ size: number;
872
+ description: string;
873
+ display: "decimal";
874
+ };
875
+ powerUpCounter: {
876
+ size: number;
877
+ description: string;
878
+ display: "decimal";
879
+ };
880
+ configErrorCounter: {
881
+ size: number;
882
+ description: string;
883
+ display: "decimal";
884
+ };
885
+ swErrorCounter: {
886
+ size: number;
887
+ description: string;
888
+ display: "decimal";
889
+ };
890
+ };
891
+ };
892
+ eolStatus: {
893
+ id: number[];
894
+ name: string;
895
+ structure: {
896
+ eolStatus: {
897
+ size: number;
898
+ description: string;
899
+ display: "decimal";
900
+ };
901
+ eolCounter: {
902
+ size: number;
903
+ description: string;
904
+ display: "decimal";
905
+ };
906
+ };
907
+ };
866
908
  firmwareVersion: {
867
909
  id: number[];
868
910
  name: string;
@@ -970,6 +1012,10 @@ interface BridgeConfiguration {
970
1012
  customerTemperatureThresholds: BridgeCommandStructurized<typeof _default.axleTemperatureThresholds.structure>;
971
1013
  customerImbalanceThresholds: BridgeCommandStructurized<typeof _default.axleImbalanceThresholds.structure>;
972
1014
  pressuresPerAxle: BridgeCommandStructurized<typeof _default.pressuresPerAxle.structure>;
1015
+ /** only available after 1.1.F fw */
1016
+ errorHistoryCounter?: BridgeCommandStructurized<typeof _default.errorHistoryCounter.structure>;
1017
+ /** only available after 1.1.F fw */
1018
+ eolStatus?: BridgeCommandStructurized<typeof _default.eolStatus.structure>;
973
1019
  /** only available after 0.9.8 fw */
974
1020
  autolearnSettings?: BridgeCommandStructurized<typeof _default.autolearnSettings.structure>;
975
1021
  vehicleLayout?: BridgeCommandStructurized<typeof _default.vehicleLayout.structure>;
package/dist/index.mjs CHANGED
@@ -247,7 +247,7 @@ const bridgeTools = {
247
247
  },
248
248
  convertBarToKpaByte(deviceId, value) {
249
249
  if (!value) return 0;
250
- const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
250
+ const bitValue = bridgeUsesKpaPressure(deviceId) ? 1 : 5.0625;
251
251
  return _.round((value + 1) * 100 / bitValue);
252
252
  },
253
253
  convertSensorIdForBridge(sensorId) {
@@ -270,7 +270,7 @@ const bridgeTools = {
270
270
  if (!_.isNumber(value)) {
271
271
  throw new TypeError("Value has to be a number");
272
272
  }
273
- const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
273
+ const bitValue = bridgeUsesKpaPressure(deviceId) ? 1 : 5.0625;
274
274
  const rawBar = value * bitValue / 100;
275
275
  return _.round(Math.max(rawBar - decrementValue, 0), 1);
276
276
  },
@@ -285,7 +285,7 @@ const bridgeTools = {
285
285
  return false;
286
286
  },
287
287
  usesKpaPressure(deviceId) {
288
- return this.isVersionGreaterThan(deviceId, "1.1.F");
288
+ return bridgeUsesKpaPressure(deviceId);
289
289
  },
290
290
  convertSensorIdFromBridge(sensorId) {
291
291
  if (sensorId.startsWith("B")) {
@@ -367,6 +367,9 @@ function getBridgeFromStore(deviceId) {
367
367
  if (deviceData.type !== "bridge") throw new Error("Device is not bridge");
368
368
  return deviceData;
369
369
  }
370
+ function bridgeUsesKpaPressure(deviceId) {
371
+ return getBridgeFromStore(deviceId).name === "030717";
372
+ }
370
373
  function getDefaultTyreLabels() {
371
374
  const tyreLabelsStr = "_L;_R;_LO;_LI;_RI;_RO;_";
372
375
  const tyreLabelsStrLoc = tyreLabelsStr;
@@ -1267,7 +1270,7 @@ const bridgeCommandStructures = {
1267
1270
  }
1268
1271
  },
1269
1272
  /**
1270
- * kPa per-axle pressure layout used from FW 1.2.0 onwards (same sub-command 0x30 as `pressuresPerAxle`).
1273
+ * kPa per-axle pressure layout used by the 030717 bridge model (same sub-command 0x30 as `pressuresPerAxle`).
1271
1274
  * Each axle packs the same three values (set; min; max) but every value is a 2-byte little-endian raw kPa
1272
1275
  * uint16 (no 5.0625 bit scaling), so each axle is 6 bytes instead of 3. Selected at runtime via
1273
1276
  * `bridgeTools.usesKpaPressure(deviceId)`.
@@ -1506,64 +1509,64 @@ const bridgeCommandStructures = {
1506
1509
  name: "autolearnUnknownSensors",
1507
1510
  structure: {
1508
1511
  sensor01: {
1509
- size: 8,
1510
- description: "Unknown sensor data"
1512
+ size: 13,
1513
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1511
1514
  },
1512
1515
  sensor02: {
1513
- size: 8,
1514
- description: "Unknown sensor data"
1516
+ size: 13,
1517
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1515
1518
  },
1516
1519
  sensor03: {
1517
- size: 8,
1518
- description: "Unknown sensor data"
1520
+ size: 13,
1521
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1519
1522
  },
1520
1523
  sensor04: {
1521
- size: 8,
1522
- description: "Unknown sensor data"
1524
+ size: 13,
1525
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1523
1526
  },
1524
1527
  sensor05: {
1525
- size: 8,
1526
- description: "Unknown sensor data"
1528
+ size: 13,
1529
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1527
1530
  },
1528
1531
  sensor06: {
1529
- size: 8,
1530
- description: "Unknown sensor data"
1532
+ size: 13,
1533
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1531
1534
  },
1532
1535
  sensor07: {
1533
- size: 8,
1534
- description: "Unknown sensor data"
1536
+ size: 13,
1537
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1535
1538
  },
1536
1539
  sensor08: {
1537
- size: 8,
1538
- description: "Unknown sensor data"
1540
+ size: 13,
1541
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1539
1542
  },
1540
1543
  sensor09: {
1541
- size: 8,
1542
- description: "Unknown sensor data"
1544
+ size: 13,
1545
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1543
1546
  },
1544
1547
  sensor10: {
1545
- size: 8,
1546
- description: "Unknown sensor data"
1548
+ size: 13,
1549
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1547
1550
  },
1548
1551
  sensor11: {
1549
- size: 8,
1550
- description: "Unknown sensor data"
1552
+ size: 13,
1553
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1551
1554
  },
1552
1555
  sensor12: {
1553
- size: 8,
1554
- description: "Unknown sensor data"
1556
+ size: 13,
1557
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1555
1558
  },
1556
1559
  sensor13: {
1557
- size: 8,
1558
- description: "Unknown sensor data"
1560
+ size: 13,
1561
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1559
1562
  },
1560
1563
  sensor14: {
1561
- size: 8,
1562
- description: "Unknown sensor data"
1564
+ size: 13,
1565
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1563
1566
  },
1564
1567
  sensor15: {
1565
- size: 8,
1566
- description: "Unknown sensor data"
1568
+ size: 13,
1569
+ description: "Unknown sensor data: timestamp; ID; pressure; temperature; status; RSSI; message counter (13-byte record)"
1567
1570
  }
1568
1571
  }
1569
1572
  },
@@ -1711,6 +1714,48 @@ const bridgeCommandStructures = {
1711
1714
  }
1712
1715
  }
1713
1716
  },
1717
+ errorHistoryCounter: {
1718
+ id: [98, 112],
1719
+ name: "errorHistoryCounter",
1720
+ structure: {
1721
+ hwErrorCounter: {
1722
+ size: 1,
1723
+ description: "HW Error Counter",
1724
+ display: "decimal"
1725
+ },
1726
+ powerUpCounter: {
1727
+ size: 1,
1728
+ description: "Power-up Counter",
1729
+ display: "decimal"
1730
+ },
1731
+ configErrorCounter: {
1732
+ size: 1,
1733
+ description: "Config. Error Counter",
1734
+ display: "decimal"
1735
+ },
1736
+ swErrorCounter: {
1737
+ size: 1,
1738
+ description: "SW Error Counter",
1739
+ display: "decimal"
1740
+ }
1741
+ }
1742
+ },
1743
+ eolStatus: {
1744
+ id: [98, 128],
1745
+ name: "eolStatus",
1746
+ structure: {
1747
+ eolStatus: {
1748
+ size: 1,
1749
+ description: "End of Line status code",
1750
+ display: "decimal"
1751
+ },
1752
+ eolCounter: {
1753
+ size: 1,
1754
+ description: "End of Line counter value",
1755
+ display: "decimal"
1756
+ }
1757
+ }
1758
+ },
1714
1759
  firmwareVersion: {
1715
1760
  id: [98, 144],
1716
1761
  name: "firmwareVersion",
@@ -2143,7 +2188,10 @@ const bridgeCommands = {
2143
2188
  },
2144
2189
  async getAutolearnUnknownSensors(deviceId) {
2145
2190
  const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2146
- const result = await this.readCommand(deviceData, subCommandIds.autolearnUnknownSensors);
2191
+ const result = await this.readCommand(deviceData, subCommandIds.autolearnUnknownSensors, {
2192
+ headerLength: 5,
2193
+ footerLength: 4
2194
+ });
2147
2195
  const structurized = bridgeTools.convertBytesToStructure(
2148
2196
  bridgeCommandStructures.autolearnUnknownSensors.structure,
2149
2197
  result.data,
@@ -2224,7 +2272,7 @@ const bridgeCommands = {
2224
2272
  const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2225
2273
  const result = await this.readCommand(deviceData, subCommandIds.firmwareVersion, {
2226
2274
  headerLength: 5,
2227
- footerLength: 0
2275
+ footerLength: 4
2228
2276
  });
2229
2277
  return bridgeTools.convertBytesToStructure(
2230
2278
  bridgeCommandStructures.firmwareVersion.structure,
@@ -2232,6 +2280,28 @@ const bridgeCommands = {
2232
2280
  deviceData.advertisingData.fwVersion
2233
2281
  );
2234
2282
  },
2283
+ async getErrorHistoryCounter(deviceId) {
2284
+ const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2285
+ const result = await this.readCommand(deviceData, subCommandIds.errorHistoryCounter, {
2286
+ headerLength: 5,
2287
+ footerLength: 4
2288
+ });
2289
+ return bridgeTools.convertBytesToStructure(
2290
+ bridgeCommandStructures.errorHistoryCounter.structure,
2291
+ result.data,
2292
+ deviceData.advertisingData.fwVersion
2293
+ );
2294
+ },
2295
+ async getEolStatus(deviceId) {
2296
+ const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2297
+ const result = await this.readCommand(deviceData, subCommandIds.eolStatus);
2298
+ const structurized = bridgeTools.convertBytesToStructure(
2299
+ bridgeCommandStructures.eolStatus.structure,
2300
+ result.data,
2301
+ deviceData.advertisingData.fwVersion
2302
+ );
2303
+ return { ...structurized, isFactory: result.isFactory };
2304
+ },
2235
2305
  async getSensorMeasurement(deviceId, positionId) {
2236
2306
  const deviceData = bridgeTools.getBridgeFromStore(deviceId);
2237
2307
  const isSpare = String(positionId).endsWith("0");
@@ -2400,9 +2470,15 @@ async function getConfiguration(deviceId, includeVehicleData = false) {
2400
2470
  const customerImbalanceThresholds = await bridgeCommands.getCustomerImbalanceThresholds(deviceId);
2401
2471
  const pressuresPerAxle = await bridgeCommands.getPressuresPerAxle(deviceId);
2402
2472
  let autolearnSettings;
2473
+ let errorHistoryCounter;
2474
+ let eolStatus;
2403
2475
  if (bridgeTools.isVersionGreaterThan(deviceId, "0.9.7")) {
2404
2476
  autolearnSettings = await bridgeCommands.getAutolearnSettings(deviceId);
2405
2477
  }
2478
+ if (bridgeTools.isVersionGreaterThan(deviceId, "1.1.F")) {
2479
+ errorHistoryCounter = await bridgeCommands.getErrorHistoryCounter(deviceId);
2480
+ eolStatus = await bridgeCommands.getEolStatus(deviceId);
2481
+ }
2406
2482
  const configuration = {
2407
2483
  customerCANSettings,
2408
2484
  workshopCANSettings,
@@ -2410,7 +2486,9 @@ async function getConfiguration(deviceId, includeVehicleData = false) {
2410
2486
  customerTemperatureThresholds,
2411
2487
  customerImbalanceThresholds,
2412
2488
  pressuresPerAxle,
2413
- autolearnSettings
2489
+ autolearnSettings,
2490
+ errorHistoryCounter,
2491
+ eolStatus
2414
2492
  };
2415
2493
  if (includeVehicleData) {
2416
2494
  configuration.vehicleLayout = await bridgeCommands.getVehicleLayout(deviceId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirecheck-device-sdk",
3
- "version": "0.2.68",
3
+ "version": "0.2.70",
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",