tirecheck-device-sdk 0.2.70 → 0.2.72

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.d.cts CHANGED
@@ -1,3 +1,44 @@
1
+ interface UnitechListenerHandle {
2
+ remove: () => Promise<void>;
3
+ }
4
+ interface ReaderStateEvent {
5
+ state: string;
6
+ }
7
+ interface ActionStateEvent {
8
+ state: string;
9
+ }
10
+ interface TriggerEvent {
11
+ pressed: boolean;
12
+ }
13
+ interface TagReadEvent {
14
+ epc: string;
15
+ rssi: number;
16
+ [key: string]: unknown;
17
+ }
18
+ interface BatteryEvent {
19
+ percent: number;
20
+ }
21
+ interface TemperatureEvent {
22
+ celsius: number;
23
+ }
24
+ interface UnitechRfidImplementation {
25
+ removeAllListeners: () => Promise<void>;
26
+ addListener: ((eventName: 'readerState', listener: (event: ReaderStateEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'actionState', listener: (event: ActionStateEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'trigger', listener: (event: TriggerEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'tagRead', listener: (event: TagReadEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'battery', listener: (event: BatteryEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'temperature', listener: (event: TemperatureEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>);
27
+ startDetect: (options: {
28
+ deviceName: string;
29
+ }) => Promise<void>;
30
+ stopDetect: () => Promise<void>;
31
+ connect: (options: {
32
+ bluetoothAddress?: string;
33
+ }) => Promise<{
34
+ connected: boolean;
35
+ }>;
36
+ disconnect: () => Promise<void>;
37
+ initDeviceSettings: () => Promise<void>;
38
+ startInventory: () => Promise<void>;
39
+ stopInventory: () => Promise<void>;
40
+ }
41
+
1
42
  interface BleImplementation {
2
43
  startScanWithOptions: (services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure?: (error: string) => any) => void;
3
44
  stopScan: () => Promise<void>;
@@ -118,6 +159,11 @@ declare const _default$1: {
118
159
  };
119
160
  getDeviceInfoFromAdvertising: (device: PeripheralData) => BleTorqueWrench;
120
161
  };
162
+ unitechRfid: {
163
+ nameRegex: RegExp;
164
+ transport: "serial";
165
+ getDeviceInfoFromAdvertising: (device: PeripheralData) => BleUnitechRfid;
166
+ };
121
167
  };
122
168
 
123
169
  declare const _default: {
@@ -927,6 +973,109 @@ declare const _default: {
927
973
  };
928
974
  };
929
975
  };
976
+ bridgeConfiguration: {
977
+ id: number[];
978
+ name: string;
979
+ structure: {
980
+ configVersion: {
981
+ size: number;
982
+ description: string;
983
+ display: "decimal";
984
+ };
985
+ bleTxPower: {
986
+ size: number;
987
+ description: string;
988
+ display: "decimal";
989
+ };
990
+ bleTxChannels: {
991
+ size: number;
992
+ description: string;
993
+ };
994
+ bleConnectableAdvPeriod: {
995
+ size: number;
996
+ description: string;
997
+ display: "decimal";
998
+ };
999
+ configurationFlags: {
1000
+ size: number;
1001
+ description: string;
1002
+ };
1003
+ wrongPinsUntilLockout: {
1004
+ size: number;
1005
+ description: string;
1006
+ display: "decimal";
1007
+ };
1008
+ maxLockoutPeriodIncreases: {
1009
+ size: number;
1010
+ description: string;
1011
+ display: "decimal";
1012
+ };
1013
+ wrongPinInitialLockoutTime: {
1014
+ size: number;
1015
+ description: string;
1016
+ display: "decimal";
1017
+ };
1018
+ securityConfiguration: {
1019
+ size: number;
1020
+ description: string;
1021
+ };
1022
+ canEnabled: {
1023
+ size: number;
1024
+ description: string;
1025
+ display: "decimal";
1026
+ };
1027
+ bleEnabled: {
1028
+ size: number;
1029
+ description: string;
1030
+ display: "decimal";
1031
+ };
1032
+ canBitrate: {
1033
+ size: number;
1034
+ description: string;
1035
+ display: "decimal";
1036
+ };
1037
+ movementDetectionLimit: {
1038
+ size: number;
1039
+ description: string;
1040
+ display: "decimal";
1041
+ };
1042
+ sensorInactivityTimeout: {
1043
+ size: number;
1044
+ description: string;
1045
+ display: "decimal";
1046
+ };
1047
+ manufacturerCode: {
1048
+ size: number;
1049
+ description: string;
1050
+ display: "decimal";
1051
+ };
1052
+ identityNumber: {
1053
+ size: number;
1054
+ description: string;
1055
+ display: "decimal";
1056
+ };
1057
+ manufacturerName: {
1058
+ size: number;
1059
+ description: string;
1060
+ display: "ascii";
1061
+ };
1062
+ ecuPartNumber: {
1063
+ size: number;
1064
+ description: string;
1065
+ display: "ascii";
1066
+ };
1067
+ softwareVersion: {
1068
+ size: number;
1069
+ description: string;
1070
+ display: "ascii";
1071
+ };
1072
+ reservedConfiguration: {
1073
+ size: number;
1074
+ description: string;
1075
+ display: "decimal";
1076
+ };
1077
+ };
1078
+ };
930
1079
  };
931
1080
 
932
1081
  type DeepPartial<T> = T extends object ? {
@@ -1018,15 +1167,14 @@ interface BridgeConfiguration {
1018
1167
  eolStatus?: BridgeCommandStructurized<typeof _default.eolStatus.structure>;
1019
1168
  /** only available after 0.9.8 fw */
1020
1169
  autolearnSettings?: BridgeCommandStructurized<typeof _default.autolearnSettings.structure>;
1021
- vehicleLayout?: BridgeCommandStructurized<typeof _default.vehicleLayout.structure>;
1022
- /** Per-axle wheel sensor IDs, indexed by axle (0-14). Each entry holds the 15 wheel slots of one axle. */
1023
- axleInfo?: BridgeCommandStructurized<typeof _default.idsPerWheel.structure>[];
1024
1170
  /** Parsed 0x90 SW Version DID (BT stack, config data version, BLE chip compilation date, BT chip FW version). */
1025
1171
  firmwareVersion?: BridgeCommandStructurized<typeof _default.firmwareVersion.structure>;
1026
1172
  /** only available after 0.9.7 fw */
1027
1173
  autolearnIdStatus?: BridgeCommandStructurized<typeof _default.autolearnIdStatus.structure>;
1028
1174
  /** only available after 0.9.7 fw */
1029
1175
  autolearnUnknownSensors?: BridgeCommandStructurized<typeof _default.autolearnUnknownSensors.structure>;
1176
+ /** R10/R141 software identification numbers, computed app-side from config records. */
1177
+ rxswin?: RxSwinResult;
1030
1178
  }
1031
1179
  interface BridgeReading {
1032
1180
  date: number;
@@ -1095,7 +1243,7 @@ type BridgeCommandStructurized<T extends BridgeCommandStructureProperties> = {
1095
1243
  };
1096
1244
  type BleDeviceType = keyof typeof _default$1;
1097
1245
  /** distinguish by type, e.g. `if (device.type === 'bridge')`, to access furhter fields */
1098
- type BleDevice = BleBridge | BleBridgeOta | BleFlexiGaugeTpms | BlePressureStick | BleFlexiGauge | BleTorqueWrench;
1246
+ type BleDevice = BleBridge | BleBridgeOta | BleFlexiGaugeTpms | BlePressureStick | BleFlexiGauge | BleTorqueWrench | BleUnitechRfid;
1099
1247
  type BleDeviceSimulated = BleBridgeSimulated | BleFlexiGaugeTpmsSimulated;
1100
1248
  type BleDeviceStatus = 'connected' | 'connecting' | 'disconnecting' | undefined;
1101
1249
  interface BleDeviceBase {
@@ -1125,6 +1273,9 @@ interface BleFlexiGauge extends BleDeviceBase {
1125
1273
  interface BleTorqueWrench extends BleDeviceBase {
1126
1274
  type: 'torqueWrench';
1127
1275
  }
1276
+ interface BleUnitechRfid extends BleDeviceBase {
1277
+ type: 'unitechRfid';
1278
+ }
1128
1279
  interface BleBridgeOta extends BleDeviceBase {
1129
1280
  advertisingData: {
1130
1281
  bridgeId: string;
@@ -1200,12 +1351,25 @@ type Wrapper<T extends Record<string, (...args: any) => any>> = {
1200
1351
  type ReportStatusFn = (status: string, completionPercentage: number) => void;
1201
1352
  type DeviceState = 'connected' | 'connecting' | 'disconnecting' | 'paired' | undefined;
1202
1353
  type StateReason = 'lostConnection' | 'manualDisconnection' | 'failedConnection' | 'failedDisconnection' | 'firmwareUpdate' | string;
1354
+ /** A unique RFID tag aggregated across many tagRead events, keeping the strongest signal seen. */
1355
+ interface RfidTag {
1356
+ epc: string;
1357
+ rssi: number;
1358
+ }
1203
1359
  interface EventHandlers {
1204
1360
  'fg:treadDepth'?: (deviceId: string, value: number) => void;
1205
1361
  'fg:button'?: (deviceId: string, value: string) => void;
1206
1362
  'fg:tpms'?: (deviceId: string, value: FgSensorReading | undefined) => void;
1207
1363
  'ps:pressure'?: (deviceId: string, value: number) => void;
1208
1364
  'tw:reading'?: (deviceId: string, value: TorqueWrenchReading) => void;
1365
+ 'unitech:readerState'?: (deviceId: string, event: ReaderStateEvent) => void;
1366
+ 'unitech:readerStateConnect'?: (deviceId: string, event: ReaderStateEvent) => void;
1367
+ 'unitech:actionState'?: (deviceId: string, event: ActionStateEvent) => void;
1368
+ 'unitech:trigger'?: (deviceId: string, event: TriggerEvent) => void;
1369
+ 'unitech:tag'?: (deviceId: string, event: TagReadEvent) => void;
1370
+ 'unitech:tagReadMultiple'?: (deviceId: string, tags: RfidTag[]) => void;
1371
+ 'unitech:battery'?: (deviceId: string, event: BatteryEvent) => void;
1372
+ 'unitech:temperature'?: (deviceId: string, event: TemperatureEvent) => void;
1209
1373
  'bridgeOta:status'?: (deviceId: string, status: string) => void;
1210
1374
  'bridgeOta:success'?: (deviceId: string) => void;
1211
1375
  'bridgeOta:error'?: (deviceId: string, error: string) => void;
@@ -1234,18 +1398,55 @@ interface TorqueWrenchReading {
1234
1398
  angle: number;
1235
1399
  duration: number;
1236
1400
  }
1401
+ interface RxSwinBridgeConfiguration {
1402
+ bleTxPower?: number;
1403
+ bleTxChannels?: string;
1404
+ canEnabled?: number;
1405
+ movementDetectionLimit?: number;
1406
+ sensorInactivityTimeout?: number;
1407
+ }
1408
+ interface RxSwinResult {
1409
+ R10SWIN: string;
1410
+ R141SWIN: string;
1411
+ }
1237
1412
  type EventName = keyof EventHandlers;
1238
1413
 
1414
+ interface BluetoothClassicSerialDevice {
1415
+ /** Device identifier.
1416
+ * Android: device's MAC address (same value as `address`).
1417
+ * iOS: device UUID. */
1418
+ id: string;
1419
+ /** Device's MAC address (Android only). */
1420
+ address?: string;
1421
+ name: string;
1422
+ /** Bluetooth device class (Android only). */
1423
+ class?: number;
1424
+ rssi?: number;
1425
+ }
1426
+ interface BluetoothClassicSerialImplementation {
1427
+ /** Lists already paired/bonded serial devices. */
1428
+ list: () => Promise<BluetoothClassicSerialDevice[]>;
1429
+ /** Discovers nearby unpaired serial devices. Resolves with all devices found once discovery finishes.
1430
+ * For incremental results during discovery, also register `setDeviceDiscoveredListener`. */
1431
+ discoverUnpaired: () => Promise<BluetoothClassicSerialDevice[]>;
1432
+ /** Registers a listener fired for each device discovered during `discoverUnpaired`. */
1433
+ setDeviceDiscoveredListener?: (notify: (device: BluetoothClassicSerialDevice) => void) => void;
1434
+ /** Removes the listener registered via `setDeviceDiscoveredListener`. */
1435
+ clearDeviceDiscoveredListener?: () => void;
1436
+ }
1437
+
1239
1438
  /** Creates instance of SDK.
1240
1439
  * For real usage, `bleImplementation` argument must be provided - it's an object that follows method definitions from `cordova-plugin-bluetooth-central`.
1241
1440
  * If `bleImplementation` is not provided, SDK will work only with the simulator. */
1242
- declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplementation?: BleImplementation, securityKeys?: BleSecurityKeys): {
1441
+ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplementation?: BleImplementation, securityKeys?: BleSecurityKeys, unitechRfidImplementation?: UnitechRfidImplementation, bluetoothClassicSerialImplementation?: BluetoothClassicSerialImplementation): {
1243
1442
  /** Generic methods common for all devices */
1244
1443
  bluetooth: {
1245
1444
  onDeviceAdvertising(callback: (device: BleDevice) => void): void;
1246
1445
  onDeviceUnreachable(callback: (deviceId: string) => void): void;
1247
1446
  onDeviceStateChange(callback: (deviceId: string, state?: DeviceState, reason?: StateReason) => void): void;
1248
1447
  scanDevices: (services?: string[], duration?: number) => Promise<void>;
1448
+ scanSerialDevicesPaired: () => Promise<void>;
1449
+ scanSerialDevicesUnpaired: () => Promise<void>;
1249
1450
  stopScan(): void;
1250
1451
  connect: (deviceId: string, disconnectCallback: (deviceId: string) => void) => Promise<void | PeripheralDataExtended>;
1251
1452
  disconnect: (deviceId: string) => Promise<void>;
@@ -1258,8 +1459,9 @@ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplement
1258
1459
  connect: (deviceId: string, accessLevel: BridgeAccessLevel) => Promise<void>;
1259
1460
  getVehicle: (deviceId: string) => Promise<BridgeTcVehicle>;
1260
1461
  setVehicle: (deviceId: string, tcVehicle: BridgeTcVehicle) => Promise<void>;
1261
- getConfiguration: (deviceId: string, includeVehicleData?: boolean) => Promise<BridgeConfiguration>;
1462
+ getConfiguration: (deviceId: string) => Promise<BridgeConfiguration>;
1262
1463
  setConfiguration: (deviceId: string, bridgeConfiguration: BridgeConfiguration) => Promise<void>;
1464
+ getRxSWIN: (deviceId: string, configuration?: Partial<BridgeConfiguration>) => Promise<RxSwinResult>;
1263
1465
  getSensorReading: (deviceId: string, positionId: number) => Promise<BridgeReading>;
1264
1466
  getVehicleReadings: (deviceId: string, tcVehicle: BridgeTcVehicle) => Promise<BridgeReading[]>;
1265
1467
  getAutolearnStatuses: (deviceId: string, tcVehicle: BridgeTcVehicle) => Promise<BridgeAutolearnStatus[]>;
@@ -1333,6 +1535,19 @@ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplement
1333
1535
  getTime: (deviceId: string) => Promise<Date>;
1334
1536
  onReading: (callback: (deviceId: string, value: TorqueWrenchReading) => void) => void;
1335
1537
  };
1538
+ /** Methods for working with Unitech RFID reader */
1539
+ unitechRfid: {
1540
+ connect(deviceId: string): Promise<void>;
1541
+ disconnect(deviceId: string, reason?: StateReason): Promise<void>;
1542
+ startReading(): Promise<void>;
1543
+ stopReading(): Promise<void>;
1544
+ onReaderState: (callback: (deviceId: string, event: ReaderStateEvent) => void) => void;
1545
+ onActionState: (callback: (deviceId: string, event: ActionStateEvent) => void) => void;
1546
+ onTrigger: (callback: (deviceId: string, event: TriggerEvent) => void) => void;
1547
+ onTagRead: (callback: (deviceId: string, event: TagReadEvent) => void) => void;
1548
+ onBattery: (callback: (deviceId: string, event: BatteryEvent) => void) => void;
1549
+ onTemperature: (callback: (deviceId: string, event: TemperatureEvent) => void) => void;
1550
+ };
1336
1551
  utils: {
1337
1552
  bridge: {
1338
1553
  convertBarToKpaByte: (deviceId: string, value?: number) => number;
@@ -1342,4 +1557,4 @@ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplement
1342
1557
  };
1343
1558
  };
1344
1559
 
1345
- export { type BleBridge, type BleBridgeAdvertisingData, type BleBridgeOta, type BleBridgeSimulated, type BleDevice, type BleDeviceBase, type BleDeviceSimulated, type BleDeviceStatus, type BleDeviceType, type BleFlexiGauge, type BleFlexiGaugeTpms, type BleFlexiGaugeTpmsSimulated, type BlePressureStick, type BleSecurityKeys, type BleTorqueWrench, type BridgeAccessLevel, type BridgeAutolearnStatus, type BridgeCommandStructure, type BridgeCommandStructureProperties, type BridgeCommandStructurized, type BridgeConfiguration, type BridgeReading, type BridgeTcIssue, type BridgeTcTyre, type BridgeTcVehicle, BridgeTcVehicleAxle, type DeepPartial, type DevicePlatform, type DeviceState, type EventHandlers, type EventName, type FgConfig, type FgConfigNeedleLength, type FgConfigPressureDisplay, type FgConfigPressureUnit, type FgConfigRegion, type FgConfigTdUnit, type FgConfigTemperatureUnit, type FgSensorReading, type FgTpmsConfig, type FgTpmsConfigProtocol, type FgTpmsConfigProtocolSetting, type PositionInfo, type ReportStatusFn, type Simulator, type StateReason, type TorqueWrenchProperties, type TorqueWrenchReading, type TorqueWrenchStartJobParams, type Wrapper, createTirecheckDeviceSdk };
1560
+ export { type BleBridge, type BleBridgeAdvertisingData, type BleBridgeOta, type BleBridgeSimulated, type BleDevice, type BleDeviceBase, type BleDeviceSimulated, type BleDeviceStatus, type BleDeviceType, type BleFlexiGauge, type BleFlexiGaugeTpms, type BleFlexiGaugeTpmsSimulated, type BlePressureStick, type BleSecurityKeys, type BleTorqueWrench, type BleUnitechRfid, type BridgeAccessLevel, type BridgeAutolearnStatus, type BridgeCommandStructure, type BridgeCommandStructureProperties, type BridgeCommandStructurized, type BridgeConfiguration, type BridgeReading, type BridgeTcIssue, type BridgeTcTyre, type BridgeTcVehicle, BridgeTcVehicleAxle, type DeepPartial, type DevicePlatform, type DeviceState, type EventHandlers, type EventName, type FgConfig, type FgConfigNeedleLength, type FgConfigPressureDisplay, type FgConfigPressureUnit, type FgConfigRegion, type FgConfigTdUnit, type FgConfigTemperatureUnit, type FgSensorReading, type FgTpmsConfig, type FgTpmsConfigProtocol, type FgTpmsConfigProtocolSetting, type PositionInfo, type ReportStatusFn, type RfidTag, type RxSwinBridgeConfiguration, type RxSwinResult, type Simulator, type StateReason, type TorqueWrenchProperties, type TorqueWrenchReading, type TorqueWrenchStartJobParams, type Wrapper, createTirecheckDeviceSdk };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,44 @@
1
+ interface UnitechListenerHandle {
2
+ remove: () => Promise<void>;
3
+ }
4
+ interface ReaderStateEvent {
5
+ state: string;
6
+ }
7
+ interface ActionStateEvent {
8
+ state: string;
9
+ }
10
+ interface TriggerEvent {
11
+ pressed: boolean;
12
+ }
13
+ interface TagReadEvent {
14
+ epc: string;
15
+ rssi: number;
16
+ [key: string]: unknown;
17
+ }
18
+ interface BatteryEvent {
19
+ percent: number;
20
+ }
21
+ interface TemperatureEvent {
22
+ celsius: number;
23
+ }
24
+ interface UnitechRfidImplementation {
25
+ removeAllListeners: () => Promise<void>;
26
+ addListener: ((eventName: 'readerState', listener: (event: ReaderStateEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'actionState', listener: (event: ActionStateEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'trigger', listener: (event: TriggerEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'tagRead', listener: (event: TagReadEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'battery', listener: (event: BatteryEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>) & ((eventName: 'temperature', listener: (event: TemperatureEvent) => void | Promise<void>) => Promise<UnitechListenerHandle>);
27
+ startDetect: (options: {
28
+ deviceName: string;
29
+ }) => Promise<void>;
30
+ stopDetect: () => Promise<void>;
31
+ connect: (options: {
32
+ bluetoothAddress?: string;
33
+ }) => Promise<{
34
+ connected: boolean;
35
+ }>;
36
+ disconnect: () => Promise<void>;
37
+ initDeviceSettings: () => Promise<void>;
38
+ startInventory: () => Promise<void>;
39
+ stopInventory: () => Promise<void>;
40
+ }
41
+
1
42
  interface BleImplementation {
2
43
  startScanWithOptions: (services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure?: (error: string) => any) => void;
3
44
  stopScan: () => Promise<void>;
@@ -118,6 +159,11 @@ declare const _default$1: {
118
159
  };
119
160
  getDeviceInfoFromAdvertising: (device: PeripheralData) => BleTorqueWrench;
120
161
  };
162
+ unitechRfid: {
163
+ nameRegex: RegExp;
164
+ transport: "serial";
165
+ getDeviceInfoFromAdvertising: (device: PeripheralData) => BleUnitechRfid;
166
+ };
121
167
  };
122
168
 
123
169
  declare const _default: {
@@ -927,6 +973,109 @@ declare const _default: {
927
973
  };
928
974
  };
929
975
  };
976
+ bridgeConfiguration: {
977
+ id: number[];
978
+ name: string;
979
+ structure: {
980
+ configVersion: {
981
+ size: number;
982
+ description: string;
983
+ display: "decimal";
984
+ };
985
+ bleTxPower: {
986
+ size: number;
987
+ description: string;
988
+ display: "decimal";
989
+ };
990
+ bleTxChannels: {
991
+ size: number;
992
+ description: string;
993
+ };
994
+ bleConnectableAdvPeriod: {
995
+ size: number;
996
+ description: string;
997
+ display: "decimal";
998
+ };
999
+ configurationFlags: {
1000
+ size: number;
1001
+ description: string;
1002
+ };
1003
+ wrongPinsUntilLockout: {
1004
+ size: number;
1005
+ description: string;
1006
+ display: "decimal";
1007
+ };
1008
+ maxLockoutPeriodIncreases: {
1009
+ size: number;
1010
+ description: string;
1011
+ display: "decimal";
1012
+ };
1013
+ wrongPinInitialLockoutTime: {
1014
+ size: number;
1015
+ description: string;
1016
+ display: "decimal";
1017
+ };
1018
+ securityConfiguration: {
1019
+ size: number;
1020
+ description: string;
1021
+ };
1022
+ canEnabled: {
1023
+ size: number;
1024
+ description: string;
1025
+ display: "decimal";
1026
+ };
1027
+ bleEnabled: {
1028
+ size: number;
1029
+ description: string;
1030
+ display: "decimal";
1031
+ };
1032
+ canBitrate: {
1033
+ size: number;
1034
+ description: string;
1035
+ display: "decimal";
1036
+ };
1037
+ movementDetectionLimit: {
1038
+ size: number;
1039
+ description: string;
1040
+ display: "decimal";
1041
+ };
1042
+ sensorInactivityTimeout: {
1043
+ size: number;
1044
+ description: string;
1045
+ display: "decimal";
1046
+ };
1047
+ manufacturerCode: {
1048
+ size: number;
1049
+ description: string;
1050
+ display: "decimal";
1051
+ };
1052
+ identityNumber: {
1053
+ size: number;
1054
+ description: string;
1055
+ display: "decimal";
1056
+ };
1057
+ manufacturerName: {
1058
+ size: number;
1059
+ description: string;
1060
+ display: "ascii";
1061
+ };
1062
+ ecuPartNumber: {
1063
+ size: number;
1064
+ description: string;
1065
+ display: "ascii";
1066
+ };
1067
+ softwareVersion: {
1068
+ size: number;
1069
+ description: string;
1070
+ display: "ascii";
1071
+ };
1072
+ reservedConfiguration: {
1073
+ size: number;
1074
+ description: string;
1075
+ display: "decimal";
1076
+ };
1077
+ };
1078
+ };
930
1079
  };
931
1080
 
932
1081
  type DeepPartial<T> = T extends object ? {
@@ -1018,15 +1167,14 @@ interface BridgeConfiguration {
1018
1167
  eolStatus?: BridgeCommandStructurized<typeof _default.eolStatus.structure>;
1019
1168
  /** only available after 0.9.8 fw */
1020
1169
  autolearnSettings?: BridgeCommandStructurized<typeof _default.autolearnSettings.structure>;
1021
- vehicleLayout?: BridgeCommandStructurized<typeof _default.vehicleLayout.structure>;
1022
- /** Per-axle wheel sensor IDs, indexed by axle (0-14). Each entry holds the 15 wheel slots of one axle. */
1023
- axleInfo?: BridgeCommandStructurized<typeof _default.idsPerWheel.structure>[];
1024
1170
  /** Parsed 0x90 SW Version DID (BT stack, config data version, BLE chip compilation date, BT chip FW version). */
1025
1171
  firmwareVersion?: BridgeCommandStructurized<typeof _default.firmwareVersion.structure>;
1026
1172
  /** only available after 0.9.7 fw */
1027
1173
  autolearnIdStatus?: BridgeCommandStructurized<typeof _default.autolearnIdStatus.structure>;
1028
1174
  /** only available after 0.9.7 fw */
1029
1175
  autolearnUnknownSensors?: BridgeCommandStructurized<typeof _default.autolearnUnknownSensors.structure>;
1176
+ /** R10/R141 software identification numbers, computed app-side from config records. */
1177
+ rxswin?: RxSwinResult;
1030
1178
  }
1031
1179
  interface BridgeReading {
1032
1180
  date: number;
@@ -1095,7 +1243,7 @@ type BridgeCommandStructurized<T extends BridgeCommandStructureProperties> = {
1095
1243
  };
1096
1244
  type BleDeviceType = keyof typeof _default$1;
1097
1245
  /** distinguish by type, e.g. `if (device.type === 'bridge')`, to access furhter fields */
1098
- type BleDevice = BleBridge | BleBridgeOta | BleFlexiGaugeTpms | BlePressureStick | BleFlexiGauge | BleTorqueWrench;
1246
+ type BleDevice = BleBridge | BleBridgeOta | BleFlexiGaugeTpms | BlePressureStick | BleFlexiGauge | BleTorqueWrench | BleUnitechRfid;
1099
1247
  type BleDeviceSimulated = BleBridgeSimulated | BleFlexiGaugeTpmsSimulated;
1100
1248
  type BleDeviceStatus = 'connected' | 'connecting' | 'disconnecting' | undefined;
1101
1249
  interface BleDeviceBase {
@@ -1125,6 +1273,9 @@ interface BleFlexiGauge extends BleDeviceBase {
1125
1273
  interface BleTorqueWrench extends BleDeviceBase {
1126
1274
  type: 'torqueWrench';
1127
1275
  }
1276
+ interface BleUnitechRfid extends BleDeviceBase {
1277
+ type: 'unitechRfid';
1278
+ }
1128
1279
  interface BleBridgeOta extends BleDeviceBase {
1129
1280
  advertisingData: {
1130
1281
  bridgeId: string;
@@ -1200,12 +1351,25 @@ type Wrapper<T extends Record<string, (...args: any) => any>> = {
1200
1351
  type ReportStatusFn = (status: string, completionPercentage: number) => void;
1201
1352
  type DeviceState = 'connected' | 'connecting' | 'disconnecting' | 'paired' | undefined;
1202
1353
  type StateReason = 'lostConnection' | 'manualDisconnection' | 'failedConnection' | 'failedDisconnection' | 'firmwareUpdate' | string;
1354
+ /** A unique RFID tag aggregated across many tagRead events, keeping the strongest signal seen. */
1355
+ interface RfidTag {
1356
+ epc: string;
1357
+ rssi: number;
1358
+ }
1203
1359
  interface EventHandlers {
1204
1360
  'fg:treadDepth'?: (deviceId: string, value: number) => void;
1205
1361
  'fg:button'?: (deviceId: string, value: string) => void;
1206
1362
  'fg:tpms'?: (deviceId: string, value: FgSensorReading | undefined) => void;
1207
1363
  'ps:pressure'?: (deviceId: string, value: number) => void;
1208
1364
  'tw:reading'?: (deviceId: string, value: TorqueWrenchReading) => void;
1365
+ 'unitech:readerState'?: (deviceId: string, event: ReaderStateEvent) => void;
1366
+ 'unitech:readerStateConnect'?: (deviceId: string, event: ReaderStateEvent) => void;
1367
+ 'unitech:actionState'?: (deviceId: string, event: ActionStateEvent) => void;
1368
+ 'unitech:trigger'?: (deviceId: string, event: TriggerEvent) => void;
1369
+ 'unitech:tag'?: (deviceId: string, event: TagReadEvent) => void;
1370
+ 'unitech:tagReadMultiple'?: (deviceId: string, tags: RfidTag[]) => void;
1371
+ 'unitech:battery'?: (deviceId: string, event: BatteryEvent) => void;
1372
+ 'unitech:temperature'?: (deviceId: string, event: TemperatureEvent) => void;
1209
1373
  'bridgeOta:status'?: (deviceId: string, status: string) => void;
1210
1374
  'bridgeOta:success'?: (deviceId: string) => void;
1211
1375
  'bridgeOta:error'?: (deviceId: string, error: string) => void;
@@ -1234,18 +1398,55 @@ interface TorqueWrenchReading {
1234
1398
  angle: number;
1235
1399
  duration: number;
1236
1400
  }
1401
+ interface RxSwinBridgeConfiguration {
1402
+ bleTxPower?: number;
1403
+ bleTxChannels?: string;
1404
+ canEnabled?: number;
1405
+ movementDetectionLimit?: number;
1406
+ sensorInactivityTimeout?: number;
1407
+ }
1408
+ interface RxSwinResult {
1409
+ R10SWIN: string;
1410
+ R141SWIN: string;
1411
+ }
1237
1412
  type EventName = keyof EventHandlers;
1238
1413
 
1414
+ interface BluetoothClassicSerialDevice {
1415
+ /** Device identifier.
1416
+ * Android: device's MAC address (same value as `address`).
1417
+ * iOS: device UUID. */
1418
+ id: string;
1419
+ /** Device's MAC address (Android only). */
1420
+ address?: string;
1421
+ name: string;
1422
+ /** Bluetooth device class (Android only). */
1423
+ class?: number;
1424
+ rssi?: number;
1425
+ }
1426
+ interface BluetoothClassicSerialImplementation {
1427
+ /** Lists already paired/bonded serial devices. */
1428
+ list: () => Promise<BluetoothClassicSerialDevice[]>;
1429
+ /** Discovers nearby unpaired serial devices. Resolves with all devices found once discovery finishes.
1430
+ * For incremental results during discovery, also register `setDeviceDiscoveredListener`. */
1431
+ discoverUnpaired: () => Promise<BluetoothClassicSerialDevice[]>;
1432
+ /** Registers a listener fired for each device discovered during `discoverUnpaired`. */
1433
+ setDeviceDiscoveredListener?: (notify: (device: BluetoothClassicSerialDevice) => void) => void;
1434
+ /** Removes the listener registered via `setDeviceDiscoveredListener`. */
1435
+ clearDeviceDiscoveredListener?: () => void;
1436
+ }
1437
+
1239
1438
  /** Creates instance of SDK.
1240
1439
  * For real usage, `bleImplementation` argument must be provided - it's an object that follows method definitions from `cordova-plugin-bluetooth-central`.
1241
1440
  * If `bleImplementation` is not provided, SDK will work only with the simulator. */
1242
- declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplementation?: BleImplementation, securityKeys?: BleSecurityKeys): {
1441
+ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplementation?: BleImplementation, securityKeys?: BleSecurityKeys, unitechRfidImplementation?: UnitechRfidImplementation, bluetoothClassicSerialImplementation?: BluetoothClassicSerialImplementation): {
1243
1442
  /** Generic methods common for all devices */
1244
1443
  bluetooth: {
1245
1444
  onDeviceAdvertising(callback: (device: BleDevice) => void): void;
1246
1445
  onDeviceUnreachable(callback: (deviceId: string) => void): void;
1247
1446
  onDeviceStateChange(callback: (deviceId: string, state?: DeviceState, reason?: StateReason) => void): void;
1248
1447
  scanDevices: (services?: string[], duration?: number) => Promise<void>;
1448
+ scanSerialDevicesPaired: () => Promise<void>;
1449
+ scanSerialDevicesUnpaired: () => Promise<void>;
1249
1450
  stopScan(): void;
1250
1451
  connect: (deviceId: string, disconnectCallback: (deviceId: string) => void) => Promise<void | PeripheralDataExtended>;
1251
1452
  disconnect: (deviceId: string) => Promise<void>;
@@ -1258,8 +1459,9 @@ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplement
1258
1459
  connect: (deviceId: string, accessLevel: BridgeAccessLevel) => Promise<void>;
1259
1460
  getVehicle: (deviceId: string) => Promise<BridgeTcVehicle>;
1260
1461
  setVehicle: (deviceId: string, tcVehicle: BridgeTcVehicle) => Promise<void>;
1261
- getConfiguration: (deviceId: string, includeVehicleData?: boolean) => Promise<BridgeConfiguration>;
1462
+ getConfiguration: (deviceId: string) => Promise<BridgeConfiguration>;
1262
1463
  setConfiguration: (deviceId: string, bridgeConfiguration: BridgeConfiguration) => Promise<void>;
1464
+ getRxSWIN: (deviceId: string, configuration?: Partial<BridgeConfiguration>) => Promise<RxSwinResult>;
1263
1465
  getSensorReading: (deviceId: string, positionId: number) => Promise<BridgeReading>;
1264
1466
  getVehicleReadings: (deviceId: string, tcVehicle: BridgeTcVehicle) => Promise<BridgeReading[]>;
1265
1467
  getAutolearnStatuses: (deviceId: string, tcVehicle: BridgeTcVehicle) => Promise<BridgeAutolearnStatus[]>;
@@ -1333,6 +1535,19 @@ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplement
1333
1535
  getTime: (deviceId: string) => Promise<Date>;
1334
1536
  onReading: (callback: (deviceId: string, value: TorqueWrenchReading) => void) => void;
1335
1537
  };
1538
+ /** Methods for working with Unitech RFID reader */
1539
+ unitechRfid: {
1540
+ connect(deviceId: string): Promise<void>;
1541
+ disconnect(deviceId: string, reason?: StateReason): Promise<void>;
1542
+ startReading(): Promise<void>;
1543
+ stopReading(): Promise<void>;
1544
+ onReaderState: (callback: (deviceId: string, event: ReaderStateEvent) => void) => void;
1545
+ onActionState: (callback: (deviceId: string, event: ActionStateEvent) => void) => void;
1546
+ onTrigger: (callback: (deviceId: string, event: TriggerEvent) => void) => void;
1547
+ onTagRead: (callback: (deviceId: string, event: TagReadEvent) => void) => void;
1548
+ onBattery: (callback: (deviceId: string, event: BatteryEvent) => void) => void;
1549
+ onTemperature: (callback: (deviceId: string, event: TemperatureEvent) => void) => void;
1550
+ };
1336
1551
  utils: {
1337
1552
  bridge: {
1338
1553
  convertBarToKpaByte: (deviceId: string, value?: number) => number;
@@ -1342,4 +1557,4 @@ declare function createTirecheckDeviceSdk(platform: DevicePlatform, bleImplement
1342
1557
  };
1343
1558
  };
1344
1559
 
1345
- export { type BleBridge, type BleBridgeAdvertisingData, type BleBridgeOta, type BleBridgeSimulated, type BleDevice, type BleDeviceBase, type BleDeviceSimulated, type BleDeviceStatus, type BleDeviceType, type BleFlexiGauge, type BleFlexiGaugeTpms, type BleFlexiGaugeTpmsSimulated, type BlePressureStick, type BleSecurityKeys, type BleTorqueWrench, type BridgeAccessLevel, type BridgeAutolearnStatus, type BridgeCommandStructure, type BridgeCommandStructureProperties, type BridgeCommandStructurized, type BridgeConfiguration, type BridgeReading, type BridgeTcIssue, type BridgeTcTyre, type BridgeTcVehicle, BridgeTcVehicleAxle, type DeepPartial, type DevicePlatform, type DeviceState, type EventHandlers, type EventName, type FgConfig, type FgConfigNeedleLength, type FgConfigPressureDisplay, type FgConfigPressureUnit, type FgConfigRegion, type FgConfigTdUnit, type FgConfigTemperatureUnit, type FgSensorReading, type FgTpmsConfig, type FgTpmsConfigProtocol, type FgTpmsConfigProtocolSetting, type PositionInfo, type ReportStatusFn, type Simulator, type StateReason, type TorqueWrenchProperties, type TorqueWrenchReading, type TorqueWrenchStartJobParams, type Wrapper, createTirecheckDeviceSdk };
1560
+ export { type BleBridge, type BleBridgeAdvertisingData, type BleBridgeOta, type BleBridgeSimulated, type BleDevice, type BleDeviceBase, type BleDeviceSimulated, type BleDeviceStatus, type BleDeviceType, type BleFlexiGauge, type BleFlexiGaugeTpms, type BleFlexiGaugeTpmsSimulated, type BlePressureStick, type BleSecurityKeys, type BleTorqueWrench, type BleUnitechRfid, type BridgeAccessLevel, type BridgeAutolearnStatus, type BridgeCommandStructure, type BridgeCommandStructureProperties, type BridgeCommandStructurized, type BridgeConfiguration, type BridgeReading, type BridgeTcIssue, type BridgeTcTyre, type BridgeTcVehicle, BridgeTcVehicleAxle, type DeepPartial, type DevicePlatform, type DeviceState, type EventHandlers, type EventName, type FgConfig, type FgConfigNeedleLength, type FgConfigPressureDisplay, type FgConfigPressureUnit, type FgConfigRegion, type FgConfigTdUnit, type FgConfigTemperatureUnit, type FgSensorReading, type FgTpmsConfig, type FgTpmsConfigProtocol, type FgTpmsConfigProtocolSetting, type PositionInfo, type ReportStatusFn, type RfidTag, type RxSwinBridgeConfiguration, type RxSwinResult, type Simulator, type StateReason, type TorqueWrenchProperties, type TorqueWrenchReading, type TorqueWrenchStartJobParams, type Wrapper, createTirecheckDeviceSdk };