tirecheck-device-sdk 0.1.9 → 0.1.91
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 +121 -16
- package/dist/index.d.cts +50 -33
- package/dist/index.d.mts +50 -33
- package/dist/index.d.ts +50 -33
- package/dist/index.mjs +121 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -149,6 +149,9 @@ const bridgeTools = {
|
|
|
149
149
|
if (displayUnits === "decimal") {
|
|
150
150
|
return Number(`0x${_reversedData.map((dec) => this.decimalToHex(dec)).join("")}`.replace(/\r\n/g, ""));
|
|
151
151
|
}
|
|
152
|
+
if (displayUnits === "reverseHex") {
|
|
153
|
+
return _reversedData.map((dec) => this.decimalToHex(dec).split("").reverse().join("")).join("");
|
|
154
|
+
}
|
|
152
155
|
return _reversedData.map((dec) => this.decimalToHex(dec)).join("");
|
|
153
156
|
},
|
|
154
157
|
encodeData(data, displayUnits) {
|
|
@@ -159,6 +162,11 @@ const bridgeTools = {
|
|
|
159
162
|
if (displayUnits === "decimal") {
|
|
160
163
|
return this.hexToDecimalArray(this.decimalToHex(_data)).reverse();
|
|
161
164
|
}
|
|
165
|
+
if (displayUnits === "reverseHex") {
|
|
166
|
+
const byteArray = _data.match(/.{1,2}/g) || [];
|
|
167
|
+
const reversedBytes = byteArray.map((b) => b.split("").reverse().join(""));
|
|
168
|
+
return this.hexToDecimalArray(reversedBytes.join("")).reverse();
|
|
169
|
+
}
|
|
162
170
|
return this.hexToDecimalArray(_data).reverse();
|
|
163
171
|
},
|
|
164
172
|
// getBridgeId(device: BluetoothDeviceBridge) {
|
|
@@ -1171,63 +1179,78 @@ const bridgeCommandStructures = {
|
|
|
1171
1179
|
structure: {
|
|
1172
1180
|
axle01: {
|
|
1173
1181
|
size: 8,
|
|
1174
|
-
description: "Axle 01 autolearn statuses, each nibble signifies a single wheel."
|
|
1182
|
+
description: "Axle 01 autolearn statuses, each nibble signifies a single wheel.",
|
|
1183
|
+
display: "reverseHex"
|
|
1175
1184
|
},
|
|
1176
1185
|
axle02: {
|
|
1177
1186
|
size: 8,
|
|
1178
|
-
description: "Axle 02 autolearn statuses, each nibble signifies a single wheel"
|
|
1187
|
+
description: "Axle 02 autolearn statuses, each nibble signifies a single wheel",
|
|
1188
|
+
display: "reverseHex"
|
|
1179
1189
|
},
|
|
1180
1190
|
axle03: {
|
|
1181
1191
|
size: 8,
|
|
1182
|
-
description: "Axle 03 autolearn statuses, each nibble signifies a single wheel"
|
|
1192
|
+
description: "Axle 03 autolearn statuses, each nibble signifies a single wheel",
|
|
1193
|
+
display: "reverseHex"
|
|
1183
1194
|
},
|
|
1184
1195
|
axle04: {
|
|
1185
1196
|
size: 8,
|
|
1186
|
-
description: "Axle 04 autolearn statuses, each nibble signifies a single wheel"
|
|
1197
|
+
description: "Axle 04 autolearn statuses, each nibble signifies a single wheel",
|
|
1198
|
+
display: "reverseHex"
|
|
1187
1199
|
},
|
|
1188
1200
|
axle05: {
|
|
1189
1201
|
size: 8,
|
|
1190
|
-
description: "Axle 05 autolearn statuses, each nibble signifies a single wheel"
|
|
1202
|
+
description: "Axle 05 autolearn statuses, each nibble signifies a single wheel",
|
|
1203
|
+
display: "reverseHex"
|
|
1191
1204
|
},
|
|
1192
1205
|
axle06: {
|
|
1193
1206
|
size: 8,
|
|
1194
|
-
description: "Axle 06 autolearn statuses, each nibble signifies a single wheel"
|
|
1207
|
+
description: "Axle 06 autolearn statuses, each nibble signifies a single wheel",
|
|
1208
|
+
display: "reverseHex"
|
|
1195
1209
|
},
|
|
1196
1210
|
axle07: {
|
|
1197
1211
|
size: 8,
|
|
1198
|
-
description: "Axle 07 autolearn statuses, each nibble signifies a single wheel"
|
|
1212
|
+
description: "Axle 07 autolearn statuses, each nibble signifies a single wheel",
|
|
1213
|
+
display: "reverseHex"
|
|
1199
1214
|
},
|
|
1200
1215
|
axle08: {
|
|
1201
1216
|
size: 8,
|
|
1202
|
-
description: "Axle 08 autolearn statuses, each nibble signifies a single wheel"
|
|
1217
|
+
description: "Axle 08 autolearn statuses, each nibble signifies a single wheel",
|
|
1218
|
+
display: "reverseHex"
|
|
1203
1219
|
},
|
|
1204
1220
|
axle09: {
|
|
1205
1221
|
size: 8,
|
|
1206
|
-
description: "Axle 09 autolearn statuses, each nibble signifies a single wheel"
|
|
1222
|
+
description: "Axle 09 autolearn statuses, each nibble signifies a single wheel",
|
|
1223
|
+
display: "reverseHex"
|
|
1207
1224
|
},
|
|
1208
1225
|
axle10: {
|
|
1209
1226
|
size: 8,
|
|
1210
|
-
description: "Axle 10 autolearn statuses, each nibble signifies a single wheel"
|
|
1227
|
+
description: "Axle 10 autolearn statuses, each nibble signifies a single wheel",
|
|
1228
|
+
display: "reverseHex"
|
|
1211
1229
|
},
|
|
1212
1230
|
axle11: {
|
|
1213
1231
|
size: 8,
|
|
1214
|
-
description: "Axle 11 autolearn statuses, each nibble signifies a single wheel"
|
|
1232
|
+
description: "Axle 11 autolearn statuses, each nibble signifies a single wheel",
|
|
1233
|
+
display: "reverseHex"
|
|
1215
1234
|
},
|
|
1216
1235
|
axle12: {
|
|
1217
1236
|
size: 8,
|
|
1218
|
-
description: "Axle 12 autolearn statuses, each nibble signifies a single wheel"
|
|
1237
|
+
description: "Axle 12 autolearn statuses, each nibble signifies a single wheel",
|
|
1238
|
+
display: "reverseHex"
|
|
1219
1239
|
},
|
|
1220
1240
|
axle13: {
|
|
1221
1241
|
size: 8,
|
|
1222
|
-
description: "Axle 13 autolearn statuses, each nibble signifies a single wheel"
|
|
1242
|
+
description: "Axle 13 autolearn statuses, each nibble signifies a single wheel",
|
|
1243
|
+
display: "reverseHex"
|
|
1223
1244
|
},
|
|
1224
1245
|
axle14: {
|
|
1225
1246
|
size: 8,
|
|
1226
|
-
description: "Axle 14 autolearn statuses, each nibble signifies a single wheel"
|
|
1247
|
+
description: "Axle 14 autolearn statuses, each nibble signifies a single wheel",
|
|
1248
|
+
display: "reverseHex"
|
|
1227
1249
|
},
|
|
1228
1250
|
axle15: {
|
|
1229
1251
|
size: 8,
|
|
1230
|
-
description: "Axle 15 autolearn statuses, each nibble signifies a single wheel"
|
|
1252
|
+
description: "Axle 15 autolearn statuses, each nibble signifies a single wheel",
|
|
1253
|
+
display: "reverseHex"
|
|
1231
1254
|
}
|
|
1232
1255
|
}
|
|
1233
1256
|
},
|
|
@@ -1296,6 +1319,88 @@ const bridgeCommandStructures = {
|
|
|
1296
1319
|
description: "Unknown sensor data"
|
|
1297
1320
|
}
|
|
1298
1321
|
}
|
|
1322
|
+
},
|
|
1323
|
+
vehicleLayout: {
|
|
1324
|
+
id: [98, 1],
|
|
1325
|
+
name: "vehicleLayout",
|
|
1326
|
+
structure: {
|
|
1327
|
+
axle01: {
|
|
1328
|
+
size: 2,
|
|
1329
|
+
description: "Axle 01 each bit represents present tyre."
|
|
1330
|
+
},
|
|
1331
|
+
axle02: {
|
|
1332
|
+
size: 2,
|
|
1333
|
+
description: "Axle 02 each bit represents present tyre"
|
|
1334
|
+
},
|
|
1335
|
+
axle03: {
|
|
1336
|
+
size: 2,
|
|
1337
|
+
description: "Axle 03 each bit represents present tyre"
|
|
1338
|
+
},
|
|
1339
|
+
axle04: {
|
|
1340
|
+
size: 2,
|
|
1341
|
+
description: "Axle 04 each bit represents present tyre"
|
|
1342
|
+
},
|
|
1343
|
+
axle05: {
|
|
1344
|
+
size: 2,
|
|
1345
|
+
description: "Axle 05 each bit represents present tyre"
|
|
1346
|
+
},
|
|
1347
|
+
axle06: {
|
|
1348
|
+
size: 2,
|
|
1349
|
+
description: "Axle 06 each bit represents present tyre"
|
|
1350
|
+
},
|
|
1351
|
+
axle07: {
|
|
1352
|
+
size: 2,
|
|
1353
|
+
description: "Axle 07 each bit represents present tyre"
|
|
1354
|
+
},
|
|
1355
|
+
axle08: {
|
|
1356
|
+
size: 2,
|
|
1357
|
+
description: "Axle 08 each bit represents present tyre"
|
|
1358
|
+
},
|
|
1359
|
+
axle09: {
|
|
1360
|
+
size: 2,
|
|
1361
|
+
description: "Axle 09 each bit represents present tyre"
|
|
1362
|
+
},
|
|
1363
|
+
axle10: {
|
|
1364
|
+
size: 2,
|
|
1365
|
+
description: "Axle 10 each bit represents present tyre"
|
|
1366
|
+
},
|
|
1367
|
+
axle11: {
|
|
1368
|
+
size: 2,
|
|
1369
|
+
description: "Axle 11 each bit represents present tyre"
|
|
1370
|
+
},
|
|
1371
|
+
axle12: {
|
|
1372
|
+
size: 2,
|
|
1373
|
+
description: "Axle 12 each bit represents present tyre"
|
|
1374
|
+
},
|
|
1375
|
+
axle13: {
|
|
1376
|
+
size: 2,
|
|
1377
|
+
description: "Axle 13 each bit represents present tyre"
|
|
1378
|
+
},
|
|
1379
|
+
axle14: {
|
|
1380
|
+
size: 2,
|
|
1381
|
+
description: "Axle 14 each bit represents present tyre"
|
|
1382
|
+
},
|
|
1383
|
+
axle15: {
|
|
1384
|
+
size: 2,
|
|
1385
|
+
description: "Axle 15 each bit represents present tyre"
|
|
1386
|
+
},
|
|
1387
|
+
vin: {
|
|
1388
|
+
size: 17,
|
|
1389
|
+
description: "Vehicle Identification Number",
|
|
1390
|
+
display: "ascii"
|
|
1391
|
+
},
|
|
1392
|
+
vinExtension: {
|
|
1393
|
+
size: 1,
|
|
1394
|
+
description: "VIN extension",
|
|
1395
|
+
display: "ascii",
|
|
1396
|
+
optional: true
|
|
1397
|
+
},
|
|
1398
|
+
test: {
|
|
1399
|
+
size: 3,
|
|
1400
|
+
description: "Test",
|
|
1401
|
+
optional: true
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1299
1404
|
}
|
|
1300
1405
|
};
|
|
1301
1406
|
|
|
@@ -1963,7 +2068,7 @@ const bridgeCommands = {
|
|
|
1963
2068
|
if (!canCommunicateWith(device.id)) throw new Error("Bridge not connected");
|
|
1964
2069
|
clearTimeout(keepAliveTimer);
|
|
1965
2070
|
keepAliveTimer = setTimeout(() => {
|
|
1966
|
-
if (
|
|
2071
|
+
if (store.deviceState[device.id] !== "paired" || store.devices[device.id]?.type !== "bridge") {
|
|
1967
2072
|
return;
|
|
1968
2073
|
}
|
|
1969
2074
|
this.sendKeepAliveCommand(device);
|
package/dist/index.d.cts
CHANGED
|
@@ -563,135 +563,152 @@ declare const _default: {
|
|
|
563
563
|
};
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
-
autolearnIdStatus:
|
|
566
|
+
autolearnIdStatus: BridgeCommandStructure;
|
|
567
|
+
autolearnUnknownSensors: {
|
|
567
568
|
id: number[];
|
|
568
569
|
name: string;
|
|
569
570
|
structure: {
|
|
570
|
-
|
|
571
|
+
sensor01: {
|
|
571
572
|
size: number;
|
|
572
573
|
description: string;
|
|
573
574
|
};
|
|
574
|
-
|
|
575
|
+
sensor02: {
|
|
575
576
|
size: number;
|
|
576
577
|
description: string;
|
|
577
578
|
};
|
|
578
|
-
|
|
579
|
+
sensor03: {
|
|
579
580
|
size: number;
|
|
580
581
|
description: string;
|
|
581
582
|
};
|
|
582
|
-
|
|
583
|
+
sensor04: {
|
|
583
584
|
size: number;
|
|
584
585
|
description: string;
|
|
585
586
|
};
|
|
586
|
-
|
|
587
|
+
sensor05: {
|
|
587
588
|
size: number;
|
|
588
589
|
description: string;
|
|
589
590
|
};
|
|
590
|
-
|
|
591
|
+
sensor06: {
|
|
591
592
|
size: number;
|
|
592
593
|
description: string;
|
|
593
594
|
};
|
|
594
|
-
|
|
595
|
+
sensor07: {
|
|
595
596
|
size: number;
|
|
596
597
|
description: string;
|
|
597
598
|
};
|
|
598
|
-
|
|
599
|
+
sensor08: {
|
|
599
600
|
size: number;
|
|
600
601
|
description: string;
|
|
601
602
|
};
|
|
602
|
-
|
|
603
|
+
sensor09: {
|
|
603
604
|
size: number;
|
|
604
605
|
description: string;
|
|
605
606
|
};
|
|
606
|
-
|
|
607
|
+
sensor10: {
|
|
607
608
|
size: number;
|
|
608
609
|
description: string;
|
|
609
610
|
};
|
|
610
|
-
|
|
611
|
+
sensor11: {
|
|
611
612
|
size: number;
|
|
612
613
|
description: string;
|
|
613
614
|
};
|
|
614
|
-
|
|
615
|
+
sensor12: {
|
|
615
616
|
size: number;
|
|
616
617
|
description: string;
|
|
617
618
|
};
|
|
618
|
-
|
|
619
|
+
sensor13: {
|
|
619
620
|
size: number;
|
|
620
621
|
description: string;
|
|
621
622
|
};
|
|
622
|
-
|
|
623
|
+
sensor14: {
|
|
623
624
|
size: number;
|
|
624
625
|
description: string;
|
|
625
626
|
};
|
|
626
|
-
|
|
627
|
+
sensor15: {
|
|
627
628
|
size: number;
|
|
628
629
|
description: string;
|
|
629
630
|
};
|
|
630
631
|
};
|
|
631
632
|
};
|
|
632
|
-
|
|
633
|
+
vehicleLayout: {
|
|
633
634
|
id: number[];
|
|
634
635
|
name: string;
|
|
635
636
|
structure: {
|
|
636
|
-
|
|
637
|
+
axle01: {
|
|
637
638
|
size: number;
|
|
638
639
|
description: string;
|
|
639
640
|
};
|
|
640
|
-
|
|
641
|
+
axle02: {
|
|
641
642
|
size: number;
|
|
642
643
|
description: string;
|
|
643
644
|
};
|
|
644
|
-
|
|
645
|
+
axle03: {
|
|
645
646
|
size: number;
|
|
646
647
|
description: string;
|
|
647
648
|
};
|
|
648
|
-
|
|
649
|
+
axle04: {
|
|
649
650
|
size: number;
|
|
650
651
|
description: string;
|
|
651
652
|
};
|
|
652
|
-
|
|
653
|
+
axle05: {
|
|
653
654
|
size: number;
|
|
654
655
|
description: string;
|
|
655
656
|
};
|
|
656
|
-
|
|
657
|
+
axle06: {
|
|
657
658
|
size: number;
|
|
658
659
|
description: string;
|
|
659
660
|
};
|
|
660
|
-
|
|
661
|
+
axle07: {
|
|
661
662
|
size: number;
|
|
662
663
|
description: string;
|
|
663
664
|
};
|
|
664
|
-
|
|
665
|
+
axle08: {
|
|
665
666
|
size: number;
|
|
666
667
|
description: string;
|
|
667
668
|
};
|
|
668
|
-
|
|
669
|
+
axle09: {
|
|
669
670
|
size: number;
|
|
670
671
|
description: string;
|
|
671
672
|
};
|
|
672
|
-
|
|
673
|
+
axle10: {
|
|
673
674
|
size: number;
|
|
674
675
|
description: string;
|
|
675
676
|
};
|
|
676
|
-
|
|
677
|
+
axle11: {
|
|
677
678
|
size: number;
|
|
678
679
|
description: string;
|
|
679
680
|
};
|
|
680
|
-
|
|
681
|
+
axle12: {
|
|
681
682
|
size: number;
|
|
682
683
|
description: string;
|
|
683
684
|
};
|
|
684
|
-
|
|
685
|
+
axle13: {
|
|
685
686
|
size: number;
|
|
686
687
|
description: string;
|
|
687
688
|
};
|
|
688
|
-
|
|
689
|
+
axle14: {
|
|
689
690
|
size: number;
|
|
690
691
|
description: string;
|
|
691
692
|
};
|
|
692
|
-
|
|
693
|
+
axle15: {
|
|
694
|
+
size: number;
|
|
695
|
+
description: string;
|
|
696
|
+
};
|
|
697
|
+
vin: {
|
|
698
|
+
size: number;
|
|
699
|
+
description: string;
|
|
700
|
+
display: "ascii";
|
|
701
|
+
};
|
|
702
|
+
vinExtension: {
|
|
703
|
+
size: number;
|
|
704
|
+
description: string;
|
|
705
|
+
display: "ascii";
|
|
706
|
+
optional: true;
|
|
707
|
+
};
|
|
708
|
+
test: {
|
|
693
709
|
size: number;
|
|
694
710
|
description: string;
|
|
711
|
+
optional: true;
|
|
695
712
|
};
|
|
696
713
|
};
|
|
697
714
|
};
|
|
@@ -807,7 +824,7 @@ interface BridgeCommandStructure {
|
|
|
807
824
|
interface BridgeCommandStructureProperties {
|
|
808
825
|
[propName: string]: {
|
|
809
826
|
size: number;
|
|
810
|
-
display?: 'decimal' | 'ascii';
|
|
827
|
+
display?: 'decimal' | 'ascii' | 'reverseHex';
|
|
811
828
|
description: string;
|
|
812
829
|
optional?: boolean;
|
|
813
830
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -563,135 +563,152 @@ declare const _default: {
|
|
|
563
563
|
};
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
-
autolearnIdStatus:
|
|
566
|
+
autolearnIdStatus: BridgeCommandStructure;
|
|
567
|
+
autolearnUnknownSensors: {
|
|
567
568
|
id: number[];
|
|
568
569
|
name: string;
|
|
569
570
|
structure: {
|
|
570
|
-
|
|
571
|
+
sensor01: {
|
|
571
572
|
size: number;
|
|
572
573
|
description: string;
|
|
573
574
|
};
|
|
574
|
-
|
|
575
|
+
sensor02: {
|
|
575
576
|
size: number;
|
|
576
577
|
description: string;
|
|
577
578
|
};
|
|
578
|
-
|
|
579
|
+
sensor03: {
|
|
579
580
|
size: number;
|
|
580
581
|
description: string;
|
|
581
582
|
};
|
|
582
|
-
|
|
583
|
+
sensor04: {
|
|
583
584
|
size: number;
|
|
584
585
|
description: string;
|
|
585
586
|
};
|
|
586
|
-
|
|
587
|
+
sensor05: {
|
|
587
588
|
size: number;
|
|
588
589
|
description: string;
|
|
589
590
|
};
|
|
590
|
-
|
|
591
|
+
sensor06: {
|
|
591
592
|
size: number;
|
|
592
593
|
description: string;
|
|
593
594
|
};
|
|
594
|
-
|
|
595
|
+
sensor07: {
|
|
595
596
|
size: number;
|
|
596
597
|
description: string;
|
|
597
598
|
};
|
|
598
|
-
|
|
599
|
+
sensor08: {
|
|
599
600
|
size: number;
|
|
600
601
|
description: string;
|
|
601
602
|
};
|
|
602
|
-
|
|
603
|
+
sensor09: {
|
|
603
604
|
size: number;
|
|
604
605
|
description: string;
|
|
605
606
|
};
|
|
606
|
-
|
|
607
|
+
sensor10: {
|
|
607
608
|
size: number;
|
|
608
609
|
description: string;
|
|
609
610
|
};
|
|
610
|
-
|
|
611
|
+
sensor11: {
|
|
611
612
|
size: number;
|
|
612
613
|
description: string;
|
|
613
614
|
};
|
|
614
|
-
|
|
615
|
+
sensor12: {
|
|
615
616
|
size: number;
|
|
616
617
|
description: string;
|
|
617
618
|
};
|
|
618
|
-
|
|
619
|
+
sensor13: {
|
|
619
620
|
size: number;
|
|
620
621
|
description: string;
|
|
621
622
|
};
|
|
622
|
-
|
|
623
|
+
sensor14: {
|
|
623
624
|
size: number;
|
|
624
625
|
description: string;
|
|
625
626
|
};
|
|
626
|
-
|
|
627
|
+
sensor15: {
|
|
627
628
|
size: number;
|
|
628
629
|
description: string;
|
|
629
630
|
};
|
|
630
631
|
};
|
|
631
632
|
};
|
|
632
|
-
|
|
633
|
+
vehicleLayout: {
|
|
633
634
|
id: number[];
|
|
634
635
|
name: string;
|
|
635
636
|
structure: {
|
|
636
|
-
|
|
637
|
+
axle01: {
|
|
637
638
|
size: number;
|
|
638
639
|
description: string;
|
|
639
640
|
};
|
|
640
|
-
|
|
641
|
+
axle02: {
|
|
641
642
|
size: number;
|
|
642
643
|
description: string;
|
|
643
644
|
};
|
|
644
|
-
|
|
645
|
+
axle03: {
|
|
645
646
|
size: number;
|
|
646
647
|
description: string;
|
|
647
648
|
};
|
|
648
|
-
|
|
649
|
+
axle04: {
|
|
649
650
|
size: number;
|
|
650
651
|
description: string;
|
|
651
652
|
};
|
|
652
|
-
|
|
653
|
+
axle05: {
|
|
653
654
|
size: number;
|
|
654
655
|
description: string;
|
|
655
656
|
};
|
|
656
|
-
|
|
657
|
+
axle06: {
|
|
657
658
|
size: number;
|
|
658
659
|
description: string;
|
|
659
660
|
};
|
|
660
|
-
|
|
661
|
+
axle07: {
|
|
661
662
|
size: number;
|
|
662
663
|
description: string;
|
|
663
664
|
};
|
|
664
|
-
|
|
665
|
+
axle08: {
|
|
665
666
|
size: number;
|
|
666
667
|
description: string;
|
|
667
668
|
};
|
|
668
|
-
|
|
669
|
+
axle09: {
|
|
669
670
|
size: number;
|
|
670
671
|
description: string;
|
|
671
672
|
};
|
|
672
|
-
|
|
673
|
+
axle10: {
|
|
673
674
|
size: number;
|
|
674
675
|
description: string;
|
|
675
676
|
};
|
|
676
|
-
|
|
677
|
+
axle11: {
|
|
677
678
|
size: number;
|
|
678
679
|
description: string;
|
|
679
680
|
};
|
|
680
|
-
|
|
681
|
+
axle12: {
|
|
681
682
|
size: number;
|
|
682
683
|
description: string;
|
|
683
684
|
};
|
|
684
|
-
|
|
685
|
+
axle13: {
|
|
685
686
|
size: number;
|
|
686
687
|
description: string;
|
|
687
688
|
};
|
|
688
|
-
|
|
689
|
+
axle14: {
|
|
689
690
|
size: number;
|
|
690
691
|
description: string;
|
|
691
692
|
};
|
|
692
|
-
|
|
693
|
+
axle15: {
|
|
694
|
+
size: number;
|
|
695
|
+
description: string;
|
|
696
|
+
};
|
|
697
|
+
vin: {
|
|
698
|
+
size: number;
|
|
699
|
+
description: string;
|
|
700
|
+
display: "ascii";
|
|
701
|
+
};
|
|
702
|
+
vinExtension: {
|
|
703
|
+
size: number;
|
|
704
|
+
description: string;
|
|
705
|
+
display: "ascii";
|
|
706
|
+
optional: true;
|
|
707
|
+
};
|
|
708
|
+
test: {
|
|
693
709
|
size: number;
|
|
694
710
|
description: string;
|
|
711
|
+
optional: true;
|
|
695
712
|
};
|
|
696
713
|
};
|
|
697
714
|
};
|
|
@@ -807,7 +824,7 @@ interface BridgeCommandStructure {
|
|
|
807
824
|
interface BridgeCommandStructureProperties {
|
|
808
825
|
[propName: string]: {
|
|
809
826
|
size: number;
|
|
810
|
-
display?: 'decimal' | 'ascii';
|
|
827
|
+
display?: 'decimal' | 'ascii' | 'reverseHex';
|
|
811
828
|
description: string;
|
|
812
829
|
optional?: boolean;
|
|
813
830
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -563,135 +563,152 @@ declare const _default: {
|
|
|
563
563
|
};
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
-
autolearnIdStatus:
|
|
566
|
+
autolearnIdStatus: BridgeCommandStructure;
|
|
567
|
+
autolearnUnknownSensors: {
|
|
567
568
|
id: number[];
|
|
568
569
|
name: string;
|
|
569
570
|
structure: {
|
|
570
|
-
|
|
571
|
+
sensor01: {
|
|
571
572
|
size: number;
|
|
572
573
|
description: string;
|
|
573
574
|
};
|
|
574
|
-
|
|
575
|
+
sensor02: {
|
|
575
576
|
size: number;
|
|
576
577
|
description: string;
|
|
577
578
|
};
|
|
578
|
-
|
|
579
|
+
sensor03: {
|
|
579
580
|
size: number;
|
|
580
581
|
description: string;
|
|
581
582
|
};
|
|
582
|
-
|
|
583
|
+
sensor04: {
|
|
583
584
|
size: number;
|
|
584
585
|
description: string;
|
|
585
586
|
};
|
|
586
|
-
|
|
587
|
+
sensor05: {
|
|
587
588
|
size: number;
|
|
588
589
|
description: string;
|
|
589
590
|
};
|
|
590
|
-
|
|
591
|
+
sensor06: {
|
|
591
592
|
size: number;
|
|
592
593
|
description: string;
|
|
593
594
|
};
|
|
594
|
-
|
|
595
|
+
sensor07: {
|
|
595
596
|
size: number;
|
|
596
597
|
description: string;
|
|
597
598
|
};
|
|
598
|
-
|
|
599
|
+
sensor08: {
|
|
599
600
|
size: number;
|
|
600
601
|
description: string;
|
|
601
602
|
};
|
|
602
|
-
|
|
603
|
+
sensor09: {
|
|
603
604
|
size: number;
|
|
604
605
|
description: string;
|
|
605
606
|
};
|
|
606
|
-
|
|
607
|
+
sensor10: {
|
|
607
608
|
size: number;
|
|
608
609
|
description: string;
|
|
609
610
|
};
|
|
610
|
-
|
|
611
|
+
sensor11: {
|
|
611
612
|
size: number;
|
|
612
613
|
description: string;
|
|
613
614
|
};
|
|
614
|
-
|
|
615
|
+
sensor12: {
|
|
615
616
|
size: number;
|
|
616
617
|
description: string;
|
|
617
618
|
};
|
|
618
|
-
|
|
619
|
+
sensor13: {
|
|
619
620
|
size: number;
|
|
620
621
|
description: string;
|
|
621
622
|
};
|
|
622
|
-
|
|
623
|
+
sensor14: {
|
|
623
624
|
size: number;
|
|
624
625
|
description: string;
|
|
625
626
|
};
|
|
626
|
-
|
|
627
|
+
sensor15: {
|
|
627
628
|
size: number;
|
|
628
629
|
description: string;
|
|
629
630
|
};
|
|
630
631
|
};
|
|
631
632
|
};
|
|
632
|
-
|
|
633
|
+
vehicleLayout: {
|
|
633
634
|
id: number[];
|
|
634
635
|
name: string;
|
|
635
636
|
structure: {
|
|
636
|
-
|
|
637
|
+
axle01: {
|
|
637
638
|
size: number;
|
|
638
639
|
description: string;
|
|
639
640
|
};
|
|
640
|
-
|
|
641
|
+
axle02: {
|
|
641
642
|
size: number;
|
|
642
643
|
description: string;
|
|
643
644
|
};
|
|
644
|
-
|
|
645
|
+
axle03: {
|
|
645
646
|
size: number;
|
|
646
647
|
description: string;
|
|
647
648
|
};
|
|
648
|
-
|
|
649
|
+
axle04: {
|
|
649
650
|
size: number;
|
|
650
651
|
description: string;
|
|
651
652
|
};
|
|
652
|
-
|
|
653
|
+
axle05: {
|
|
653
654
|
size: number;
|
|
654
655
|
description: string;
|
|
655
656
|
};
|
|
656
|
-
|
|
657
|
+
axle06: {
|
|
657
658
|
size: number;
|
|
658
659
|
description: string;
|
|
659
660
|
};
|
|
660
|
-
|
|
661
|
+
axle07: {
|
|
661
662
|
size: number;
|
|
662
663
|
description: string;
|
|
663
664
|
};
|
|
664
|
-
|
|
665
|
+
axle08: {
|
|
665
666
|
size: number;
|
|
666
667
|
description: string;
|
|
667
668
|
};
|
|
668
|
-
|
|
669
|
+
axle09: {
|
|
669
670
|
size: number;
|
|
670
671
|
description: string;
|
|
671
672
|
};
|
|
672
|
-
|
|
673
|
+
axle10: {
|
|
673
674
|
size: number;
|
|
674
675
|
description: string;
|
|
675
676
|
};
|
|
676
|
-
|
|
677
|
+
axle11: {
|
|
677
678
|
size: number;
|
|
678
679
|
description: string;
|
|
679
680
|
};
|
|
680
|
-
|
|
681
|
+
axle12: {
|
|
681
682
|
size: number;
|
|
682
683
|
description: string;
|
|
683
684
|
};
|
|
684
|
-
|
|
685
|
+
axle13: {
|
|
685
686
|
size: number;
|
|
686
687
|
description: string;
|
|
687
688
|
};
|
|
688
|
-
|
|
689
|
+
axle14: {
|
|
689
690
|
size: number;
|
|
690
691
|
description: string;
|
|
691
692
|
};
|
|
692
|
-
|
|
693
|
+
axle15: {
|
|
694
|
+
size: number;
|
|
695
|
+
description: string;
|
|
696
|
+
};
|
|
697
|
+
vin: {
|
|
698
|
+
size: number;
|
|
699
|
+
description: string;
|
|
700
|
+
display: "ascii";
|
|
701
|
+
};
|
|
702
|
+
vinExtension: {
|
|
703
|
+
size: number;
|
|
704
|
+
description: string;
|
|
705
|
+
display: "ascii";
|
|
706
|
+
optional: true;
|
|
707
|
+
};
|
|
708
|
+
test: {
|
|
693
709
|
size: number;
|
|
694
710
|
description: string;
|
|
711
|
+
optional: true;
|
|
695
712
|
};
|
|
696
713
|
};
|
|
697
714
|
};
|
|
@@ -807,7 +824,7 @@ interface BridgeCommandStructure {
|
|
|
807
824
|
interface BridgeCommandStructureProperties {
|
|
808
825
|
[propName: string]: {
|
|
809
826
|
size: number;
|
|
810
|
-
display?: 'decimal' | 'ascii';
|
|
827
|
+
display?: 'decimal' | 'ascii' | 'reverseHex';
|
|
811
828
|
description: string;
|
|
812
829
|
optional?: boolean;
|
|
813
830
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -142,6 +142,9 @@ const bridgeTools = {
|
|
|
142
142
|
if (displayUnits === "decimal") {
|
|
143
143
|
return Number(`0x${_reversedData.map((dec) => this.decimalToHex(dec)).join("")}`.replace(/\r\n/g, ""));
|
|
144
144
|
}
|
|
145
|
+
if (displayUnits === "reverseHex") {
|
|
146
|
+
return _reversedData.map((dec) => this.decimalToHex(dec).split("").reverse().join("")).join("");
|
|
147
|
+
}
|
|
145
148
|
return _reversedData.map((dec) => this.decimalToHex(dec)).join("");
|
|
146
149
|
},
|
|
147
150
|
encodeData(data, displayUnits) {
|
|
@@ -152,6 +155,11 @@ const bridgeTools = {
|
|
|
152
155
|
if (displayUnits === "decimal") {
|
|
153
156
|
return this.hexToDecimalArray(this.decimalToHex(_data)).reverse();
|
|
154
157
|
}
|
|
158
|
+
if (displayUnits === "reverseHex") {
|
|
159
|
+
const byteArray = _data.match(/.{1,2}/g) || [];
|
|
160
|
+
const reversedBytes = byteArray.map((b) => b.split("").reverse().join(""));
|
|
161
|
+
return this.hexToDecimalArray(reversedBytes.join("")).reverse();
|
|
162
|
+
}
|
|
155
163
|
return this.hexToDecimalArray(_data).reverse();
|
|
156
164
|
},
|
|
157
165
|
// getBridgeId(device: BluetoothDeviceBridge) {
|
|
@@ -1164,63 +1172,78 @@ const bridgeCommandStructures = {
|
|
|
1164
1172
|
structure: {
|
|
1165
1173
|
axle01: {
|
|
1166
1174
|
size: 8,
|
|
1167
|
-
description: "Axle 01 autolearn statuses, each nibble signifies a single wheel."
|
|
1175
|
+
description: "Axle 01 autolearn statuses, each nibble signifies a single wheel.",
|
|
1176
|
+
display: "reverseHex"
|
|
1168
1177
|
},
|
|
1169
1178
|
axle02: {
|
|
1170
1179
|
size: 8,
|
|
1171
|
-
description: "Axle 02 autolearn statuses, each nibble signifies a single wheel"
|
|
1180
|
+
description: "Axle 02 autolearn statuses, each nibble signifies a single wheel",
|
|
1181
|
+
display: "reverseHex"
|
|
1172
1182
|
},
|
|
1173
1183
|
axle03: {
|
|
1174
1184
|
size: 8,
|
|
1175
|
-
description: "Axle 03 autolearn statuses, each nibble signifies a single wheel"
|
|
1185
|
+
description: "Axle 03 autolearn statuses, each nibble signifies a single wheel",
|
|
1186
|
+
display: "reverseHex"
|
|
1176
1187
|
},
|
|
1177
1188
|
axle04: {
|
|
1178
1189
|
size: 8,
|
|
1179
|
-
description: "Axle 04 autolearn statuses, each nibble signifies a single wheel"
|
|
1190
|
+
description: "Axle 04 autolearn statuses, each nibble signifies a single wheel",
|
|
1191
|
+
display: "reverseHex"
|
|
1180
1192
|
},
|
|
1181
1193
|
axle05: {
|
|
1182
1194
|
size: 8,
|
|
1183
|
-
description: "Axle 05 autolearn statuses, each nibble signifies a single wheel"
|
|
1195
|
+
description: "Axle 05 autolearn statuses, each nibble signifies a single wheel",
|
|
1196
|
+
display: "reverseHex"
|
|
1184
1197
|
},
|
|
1185
1198
|
axle06: {
|
|
1186
1199
|
size: 8,
|
|
1187
|
-
description: "Axle 06 autolearn statuses, each nibble signifies a single wheel"
|
|
1200
|
+
description: "Axle 06 autolearn statuses, each nibble signifies a single wheel",
|
|
1201
|
+
display: "reverseHex"
|
|
1188
1202
|
},
|
|
1189
1203
|
axle07: {
|
|
1190
1204
|
size: 8,
|
|
1191
|
-
description: "Axle 07 autolearn statuses, each nibble signifies a single wheel"
|
|
1205
|
+
description: "Axle 07 autolearn statuses, each nibble signifies a single wheel",
|
|
1206
|
+
display: "reverseHex"
|
|
1192
1207
|
},
|
|
1193
1208
|
axle08: {
|
|
1194
1209
|
size: 8,
|
|
1195
|
-
description: "Axle 08 autolearn statuses, each nibble signifies a single wheel"
|
|
1210
|
+
description: "Axle 08 autolearn statuses, each nibble signifies a single wheel",
|
|
1211
|
+
display: "reverseHex"
|
|
1196
1212
|
},
|
|
1197
1213
|
axle09: {
|
|
1198
1214
|
size: 8,
|
|
1199
|
-
description: "Axle 09 autolearn statuses, each nibble signifies a single wheel"
|
|
1215
|
+
description: "Axle 09 autolearn statuses, each nibble signifies a single wheel",
|
|
1216
|
+
display: "reverseHex"
|
|
1200
1217
|
},
|
|
1201
1218
|
axle10: {
|
|
1202
1219
|
size: 8,
|
|
1203
|
-
description: "Axle 10 autolearn statuses, each nibble signifies a single wheel"
|
|
1220
|
+
description: "Axle 10 autolearn statuses, each nibble signifies a single wheel",
|
|
1221
|
+
display: "reverseHex"
|
|
1204
1222
|
},
|
|
1205
1223
|
axle11: {
|
|
1206
1224
|
size: 8,
|
|
1207
|
-
description: "Axle 11 autolearn statuses, each nibble signifies a single wheel"
|
|
1225
|
+
description: "Axle 11 autolearn statuses, each nibble signifies a single wheel",
|
|
1226
|
+
display: "reverseHex"
|
|
1208
1227
|
},
|
|
1209
1228
|
axle12: {
|
|
1210
1229
|
size: 8,
|
|
1211
|
-
description: "Axle 12 autolearn statuses, each nibble signifies a single wheel"
|
|
1230
|
+
description: "Axle 12 autolearn statuses, each nibble signifies a single wheel",
|
|
1231
|
+
display: "reverseHex"
|
|
1212
1232
|
},
|
|
1213
1233
|
axle13: {
|
|
1214
1234
|
size: 8,
|
|
1215
|
-
description: "Axle 13 autolearn statuses, each nibble signifies a single wheel"
|
|
1235
|
+
description: "Axle 13 autolearn statuses, each nibble signifies a single wheel",
|
|
1236
|
+
display: "reverseHex"
|
|
1216
1237
|
},
|
|
1217
1238
|
axle14: {
|
|
1218
1239
|
size: 8,
|
|
1219
|
-
description: "Axle 14 autolearn statuses, each nibble signifies a single wheel"
|
|
1240
|
+
description: "Axle 14 autolearn statuses, each nibble signifies a single wheel",
|
|
1241
|
+
display: "reverseHex"
|
|
1220
1242
|
},
|
|
1221
1243
|
axle15: {
|
|
1222
1244
|
size: 8,
|
|
1223
|
-
description: "Axle 15 autolearn statuses, each nibble signifies a single wheel"
|
|
1245
|
+
description: "Axle 15 autolearn statuses, each nibble signifies a single wheel",
|
|
1246
|
+
display: "reverseHex"
|
|
1224
1247
|
}
|
|
1225
1248
|
}
|
|
1226
1249
|
},
|
|
@@ -1289,6 +1312,88 @@ const bridgeCommandStructures = {
|
|
|
1289
1312
|
description: "Unknown sensor data"
|
|
1290
1313
|
}
|
|
1291
1314
|
}
|
|
1315
|
+
},
|
|
1316
|
+
vehicleLayout: {
|
|
1317
|
+
id: [98, 1],
|
|
1318
|
+
name: "vehicleLayout",
|
|
1319
|
+
structure: {
|
|
1320
|
+
axle01: {
|
|
1321
|
+
size: 2,
|
|
1322
|
+
description: "Axle 01 each bit represents present tyre."
|
|
1323
|
+
},
|
|
1324
|
+
axle02: {
|
|
1325
|
+
size: 2,
|
|
1326
|
+
description: "Axle 02 each bit represents present tyre"
|
|
1327
|
+
},
|
|
1328
|
+
axle03: {
|
|
1329
|
+
size: 2,
|
|
1330
|
+
description: "Axle 03 each bit represents present tyre"
|
|
1331
|
+
},
|
|
1332
|
+
axle04: {
|
|
1333
|
+
size: 2,
|
|
1334
|
+
description: "Axle 04 each bit represents present tyre"
|
|
1335
|
+
},
|
|
1336
|
+
axle05: {
|
|
1337
|
+
size: 2,
|
|
1338
|
+
description: "Axle 05 each bit represents present tyre"
|
|
1339
|
+
},
|
|
1340
|
+
axle06: {
|
|
1341
|
+
size: 2,
|
|
1342
|
+
description: "Axle 06 each bit represents present tyre"
|
|
1343
|
+
},
|
|
1344
|
+
axle07: {
|
|
1345
|
+
size: 2,
|
|
1346
|
+
description: "Axle 07 each bit represents present tyre"
|
|
1347
|
+
},
|
|
1348
|
+
axle08: {
|
|
1349
|
+
size: 2,
|
|
1350
|
+
description: "Axle 08 each bit represents present tyre"
|
|
1351
|
+
},
|
|
1352
|
+
axle09: {
|
|
1353
|
+
size: 2,
|
|
1354
|
+
description: "Axle 09 each bit represents present tyre"
|
|
1355
|
+
},
|
|
1356
|
+
axle10: {
|
|
1357
|
+
size: 2,
|
|
1358
|
+
description: "Axle 10 each bit represents present tyre"
|
|
1359
|
+
},
|
|
1360
|
+
axle11: {
|
|
1361
|
+
size: 2,
|
|
1362
|
+
description: "Axle 11 each bit represents present tyre"
|
|
1363
|
+
},
|
|
1364
|
+
axle12: {
|
|
1365
|
+
size: 2,
|
|
1366
|
+
description: "Axle 12 each bit represents present tyre"
|
|
1367
|
+
},
|
|
1368
|
+
axle13: {
|
|
1369
|
+
size: 2,
|
|
1370
|
+
description: "Axle 13 each bit represents present tyre"
|
|
1371
|
+
},
|
|
1372
|
+
axle14: {
|
|
1373
|
+
size: 2,
|
|
1374
|
+
description: "Axle 14 each bit represents present tyre"
|
|
1375
|
+
},
|
|
1376
|
+
axle15: {
|
|
1377
|
+
size: 2,
|
|
1378
|
+
description: "Axle 15 each bit represents present tyre"
|
|
1379
|
+
},
|
|
1380
|
+
vin: {
|
|
1381
|
+
size: 17,
|
|
1382
|
+
description: "Vehicle Identification Number",
|
|
1383
|
+
display: "ascii"
|
|
1384
|
+
},
|
|
1385
|
+
vinExtension: {
|
|
1386
|
+
size: 1,
|
|
1387
|
+
description: "VIN extension",
|
|
1388
|
+
display: "ascii",
|
|
1389
|
+
optional: true
|
|
1390
|
+
},
|
|
1391
|
+
test: {
|
|
1392
|
+
size: 3,
|
|
1393
|
+
description: "Test",
|
|
1394
|
+
optional: true
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1292
1397
|
}
|
|
1293
1398
|
};
|
|
1294
1399
|
|
|
@@ -1956,7 +2061,7 @@ const bridgeCommands = {
|
|
|
1956
2061
|
if (!canCommunicateWith(device.id)) throw new Error("Bridge not connected");
|
|
1957
2062
|
clearTimeout(keepAliveTimer);
|
|
1958
2063
|
keepAliveTimer = setTimeout(() => {
|
|
1959
|
-
if (
|
|
2064
|
+
if (store.deviceState[device.id] !== "paired" || store.devices[device.id]?.type !== "bridge") {
|
|
1960
2065
|
return;
|
|
1961
2066
|
}
|
|
1962
2067
|
this.sendKeepAliveCommand(device);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tirecheck-device-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.91",
|
|
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",
|