sportident.js 1.0.0 → 1.0.1
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/README.md +1 -27
- package/SiCard/BaseSiCard.d.ts +35 -0
- package/SiCard/BaseSiCard.d.ts.map +1 -0
- package/SiCard/BaseSiCard.js +99 -0
- package/SiCard/BaseSiCard.js.map +1 -0
- package/SiCard/BaseSiCard.test.d.ts +2 -0
- package/SiCard/BaseSiCard.test.d.ts.map +1 -0
- package/SiCard/BaseSiCard.test.js +190 -0
- package/SiCard/BaseSiCard.test.js.map +1 -0
- package/SiCard/IRaceResultData.d.ts +17 -0
- package/SiCard/IRaceResultData.d.ts.map +1 -0
- package/SiCard/IRaceResultData.js +3 -0
- package/SiCard/IRaceResultData.js.map +1 -0
- package/SiCard/ISiCard.d.ts +24 -0
- package/SiCard/ISiCard.d.ts.map +1 -0
- package/SiCard/ISiCard.js +3 -0
- package/SiCard/ISiCard.js.map +1 -0
- package/SiCard/ISiCardExamples.d.ts +9 -0
- package/SiCard/ISiCardExamples.d.ts.map +1 -0
- package/SiCard/ISiCardExamples.js +3 -0
- package/SiCard/ISiCardExamples.js.map +1 -0
- package/{src/SiCard/index.ts → SiCard/index.d.ts} +1 -0
- package/SiCard/index.d.ts.map +1 -0
- package/SiCard/index.js +21 -0
- package/SiCard/index.js.map +1 -0
- package/SiCard/raceResultTools.d.ts +25 -0
- package/SiCard/raceResultTools.d.ts.map +1 -0
- package/SiCard/raceResultTools.js +155 -0
- package/SiCard/raceResultTools.js.map +1 -0
- package/SiCard/raceResultTools.test.d.ts +2 -0
- package/SiCard/raceResultTools.test.d.ts.map +1 -0
- package/SiCard/raceResultTools.test.js +255 -0
- package/SiCard/raceResultTools.test.js.map +1 -0
- package/SiCard/types/FCard.d.ts +7 -0
- package/SiCard/types/FCard.d.ts.map +1 -0
- package/SiCard/types/FCard.js +49 -0
- package/SiCard/types/FCard.js.map +1 -0
- package/SiCard/types/FCard.test.d.ts +2 -0
- package/SiCard/types/FCard.test.d.ts.map +1 -0
- package/SiCard/types/FCard.test.js +18 -0
- package/SiCard/types/FCard.test.js.map +1 -0
- package/SiCard/types/ModernSiCard.d.ts +48 -0
- package/SiCard/types/ModernSiCard.d.ts.map +1 -0
- package/SiCard/types/ModernSiCard.js +238 -0
- package/SiCard/types/ModernSiCard.js.map +1 -0
- package/SiCard/types/ModernSiCard.test.d.ts +2 -0
- package/SiCard/types/ModernSiCard.test.d.ts.map +1 -0
- package/SiCard/types/ModernSiCard.test.js +214 -0
- package/SiCard/types/ModernSiCard.test.js.map +1 -0
- package/SiCard/types/PCard.d.ts +7 -0
- package/SiCard/types/PCard.d.ts.map +1 -0
- package/SiCard/types/PCard.js +49 -0
- package/SiCard/types/PCard.js.map +1 -0
- package/SiCard/types/PCard.test.d.ts +2 -0
- package/SiCard/types/PCard.test.d.ts.map +1 -0
- package/SiCard/types/PCard.test.js +18 -0
- package/SiCard/types/PCard.test.js.map +1 -0
- package/SiCard/types/SIAC.d.ts +6 -0
- package/SiCard/types/SIAC.d.ts.map +1 -0
- package/SiCard/types/SIAC.js +22 -0
- package/SiCard/types/SIAC.js.map +1 -0
- package/SiCard/types/SIAC.test.d.ts +2 -0
- package/SiCard/types/SIAC.test.d.ts.map +1 -0
- package/SiCard/types/SIAC.test.js +113 -0
- package/SiCard/types/SIAC.test.js.map +1 -0
- package/SiCard/types/SiCard10.d.ts +6 -0
- package/SiCard/types/SiCard10.d.ts.map +1 -0
- package/SiCard/types/SiCard10.js +20 -0
- package/SiCard/types/SiCard10.js.map +1 -0
- package/SiCard/types/SiCard10.test.d.ts +2 -0
- package/SiCard/types/SiCard10.test.d.ts.map +1 -0
- package/SiCard/types/SiCard10.test.js +114 -0
- package/SiCard/types/SiCard10.test.js.map +1 -0
- package/SiCard/types/SiCard11.d.ts +6 -0
- package/SiCard/types/SiCard11.d.ts.map +1 -0
- package/SiCard/types/SiCard11.js +22 -0
- package/SiCard/types/SiCard11.js.map +1 -0
- package/SiCard/types/SiCard11.test.d.ts +2 -0
- package/SiCard/types/SiCard11.test.d.ts.map +1 -0
- package/SiCard/types/SiCard11.test.js +113 -0
- package/SiCard/types/SiCard11.test.js.map +1 -0
- package/SiCard/types/SiCard5.d.ts +31 -0
- package/SiCard/types/SiCard5.d.ts.map +1 -0
- package/SiCard/types/SiCard5.js +128 -0
- package/SiCard/types/SiCard5.js.map +1 -0
- package/SiCard/types/SiCard5.test.d.ts +2 -0
- package/SiCard/types/SiCard5.test.d.ts.map +1 -0
- package/SiCard/types/SiCard5.test.js +170 -0
- package/SiCard/types/SiCard5.test.js.map +1 -0
- package/SiCard/types/SiCard6.d.ts +49 -0
- package/SiCard/types/SiCard6.d.ts.map +1 -0
- package/SiCard/types/SiCard6.js +203 -0
- package/SiCard/types/SiCard6.js.map +1 -0
- package/SiCard/types/SiCard6.test.d.ts +2 -0
- package/SiCard/types/SiCard6.test.d.ts.map +1 -0
- package/SiCard/types/SiCard6.test.js +202 -0
- package/SiCard/types/SiCard6.test.js.map +1 -0
- package/SiCard/types/SiCard8.d.ts +20 -0
- package/SiCard/types/SiCard8.d.ts.map +1 -0
- package/SiCard/types/SiCard8.js +140 -0
- package/SiCard/types/SiCard8.js.map +1 -0
- package/SiCard/types/SiCard8.test.d.ts +2 -0
- package/SiCard/types/SiCard8.test.d.ts.map +1 -0
- package/SiCard/types/SiCard8.test.js +159 -0
- package/SiCard/types/SiCard8.test.js.map +1 -0
- package/SiCard/types/SiCard9.d.ts +20 -0
- package/SiCard/types/SiCard9.d.ts.map +1 -0
- package/SiCard/types/SiCard9.js +139 -0
- package/SiCard/types/SiCard9.js.map +1 -0
- package/SiCard/types/SiCard9.test.d.ts +2 -0
- package/SiCard/types/SiCard9.test.d.ts.map +1 -0
- package/SiCard/types/SiCard9.test.js +155 -0
- package/SiCard/types/SiCard9.test.js.map +1 -0
- package/SiCard/types/TCard.d.ts +7 -0
- package/SiCard/types/TCard.d.ts.map +1 -0
- package/SiCard/types/TCard.js +49 -0
- package/SiCard/types/TCard.js.map +1 -0
- package/SiCard/types/TCard.test.d.ts +2 -0
- package/SiCard/types/TCard.test.d.ts.map +1 -0
- package/SiCard/types/TCard.test.js +18 -0
- package/SiCard/types/TCard.test.js.map +1 -0
- package/{src/SiCard/types/index.ts → SiCard/types/index.d.ts} +1 -0
- package/SiCard/types/index.d.ts.map +1 -0
- package/SiCard/types/index.js +34 -0
- package/SiCard/types/index.js.map +1 -0
- package/SiCard/types/index.test.d.ts +2 -0
- package/SiCard/types/index.test.d.ts.map +1 -0
- package/SiCard/types/index.test.js +65 -0
- package/SiCard/types/index.test.js.map +1 -0
- package/SiCard/types/modernSiCardExamples.d.ts +254 -0
- package/SiCard/types/modernSiCardExamples.d.ts.map +1 -0
- package/SiCard/types/modernSiCardExamples.js +389 -0
- package/SiCard/types/modernSiCardExamples.js.map +1 -0
- package/SiCard/types/siCard5Examples.d.ts +50 -0
- package/SiCard/types/siCard5Examples.d.ts.map +1 -0
- package/SiCard/types/siCard5Examples.js +109 -0
- package/SiCard/types/siCard5Examples.js.map +1 -0
- package/SiCard/types/siCard6Examples.d.ts +190 -0
- package/SiCard/types/siCard6Examples.d.ts.map +1 -0
- package/SiCard/types/siCard6Examples.js +289 -0
- package/SiCard/types/siCard6Examples.js.map +1 -0
- package/SiCard/types/siCard8Examples.d.ts +98 -0
- package/SiCard/types/siCard8Examples.d.ts.map +1 -0
- package/SiCard/types/siCard8Examples.js +182 -0
- package/SiCard/types/siCard8Examples.js.map +1 -0
- package/SiCard/types/siCard9Examples.d.ts +98 -0
- package/SiCard/types/siCard9Examples.d.ts.map +1 -0
- package/SiCard/types/siCard9Examples.js +173 -0
- package/SiCard/types/siCard9Examples.js.map +1 -0
- package/SiDevice/INavigatorWebSerial.d.ts +62 -0
- package/SiDevice/INavigatorWebSerial.d.ts.map +1 -0
- package/SiDevice/INavigatorWebSerial.js +3 -0
- package/SiDevice/INavigatorWebSerial.js.map +1 -0
- package/SiDevice/INavigatorWebUsb.d.ts +55 -0
- package/SiDevice/INavigatorWebUsb.d.ts.map +1 -0
- package/SiDevice/INavigatorWebUsb.js +3 -0
- package/SiDevice/INavigatorWebUsb.js.map +1 -0
- package/SiDevice/ISiDevice.d.ts +42 -0
- package/SiDevice/ISiDevice.d.ts.map +1 -0
- package/SiDevice/ISiDevice.js +65 -0
- package/SiDevice/ISiDevice.js.map +1 -0
- package/SiDevice/ISiDeviceDriver.d.ts +29 -0
- package/SiDevice/ISiDeviceDriver.d.ts.map +1 -0
- package/SiDevice/ISiDeviceDriver.js +52 -0
- package/SiDevice/ISiDeviceDriver.js.map +1 -0
- package/SiDevice/SiDevice.d.ts +21 -0
- package/SiDevice/SiDevice.d.ts.map +1 -0
- package/SiDevice/SiDevice.js +156 -0
- package/SiDevice/SiDevice.js.map +1 -0
- package/SiDevice/SiDevice.test.d.ts +2 -0
- package/SiDevice/SiDevice.test.d.ts.map +1 -0
- package/SiDevice/SiDevice.test.js +366 -0
- package/SiDevice/SiDevice.test.js.map +1 -0
- package/SiDevice/WebSerialSiDeviceDriver.d.ts +31 -0
- package/SiDevice/WebSerialSiDeviceDriver.d.ts.map +1 -0
- package/SiDevice/WebSerialSiDeviceDriver.js +175 -0
- package/SiDevice/WebSerialSiDeviceDriver.js.map +1 -0
- package/SiDevice/WebUsbSiDeviceDriver.d.ts +39 -0
- package/SiDevice/WebUsbSiDeviceDriver.d.ts.map +1 -0
- package/SiDevice/WebUsbSiDeviceDriver.js +359 -0
- package/SiDevice/WebUsbSiDeviceDriver.js.map +1 -0
- package/{src/SiDevice/index.ts → SiDevice/index.d.ts} +1 -0
- package/SiDevice/index.d.ts.map +1 -0
- package/SiDevice/index.js +6 -0
- package/SiDevice/index.js.map +1 -0
- package/{src/SiDevice/testUtils/index.ts → SiDevice/testUtils/index.d.ts} +1 -0
- package/SiDevice/testUtils/index.d.ts.map +1 -0
- package/SiDevice/testUtils/index.js +8 -0
- package/SiDevice/testUtils/index.js.map +1 -0
- package/SiDevice/testUtils/testISiDeviceDriver.d.ts +8 -0
- package/SiDevice/testUtils/testISiDeviceDriver.d.ts.map +1 -0
- package/SiDevice/testUtils/testISiDeviceDriver.js +94 -0
- package/SiDevice/testUtils/testISiDeviceDriver.js.map +1 -0
- package/SiDevice/testUtils/testISiDeviceDriverWithAutodetection.d.ts +8 -0
- package/SiDevice/testUtils/testISiDeviceDriverWithAutodetection.d.ts.map +1 -0
- package/SiDevice/testUtils/testISiDeviceDriverWithAutodetection.js +95 -0
- package/SiDevice/testUtils/testISiDeviceDriverWithAutodetection.js.map +1 -0
- package/SiStation/BaseSiStation.d.ts +61 -0
- package/SiStation/BaseSiStation.d.ts.map +1 -0
- package/SiStation/BaseSiStation.js +217 -0
- package/SiStation/BaseSiStation.js.map +1 -0
- package/SiStation/BaseSiStation.test.d.ts +2 -0
- package/SiStation/BaseSiStation.test.d.ts.map +1 -0
- package/SiStation/BaseSiStation.test.js +242 -0
- package/SiStation/BaseSiStation.test.js.map +1 -0
- package/SiStation/CoupledSiStation.d.ts +14 -0
- package/SiStation/CoupledSiStation.d.ts.map +1 -0
- package/SiStation/CoupledSiStation.js +156 -0
- package/SiStation/CoupledSiStation.js.map +1 -0
- package/SiStation/CoupledSiStation.test.d.ts +2 -0
- package/SiStation/CoupledSiStation.test.d.ts.map +1 -0
- package/SiStation/CoupledSiStation.test.js +72 -0
- package/SiStation/CoupledSiStation.test.js.map +1 -0
- package/SiStation/ISiMainStation.d.ts +25 -0
- package/SiStation/ISiMainStation.d.ts.map +1 -0
- package/SiStation/ISiMainStation.js +62 -0
- package/SiStation/ISiMainStation.js.map +1 -0
- package/SiStation/ISiSendTask.d.ts +8 -0
- package/SiStation/ISiSendTask.d.ts.map +1 -0
- package/SiStation/ISiSendTask.js +14 -0
- package/SiStation/ISiSendTask.js.map +1 -0
- package/SiStation/ISiStation.d.ts +62 -0
- package/SiStation/ISiStation.d.ts.map +1 -0
- package/SiStation/ISiStation.js +76 -0
- package/SiStation/ISiStation.js.map +1 -0
- package/SiStation/ISiTargetMultiplexer.d.ts +47 -0
- package/SiStation/ISiTargetMultiplexer.d.ts.map +1 -0
- package/SiStation/ISiTargetMultiplexer.js +71 -0
- package/SiStation/ISiTargetMultiplexer.js.map +1 -0
- package/SiStation/SiMainStation.d.ts +24 -0
- package/SiStation/SiMainStation.d.ts.map +1 -0
- package/SiStation/SiMainStation.js +142 -0
- package/SiStation/SiMainStation.js.map +1 -0
- package/SiStation/SiMainStation.test.d.ts +2 -0
- package/SiStation/SiMainStation.test.d.ts.map +1 -0
- package/SiStation/SiMainStation.test.js +235 -0
- package/SiStation/SiMainStation.test.js.map +1 -0
- package/SiStation/SiSendTask.d.ts +17 -0
- package/SiStation/SiSendTask.d.ts.map +1 -0
- package/SiStation/SiSendTask.js +81 -0
- package/SiStation/SiSendTask.js.map +1 -0
- package/SiStation/SiTargetMultiplexer.d.ts +34 -0
- package/SiStation/SiTargetMultiplexer.d.ts.map +1 -0
- package/SiStation/SiTargetMultiplexer.js +254 -0
- package/SiStation/SiTargetMultiplexer.js.map +1 -0
- package/SiStation/SiTargetMultiplexer.targeting.test.d.ts +2 -0
- package/SiStation/SiTargetMultiplexer.targeting.test.d.ts.map +1 -0
- package/SiStation/SiTargetMultiplexer.targeting.test.js +138 -0
- package/SiStation/SiTargetMultiplexer.targeting.test.js.map +1 -0
- package/SiStation/SiTargetMultiplexer.test.d.ts +2 -0
- package/SiStation/SiTargetMultiplexer.test.d.ts.map +1 -0
- package/SiStation/SiTargetMultiplexer.test.js +588 -0
- package/SiStation/SiTargetMultiplexer.test.js.map +1 -0
- package/{src/SiStation/index.ts → SiStation/index.d.ts} +1 -0
- package/SiStation/index.d.ts.map +1 -0
- package/SiStation/index.js +14 -0
- package/SiStation/index.js.map +1 -0
- package/SiStation/siStationExamples.d.ts +76 -0
- package/SiStation/siStationExamples.d.ts.map +1 -0
- package/SiStation/siStationExamples.js +132 -0
- package/SiStation/siStationExamples.js.map +1 -0
- package/constants.d.ts +76 -0
- package/constants.d.ts.map +1 -0
- package/constants.js +88 -0
- package/constants.js.map +1 -0
- package/constants.test.d.ts +2 -0
- package/constants.test.d.ts.map +1 -0
- package/constants.test.js +52 -0
- package/constants.test.js.map +1 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.d.ts +8 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.d.ts.map +1 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.js +10 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.js.map +1 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.test.d.ts +2 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.test.d.ts.map +1 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.test.js +45 -0
- package/fakes/FakeSiCard/BaseFakeSiCard.test.js.map +1 -0
- package/fakes/FakeSiCard/IFakeSiCard.d.ts +6 -0
- package/fakes/FakeSiCard/IFakeSiCard.d.ts.map +1 -0
- package/fakes/FakeSiCard/IFakeSiCard.js +3 -0
- package/fakes/FakeSiCard/IFakeSiCard.js.map +1 -0
- package/{src/fakes/FakeSiCard/index.ts → fakes/FakeSiCard/index.d.ts} +1 -0
- package/fakes/FakeSiCard/index.d.ts.map +1 -0
- package/fakes/FakeSiCard/index.js +21 -0
- package/fakes/FakeSiCard/index.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.d.ts +15 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.js +73 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.test.d.ts +2 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.test.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.test.js +88 -0
- package/fakes/FakeSiCard/types/FakeModernSiCard.test.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSIAC.d.ts +13 -0
- package/fakes/FakeSiCard/types/FakeSIAC.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSIAC.js +17 -0
- package/fakes/FakeSiCard/types/FakeSIAC.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard10.d.ts +13 -0
- package/fakes/FakeSiCard/types/FakeSiCard10.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard10.js +17 -0
- package/fakes/FakeSiCard/types/FakeSiCard10.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard11.d.ts +13 -0
- package/fakes/FakeSiCard/types/FakeSiCard11.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard11.js +17 -0
- package/fakes/FakeSiCard/types/FakeSiCard11.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.d.ts +15 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.js +70 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.test.d.ts +2 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.test.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.test.js +71 -0
- package/fakes/FakeSiCard/types/FakeSiCard5.test.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.d.ts +15 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.js +73 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.test.d.ts +2 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.test.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.test.js +88 -0
- package/fakes/FakeSiCard/types/FakeSiCard6.test.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard8.d.ts +12 -0
- package/fakes/FakeSiCard/types/FakeSiCard8.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard8.js +16 -0
- package/fakes/FakeSiCard/types/FakeSiCard8.js.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard9.d.ts +12 -0
- package/fakes/FakeSiCard/types/FakeSiCard9.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/FakeSiCard9.js +16 -0
- package/fakes/FakeSiCard/types/FakeSiCard9.js.map +1 -0
- package/{src/fakes/FakeSiCard/types/index.ts → fakes/FakeSiCard/types/index.d.ts} +1 -0
- package/fakes/FakeSiCard/types/index.d.ts.map +1 -0
- package/fakes/FakeSiCard/types/index.js +18 -0
- package/fakes/FakeSiCard/types/index.js.map +1 -0
- package/fakes/FakeSiDeviceDriver.d.ts +42 -0
- package/fakes/FakeSiDeviceDriver.d.ts.map +1 -0
- package/fakes/FakeSiDeviceDriver.js +163 -0
- package/fakes/FakeSiDeviceDriver.js.map +1 -0
- package/fakes/FakeSiMainStation.d.ts +22 -0
- package/fakes/FakeSiMainStation.d.ts.map +1 -0
- package/fakes/FakeSiMainStation.js +150 -0
- package/fakes/FakeSiMainStation.js.map +1 -0
- package/fakes/FakeSiMainStation.test.d.ts +2 -0
- package/fakes/FakeSiMainStation.test.d.ts.map +1 -0
- package/fakes/FakeSiMainStation.test.js +150 -0
- package/fakes/FakeSiMainStation.test.js.map +1 -0
- package/fakes/IFakeSiMainStation.d.ts +14 -0
- package/fakes/IFakeSiMainStation.d.ts.map +1 -0
- package/fakes/IFakeSiMainStation.js +46 -0
- package/fakes/IFakeSiMainStation.js.map +1 -0
- package/{src/fakes/index.ts → fakes/index.d.ts} +1 -0
- package/fakes/index.d.ts.map +1 -0
- package/fakes/index.js +21 -0
- package/fakes/index.js.map +1 -0
- package/index.d.ts +72 -0
- package/index.d.ts.map +1 -0
- package/index.js +49 -0
- package/index.js.map +1 -0
- package/package.json +2 -4
- package/siProtocol.d.ts +58 -0
- package/siProtocol.d.ts.map +1 -0
- package/siProtocol.js +413 -0
- package/siProtocol.js.map +1 -0
- package/siProtocol.test.d.ts +2 -0
- package/siProtocol.test.d.ts.map +1 -0
- package/siProtocol.test.js +524 -0
- package/siProtocol.test.js.map +1 -0
- package/storage/SiArray.d.ts +14 -0
- package/storage/SiArray.d.ts.map +1 -0
- package/storage/SiArray.js +58 -0
- package/storage/SiArray.js.map +1 -0
- package/storage/SiArray.test.d.ts +2 -0
- package/storage/SiArray.test.d.ts.map +1 -0
- package/storage/SiArray.test.js +100 -0
- package/storage/SiArray.test.js.map +1 -0
- package/storage/SiBool.d.ts +13 -0
- package/storage/SiBool.d.ts.map +1 -0
- package/storage/SiBool.js +47 -0
- package/storage/SiBool.js.map +1 -0
- package/storage/SiBool.test.d.ts +2 -0
- package/storage/SiBool.test.d.ts.map +1 -0
- package/storage/SiBool.test.js +80 -0
- package/storage/SiBool.test.js.map +1 -0
- package/storage/SiDataType.d.ts +19 -0
- package/storage/SiDataType.d.ts.map +1 -0
- package/storage/SiDataType.js +50 -0
- package/storage/SiDataType.js.map +1 -0
- package/storage/SiDataType.test.d.ts +2 -0
- package/storage/SiDataType.test.d.ts.map +1 -0
- package/storage/SiDataType.test.js +80 -0
- package/storage/SiDataType.test.js.map +1 -0
- package/storage/SiDict.d.ts +23 -0
- package/storage/SiDict.d.ts.map +1 -0
- package/storage/SiDict.js +56 -0
- package/storage/SiDict.js.map +1 -0
- package/storage/SiDict.test.d.ts +2 -0
- package/storage/SiDict.test.d.ts.map +1 -0
- package/storage/SiDict.test.js +107 -0
- package/storage/SiDict.test.js.map +1 -0
- package/storage/SiEnum.d.ts +21 -0
- package/storage/SiEnum.d.ts.map +1 -0
- package/storage/SiEnum.js +76 -0
- package/storage/SiEnum.js.map +1 -0
- package/storage/SiEnum.test.d.ts +2 -0
- package/storage/SiEnum.test.d.ts.map +1 -0
- package/storage/SiEnum.test.js +75 -0
- package/storage/SiEnum.test.js.map +1 -0
- package/storage/SiFieldValue.d.ts +10 -0
- package/storage/SiFieldValue.d.ts.map +1 -0
- package/storage/SiFieldValue.js +25 -0
- package/storage/SiFieldValue.js.map +1 -0
- package/storage/SiFieldValue.test.d.ts +2 -0
- package/storage/SiFieldValue.test.d.ts.map +1 -0
- package/storage/SiFieldValue.test.js +59 -0
- package/storage/SiFieldValue.test.js.map +1 -0
- package/storage/SiInt.d.ts +20 -0
- package/storage/SiInt.d.ts.map +1 -0
- package/storage/SiInt.js +73 -0
- package/storage/SiInt.js.map +1 -0
- package/storage/SiInt.test.d.ts +2 -0
- package/storage/SiInt.test.d.ts.map +1 -0
- package/storage/SiInt.test.js +79 -0
- package/storage/SiInt.test.js.map +1 -0
- package/storage/SiModified.d.ts +18 -0
- package/storage/SiModified.d.ts.map +1 -0
- package/storage/SiModified.js +56 -0
- package/storage/SiModified.js.map +1 -0
- package/storage/SiModified.test.d.ts +2 -0
- package/storage/SiModified.test.d.ts.map +1 -0
- package/storage/SiModified.test.js +122 -0
- package/storage/SiModified.test.js.map +1 -0
- package/storage/SiStorage.d.ts +14 -0
- package/storage/SiStorage.d.ts.map +1 -0
- package/storage/SiStorage.js +43 -0
- package/storage/SiStorage.js.map +1 -0
- package/storage/SiStorage.test.d.ts +2 -0
- package/storage/SiStorage.test.d.ts.map +1 -0
- package/storage/SiStorage.test.js +86 -0
- package/storage/SiStorage.test.js.map +1 -0
- package/{src/storage/index.ts → storage/index.d.ts} +2 -1
- package/storage/index.d.ts.map +1 -0
- package/storage/index.js +29 -0
- package/storage/index.js.map +1 -0
- package/storage/index.test.d.ts +2 -0
- package/storage/index.test.d.ts.map +1 -0
- package/storage/index.test.js +222 -0
- package/storage/index.test.js.map +1 -0
- package/storage/interfaces.d.ts +38 -0
- package/storage/interfaces.d.ts.map +1 -0
- package/storage/interfaces.js +44 -0
- package/storage/interfaces.js.map +1 -0
- package/storage/siStringEncoding.d.ts +2 -0
- package/storage/siStringEncoding.d.ts.map +1 -0
- package/storage/siStringEncoding.js +1365 -0
- package/storage/siStringEncoding.js.map +1 -0
- package/testUtils.d.ts +25 -0
- package/testUtils.d.ts.map +1 -0
- package/testUtils.js +79 -0
- package/testUtils.js.map +1 -0
- package/testUtils.test.d.ts +2 -0
- package/testUtils.test.d.ts.map +1 -0
- package/testUtils.test.js +307 -0
- package/testUtils.test.js.map +1 -0
- package/utils/NumberRange.d.ts +15 -0
- package/utils/NumberRange.d.ts.map +1 -0
- package/utils/NumberRange.js +48 -0
- package/utils/NumberRange.js.map +1 -0
- package/utils/NumberRange.test.d.ts +2 -0
- package/utils/NumberRange.test.d.ts.map +1 -0
- package/utils/NumberRange.test.js +68 -0
- package/utils/NumberRange.test.js.map +1 -0
- package/utils/NumberRangeRegistry.d.ts +9 -0
- package/utils/NumberRangeRegistry.d.ts.map +1 -0
- package/utils/NumberRangeRegistry.js +82 -0
- package/utils/NumberRangeRegistry.js.map +1 -0
- package/utils/NumberRangeRegistry.test.d.ts +2 -0
- package/utils/NumberRangeRegistry.test.d.ts.map +1 -0
- package/utils/NumberRangeRegistry.test.js +51 -0
- package/utils/NumberRangeRegistry.test.js.map +1 -0
- package/utils/bytes.d.ts +9 -0
- package/utils/bytes.d.ts.map +1 -0
- package/utils/bytes.js +74 -0
- package/utils/bytes.js.map +1 -0
- package/utils/bytes.test.d.ts +2 -0
- package/utils/bytes.test.d.ts.map +1 -0
- package/utils/bytes.test.js +159 -0
- package/utils/bytes.test.js.map +1 -0
- package/utils/errors.d.ts +10 -0
- package/utils/errors.d.ts.map +1 -0
- package/utils/errors.js +27 -0
- package/utils/errors.js.map +1 -0
- package/utils/errors.test.d.ts +2 -0
- package/utils/errors.test.d.ts.map +1 -0
- package/utils/errors.test.js +63 -0
- package/utils/errors.test.js.map +1 -0
- package/utils/events.d.ts +30 -0
- package/utils/events.d.ts.map +1 -0
- package/utils/events.js +81 -0
- package/utils/events.js.map +1 -0
- package/utils/events.test.d.ts +2 -0
- package/utils/events.test.d.ts.map +1 -0
- package/utils/events.test.js +130 -0
- package/utils/events.test.js.map +1 -0
- package/utils/general.d.ts +19 -0
- package/utils/general.d.ts.map +1 -0
- package/utils/general.js +63 -0
- package/utils/general.js.map +1 -0
- package/utils/general.test.d.ts +2 -0
- package/utils/general.test.d.ts.map +1 -0
- package/utils/general.test.js +182 -0
- package/utils/general.test.js.map +1 -0
- package/{src/utils/index.ts → utils/index.d.ts} +1 -0
- package/utils/index.d.ts.map +1 -0
- package/utils/index.js +25 -0
- package/utils/index.js.map +1 -0
- package/utils/mixins.d.ts +2 -0
- package/utils/mixins.d.ts.map +1 -0
- package/utils/mixins.js +15 -0
- package/utils/mixins.js.map +1 -0
- package/utils/mixins.test.d.ts +2 -0
- package/utils/mixins.test.d.ts.map +1 -0
- package/utils/mixins.test.js +74 -0
- package/utils/mixins.test.js.map +1 -0
- package/utils/typed.d.ts +2 -0
- package/utils/typed.d.ts.map +1 -0
- package/utils/typed.js +7 -0
- package/utils/typed.js.map +1 -0
- package/.dependency-cruiser.js +0 -233
- package/.editorconfig +0 -12
- package/.eslintignore +0 -6
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
- package/.github/workflows/npm.yml +0 -17
- package/babel.config.js +0 -21
- package/build-docs.sh +0 -25
- package/docs/index.md +0 -9
- package/docs/typedoc/index.md +0 -11
- package/eslint.base.js +0 -232
- package/install.sh +0 -6
- package/jest.config.ts +0 -49
- package/nx.json +0 -39
- package/src/SiCard/BaseSiCard.test.ts +0 -187
- package/src/SiCard/BaseSiCard.ts +0 -101
- package/src/SiCard/IRaceResultData.ts +0 -16
- package/src/SiCard/ISiCard.ts +0 -23
- package/src/SiCard/ISiCardExamples.ts +0 -4
- package/src/SiCard/raceResultTools.test.ts +0 -260
- package/src/SiCard/raceResultTools.ts +0 -150
- package/src/SiCard/types/FCard.test.ts +0 -19
- package/src/SiCard/types/FCard.ts +0 -14
- package/src/SiCard/types/ModernSiCard.test.ts +0 -186
- package/src/SiCard/types/ModernSiCard.ts +0 -241
- package/src/SiCard/types/PCard.test.ts +0 -19
- package/src/SiCard/types/PCard.ts +0 -14
- package/src/SiCard/types/SIAC.test.ts +0 -84
- package/src/SiCard/types/SIAC.ts +0 -19
- package/src/SiCard/types/SiCard10.test.ts +0 -85
- package/src/SiCard/types/SiCard10.ts +0 -17
- package/src/SiCard/types/SiCard11.test.ts +0 -84
- package/src/SiCard/types/SiCard11.ts +0 -19
- package/src/SiCard/types/SiCard5.test.ts +0 -149
- package/src/SiCard/types/SiCard5.ts +0 -129
- package/src/SiCard/types/SiCard6.test.ts +0 -179
- package/src/SiCard/types/SiCard6.ts +0 -222
- package/src/SiCard/types/SiCard8.test.ts +0 -137
- package/src/SiCard/types/SiCard8.ts +0 -129
- package/src/SiCard/types/SiCard9.test.ts +0 -132
- package/src/SiCard/types/SiCard9.ts +0 -128
- package/src/SiCard/types/TCard.test.ts +0 -19
- package/src/SiCard/types/TCard.ts +0 -14
- package/src/SiCard/types/index.test.ts +0 -26
- package/src/SiCard/types/modernSiCardExamples.ts +0 -364
- package/src/SiCard/types/siCard5Examples.ts +0 -73
- package/src/SiCard/types/siCard6Examples.ts +0 -262
- package/src/SiCard/types/siCard8Examples.ts +0 -152
- package/src/SiCard/types/siCard9Examples.ts +0 -143
- package/src/SiDevice/INavigatorWebSerial.ts +0 -78
- package/src/SiDevice/INavigatorWebUsb.ts +0 -62
- package/src/SiDevice/ISiDevice.ts +0 -48
- package/src/SiDevice/ISiDeviceDriver.ts +0 -35
- package/src/SiDevice/README.md +0 -13
- package/src/SiDevice/SiDevice.test.ts +0 -354
- package/src/SiDevice/SiDevice.ts +0 -132
- package/src/SiDevice/WebSerialSiDeviceDriver.ts +0 -146
- package/src/SiDevice/WebUsbSiDeviceDriver.ts +0 -343
- package/src/SiDevice/testUtils/testISiDeviceDriver.ts +0 -63
- package/src/SiDevice/testUtils/testISiDeviceDriverWithAutodetection.ts +0 -72
- package/src/SiStation/BaseSiStation.test.ts +0 -221
- package/src/SiStation/BaseSiStation.ts +0 -253
- package/src/SiStation/CoupledSiStation.test.ts +0 -41
- package/src/SiStation/CoupledSiStation.ts +0 -130
- package/src/SiStation/ISiMainStation.ts +0 -29
- package/src/SiStation/ISiSendTask.ts +0 -9
- package/src/SiStation/ISiStation.ts +0 -88
- package/src/SiStation/ISiTargetMultiplexer.ts +0 -51
- package/src/SiStation/SiMainStation.test.ts +0 -222
- package/src/SiStation/SiMainStation.ts +0 -133
- package/src/SiStation/SiSendTask.ts +0 -50
- package/src/SiStation/SiTargetMultiplexer.targeting.test.ts +0 -112
- package/src/SiStation/SiTargetMultiplexer.test.ts +0 -605
- package/src/SiStation/SiTargetMultiplexer.ts +0 -241
- package/src/SiStation/siStationExamples.ts +0 -103
- package/src/constants.test.ts +0 -17
- package/src/constants.ts +0 -92
- package/src/fakes/FakeSiCard/BaseFakeSiCard.test.ts +0 -11
- package/src/fakes/FakeSiCard/BaseFakeSiCard.ts +0 -10
- package/src/fakes/FakeSiCard/IFakeSiCard.ts +0 -6
- package/src/fakes/FakeSiCard/types/FakeModernSiCard.test.ts +0 -62
- package/src/fakes/FakeSiCard/types/FakeModernSiCard.ts +0 -43
- package/src/fakes/FakeSiCard/types/FakeSIAC.ts +0 -17
- package/src/fakes/FakeSiCard/types/FakeSiCard10.ts +0 -17
- package/src/fakes/FakeSiCard/types/FakeSiCard11.ts +0 -17
- package/src/fakes/FakeSiCard/types/FakeSiCard5.test.ts +0 -42
- package/src/fakes/FakeSiCard/types/FakeSiCard5.ts +0 -40
- package/src/fakes/FakeSiCard/types/FakeSiCard6.test.ts +0 -62
- package/src/fakes/FakeSiCard/types/FakeSiCard6.ts +0 -44
- package/src/fakes/FakeSiCard/types/FakeSiCard8.ts +0 -16
- package/src/fakes/FakeSiCard/types/FakeSiCard9.ts +0 -16
- package/src/fakes/FakeSiDeviceDriver.ts +0 -148
- package/src/fakes/FakeSiMainStation.test.ts +0 -141
- package/src/fakes/FakeSiMainStation.ts +0 -118
- package/src/fakes/IFakeSiMainStation.ts +0 -15
- package/src/index.ts +0 -24
- package/src/siProtocol.test.ts +0 -509
- package/src/siProtocol.ts +0 -417
- package/src/storage/SiArray.test.ts +0 -103
- package/src/storage/SiArray.ts +0 -56
- package/src/storage/SiBool.test.ts +0 -81
- package/src/storage/SiBool.ts +0 -47
- package/src/storage/SiDataType.test.ts +0 -81
- package/src/storage/SiDataType.ts +0 -60
- package/src/storage/SiDict.test.ts +0 -115
- package/src/storage/SiDict.ts +0 -60
- package/src/storage/SiEnum.test.ts +0 -77
- package/src/storage/SiEnum.ts +0 -48
- package/src/storage/SiFieldValue.test.ts +0 -58
- package/src/storage/SiFieldValue.ts +0 -23
- package/src/storage/SiInt.test.ts +0 -80
- package/src/storage/SiInt.ts +0 -84
- package/src/storage/SiModified.test.ts +0 -135
- package/src/storage/SiModified.ts +0 -59
- package/src/storage/SiStorage.test.ts +0 -51
- package/src/storage/SiStorage.ts +0 -44
- package/src/storage/index.test.ts +0 -222
- package/src/storage/interfaces.ts +0 -41
- package/src/storage/siStringEncoding.ts +0 -1361
- package/src/testUtils.test.ts +0 -266
- package/src/testUtils.ts +0 -75
- package/src/utils/NumberRange.test.ts +0 -66
- package/src/utils/NumberRange.ts +0 -46
- package/src/utils/NumberRangeRegistry.test.ts +0 -49
- package/src/utils/NumberRangeRegistry.ts +0 -43
- package/src/utils/bytes.test.ts +0 -126
- package/src/utils/bytes.ts +0 -69
- package/src/utils/errors.test.ts +0 -29
- package/src/utils/errors.ts +0 -20
- package/src/utils/events.test.ts +0 -112
- package/src/utils/events.ts +0 -68
- package/src/utils/general.test.ts +0 -139
- package/src/utils/general.ts +0 -69
- package/src/utils/mixins.test.ts +0 -40
- package/src/utils/mixins.ts +0 -13
- package/src/utils/typed.ts +0 -3
- package/tsconfig.base.json +0 -22
- package/tsconfig.json +0 -15
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { proto } from '../constants';
|
|
2
|
-
import * as storage from '../storage';
|
|
3
|
-
import * as siProtocol from '../siProtocol';
|
|
4
|
-
import { type ISiStation, SiStationMode, SiStationModel } from './ISiStation';
|
|
5
|
-
import { type ISiTargetMultiplexer, SiTargetMultiplexerTarget } from './ISiTargetMultiplexer';
|
|
6
|
-
|
|
7
|
-
export interface ISiStationStorageFields {
|
|
8
|
-
code: number;
|
|
9
|
-
mode: keyof typeof SiStationMode;
|
|
10
|
-
beeps: boolean;
|
|
11
|
-
flashes: boolean;
|
|
12
|
-
autoSend: boolean;
|
|
13
|
-
extendedProtocol: boolean;
|
|
14
|
-
serialNumber: number;
|
|
15
|
-
firmwareVersion: number;
|
|
16
|
-
buildDate: Date;
|
|
17
|
-
deviceModel: keyof typeof SiStationModel;
|
|
18
|
-
memorySize: number;
|
|
19
|
-
batteryDate: Date;
|
|
20
|
-
batteryCapacity: number;
|
|
21
|
-
batteryState: number;
|
|
22
|
-
backupPointer: number;
|
|
23
|
-
siCard6Mode: number;
|
|
24
|
-
memoryOverflow: number;
|
|
25
|
-
lastWriteDate: Date;
|
|
26
|
-
autoOffTimeout: number;
|
|
27
|
-
refreshRate: number;
|
|
28
|
-
powerMode: number;
|
|
29
|
-
interval: number;
|
|
30
|
-
wtf: number;
|
|
31
|
-
program: number;
|
|
32
|
-
handshake: boolean;
|
|
33
|
-
sprint4ms: boolean;
|
|
34
|
-
passwordOnly: boolean;
|
|
35
|
-
stopOnFullBackup: boolean;
|
|
36
|
-
autoReadout: boolean;
|
|
37
|
-
sleepDay: number;
|
|
38
|
-
sleepSeconds: number;
|
|
39
|
-
workingMinutes: number;
|
|
40
|
-
}
|
|
41
|
-
export const siStationStorageLocations: storage.ISiStorageLocations<ISiStationStorageFields> = {
|
|
42
|
-
code: new storage.SiInt([[0x72], [0x73, 6, 8]]),
|
|
43
|
-
mode: new storage.SiEnum([[0x71]], SiStationMode),
|
|
44
|
-
beeps: new storage.SiBool(0x73, 2),
|
|
45
|
-
flashes: new storage.SiBool(0x73, 0),
|
|
46
|
-
autoSend: new storage.SiBool(0x74, 1),
|
|
47
|
-
extendedProtocol: new storage.SiBool(0x74, 0),
|
|
48
|
-
serialNumber: new storage.SiInt([[0x03], [0x02], [0x01], [0x00]]),
|
|
49
|
-
firmwareVersion: new storage.SiInt([[0x07], [0x06], [0x05]]),
|
|
50
|
-
buildDate: new siProtocol.SiDate(3, (i) => 0x08 + i),
|
|
51
|
-
deviceModel: new storage.SiEnum([[0x0c], [0x0b]], SiStationModel),
|
|
52
|
-
memorySize: new storage.SiInt([[0x0d]]),
|
|
53
|
-
batteryDate: new siProtocol.SiDate(3, (i) => 0x15 + i),
|
|
54
|
-
batteryCapacity: new storage.SiInt([[0x1a], [0x19]]),
|
|
55
|
-
batteryState: new storage.SiInt([[0x37], [0x36], [0x35], [0x34]]),
|
|
56
|
-
// 2000mAh: 000000=0%, 6E0000=100%, 1000mAh:000000=0%, 370000=100%
|
|
57
|
-
backupPointer: new storage.SiInt([[0x22], [0x21], [0x1d], [0x1c]]),
|
|
58
|
-
siCard6Mode: new storage.SiInt([[0x33]]),
|
|
59
|
-
// 08 or FF = 192 punches, 00 or C1 normal
|
|
60
|
-
memoryOverflow: new storage.SiInt([[0x3d]]),
|
|
61
|
-
// overflow if != 00
|
|
62
|
-
lastWriteDate: new siProtocol.SiDate(6, (i) => 0x75 + i),
|
|
63
|
-
autoOffTimeout: new storage.SiInt([[0x7f], [0x7e]]),
|
|
64
|
-
refreshRate: new storage.SiInt([[0x10]]),
|
|
65
|
-
// in 3/sec ???
|
|
66
|
-
powerMode: new storage.SiInt([[0x11]]),
|
|
67
|
-
// 06 low power, 08 standard/sprint
|
|
68
|
-
interval: new storage.SiInt([[0x49], [0x48]]),
|
|
69
|
-
// in 32*ms
|
|
70
|
-
wtf: new storage.SiInt([[0x4b], [0x4a]]),
|
|
71
|
-
// in 32*ms
|
|
72
|
-
program: new storage.SiInt([[0x70]]),
|
|
73
|
-
// xx0xxxxxb competition, xx1xxxxxb training
|
|
74
|
-
handshake: new storage.SiBool(0x74, 2),
|
|
75
|
-
sprint4ms: new storage.SiBool(0x74, 3),
|
|
76
|
-
passwordOnly: new storage.SiBool(0x74, 4),
|
|
77
|
-
stopOnFullBackup: new storage.SiBool(0x74, 5),
|
|
78
|
-
autoReadout: new storage.SiBool(0x74, 7),
|
|
79
|
-
// depends on autoSend
|
|
80
|
-
sleepDay: new storage.SiInt([[0x7b]]),
|
|
81
|
-
// xxxxxxx0b - seconds relative to midnight/midday: 0 = am, 1 = pm
|
|
82
|
-
// xxxx000xb - day of week: 000 = Sunday, 110 = Saturday
|
|
83
|
-
// xx00xxxxb - week counter 0..3, relative to programming date
|
|
84
|
-
sleepSeconds: new storage.SiInt([[0x7d], [0x7c]]),
|
|
85
|
-
workingMinutes: new storage.SiInt([[0x7f], [0x7e]])
|
|
86
|
-
};
|
|
87
|
-
export const siStationStorageDefinition = storage.defineStorage(0x80, siStationStorageLocations);
|
|
88
|
-
// export type ISiStationStorageFields = storage.FieldsFromStorageDefinition<typeof siStationStorageDefinition>;
|
|
89
|
-
// export type ISiStationStorageFields = storage.FieldsFromStorageLocations<typeof siStationStorageLocations>;
|
|
90
|
-
|
|
91
|
-
export abstract class BaseSiStation<T extends SiTargetMultiplexerTarget> {
|
|
92
|
-
public storage: storage.ISiStorage<ISiStationStorageFields>;
|
|
93
|
-
|
|
94
|
-
protected static fromSiTargetMultiplexerWithGivenTarget<U extends SiTargetMultiplexerTarget>(
|
|
95
|
-
multiplexer: ISiTargetMultiplexer,
|
|
96
|
-
multiplexerTarget: U,
|
|
97
|
-
createNewInstance: () => ISiStation<U>
|
|
98
|
-
): ISiStation<U> {
|
|
99
|
-
const existingStationObject = multiplexer.stations[multiplexerTarget] as ISiStation<U> | undefined;
|
|
100
|
-
if (existingStationObject) {
|
|
101
|
-
return existingStationObject;
|
|
102
|
-
}
|
|
103
|
-
const instance = createNewInstance();
|
|
104
|
-
// @ts-ignore
|
|
105
|
-
multiplexer.stations[multiplexerTarget] = instance;
|
|
106
|
-
// TODO: deregister/close
|
|
107
|
-
return instance;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
constructor(public siTargetMultiplexer: ISiTargetMultiplexer, public readonly multiplexerTarget: T) {
|
|
111
|
-
this.storage = siStationStorageDefinition();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
get ident(): string {
|
|
115
|
-
const multiplexerTargetString = SiTargetMultiplexerTarget[this.multiplexerTarget];
|
|
116
|
-
const deviceIdentString = this.siTargetMultiplexer.siDevice.ident;
|
|
117
|
-
return `${multiplexerTargetString}-${deviceIdentString}`;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
sendMessage(message: siProtocol.SiMessage, numResponses = 0, timeoutInMiliseconds = 10000): Promise<number[][]> {
|
|
121
|
-
return this.siTargetMultiplexer.sendMessage(this.multiplexerTarget, message, numResponses, timeoutInMiliseconds);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
readInfo(): Promise<void> {
|
|
125
|
-
return this.sendMessage(
|
|
126
|
-
{
|
|
127
|
-
command: proto.cmd.GET_SYS_VAL,
|
|
128
|
-
parameters: [0x00, 0x80]
|
|
129
|
-
},
|
|
130
|
-
1
|
|
131
|
-
).then((data) => {
|
|
132
|
-
this.storage.splice(0x00, 0x80, ...data[0].slice(3));
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
getField<Field extends keyof ISiStationStorageFields>(infoName: Field): storage.ISiStorageLocations<ISiStationStorageFields>[Field] {
|
|
137
|
-
return this.storage.locations[infoName];
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
getInfo<Field extends keyof ISiStationStorageFields>(infoName: Field): storage.ISiFieldValue<ISiStationStorageFields[Field]> | undefined {
|
|
141
|
-
return this.storage.get(infoName);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
setInfo<Field extends keyof ISiStationStorageFields>(infoName: Field, newValue: storage.ISiFieldValue<ISiStationStorageFields[Field]> | ISiStationStorageFields[Field]): void {
|
|
145
|
-
this.storage.set(infoName, newValue);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
writeChanges(): Promise<void> {
|
|
149
|
-
const newStorage = this.storage.data;
|
|
150
|
-
return this.readInfo().then(() => {
|
|
151
|
-
const oldStorage = this.storage.data;
|
|
152
|
-
return this.writeDiff(oldStorage, newStorage);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
atomically(doThings: () => void): Promise<void> {
|
|
157
|
-
return this.readInfo().then(() => {
|
|
158
|
-
const oldStorage = this.storage.data;
|
|
159
|
-
doThings();
|
|
160
|
-
const newStorage = this.storage.data;
|
|
161
|
-
return this.writeDiff(oldStorage, newStorage);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
writeDiff(oldStorage: storage.ISiStorageData, newStorage: storage.ISiStorageData): Promise<void> {
|
|
166
|
-
const zippedStorageBytes = oldStorage.zip(newStorage);
|
|
167
|
-
const isByteDirty = zippedStorageBytes.map((oldAndNew: [unknown, unknown]) => oldAndNew[0] !== oldAndNew[1]);
|
|
168
|
-
const dirtyRanges = isByteDirty.reduce((ranges: [number, number][], isDirty: boolean, byteIndex: number): [number, number][] => {
|
|
169
|
-
if (!isDirty) {
|
|
170
|
-
return ranges;
|
|
171
|
-
}
|
|
172
|
-
const numRanges = ranges.length;
|
|
173
|
-
const lastRange = ranges[numRanges - 1];
|
|
174
|
-
if (lastRange && lastRange[1] === byteIndex) {
|
|
175
|
-
return [...ranges.slice(0, numRanges - 1), [lastRange[0], byteIndex + 1]];
|
|
176
|
-
}
|
|
177
|
-
return [...ranges, [byteIndex, byteIndex + 1]];
|
|
178
|
-
}, [] as [number, number][]);
|
|
179
|
-
let dirtyRangeIndex = 0;
|
|
180
|
-
const processDirtyRanges = (): Promise<void> => {
|
|
181
|
-
if (dirtyRangeIndex >= dirtyRanges.length) {
|
|
182
|
-
return Promise.resolve();
|
|
183
|
-
}
|
|
184
|
-
const dirtyRange = dirtyRanges[dirtyRangeIndex];
|
|
185
|
-
const parameters = [dirtyRange[0], ...newStorage.slice(dirtyRange[0], dirtyRange[1])] as number[];
|
|
186
|
-
return this.sendMessage(
|
|
187
|
-
{
|
|
188
|
-
command: proto.cmd.SET_SYS_VAL,
|
|
189
|
-
parameters: parameters
|
|
190
|
-
},
|
|
191
|
-
1
|
|
192
|
-
).then((d) => {
|
|
193
|
-
const data = d[0];
|
|
194
|
-
data.splice(0, 2);
|
|
195
|
-
if (data[0] !== parameters[0]) {
|
|
196
|
-
console.warn(`SET_SYS_VAL error: ${data[0]} (expected ${parameters[0]})`);
|
|
197
|
-
}
|
|
198
|
-
dirtyRangeIndex += 1;
|
|
199
|
-
return processDirtyRanges();
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
|
-
return processDirtyRanges();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
getTime(): Promise<Date | undefined> {
|
|
208
|
-
return this.sendMessage(
|
|
209
|
-
{
|
|
210
|
-
command: proto.cmd.GET_TIME,
|
|
211
|
-
parameters: []
|
|
212
|
-
},
|
|
213
|
-
1
|
|
214
|
-
).then((d) => siProtocol.arr2date(d[0].slice(2)));
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
setTime(newTime: Date): Promise<Date | undefined> {
|
|
218
|
-
// TODO: compensate for waiting time
|
|
219
|
-
return this.sendMessage(
|
|
220
|
-
{
|
|
221
|
-
command: proto.cmd.SET_TIME,
|
|
222
|
-
parameters: [...siProtocol.date2arr(newTime)]
|
|
223
|
-
},
|
|
224
|
-
1
|
|
225
|
-
).then((d) => siProtocol.arr2date(d[0].slice(2)));
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
signal(countArg: number): Promise<void> {
|
|
229
|
-
const count = countArg < 1 ? 1 : countArg;
|
|
230
|
-
return this.sendMessage(
|
|
231
|
-
{
|
|
232
|
-
command: proto.cmd.SIGNAL,
|
|
233
|
-
parameters: [count]
|
|
234
|
-
},
|
|
235
|
-
1
|
|
236
|
-
).then((data) => {
|
|
237
|
-
if (data[0][2] !== count) {
|
|
238
|
-
throw new Error('NUM BEEPS');
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
powerOff(): Promise<number[][]> {
|
|
244
|
-
// Does not power off BSM8 (USB powered), though
|
|
245
|
-
return this.sendMessage(
|
|
246
|
-
{
|
|
247
|
-
command: proto.cmd.OFF,
|
|
248
|
-
parameters: []
|
|
249
|
-
},
|
|
250
|
-
0
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from '@jest/globals';
|
|
2
|
-
import * as testUtils from '../testUtils';
|
|
3
|
-
import type { ISiDevice, ISiDeviceDriverData } from '../SiDevice/ISiDevice';
|
|
4
|
-
import type { ISiDeviceDriver } from '../SiDevice/ISiDeviceDriver';
|
|
5
|
-
import { SiDevice } from '../SiDevice/SiDevice';
|
|
6
|
-
import { SiTargetMultiplexerTarget } from './ISiTargetMultiplexer';
|
|
7
|
-
import { CoupledSiStation } from './CoupledSiStation';
|
|
8
|
-
import { SiTargetMultiplexer } from './SiTargetMultiplexer';
|
|
9
|
-
|
|
10
|
-
testUtils.useFakeTimers();
|
|
11
|
-
|
|
12
|
-
function mockDriver(driver: Partial<ISiDeviceDriver<ISiDeviceDriverData<unknown>>>) {
|
|
13
|
-
return driver as unknown as ISiDeviceDriver<ISiDeviceDriverData<unknown>>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
describe('CoupledSiStation', () => {
|
|
17
|
-
test('fromSiDevice', () => {
|
|
18
|
-
const fakeSiDevice = new SiDevice('fromSiDevice', {
|
|
19
|
-
driver: mockDriver({ name: 'FakeSiDevice' })
|
|
20
|
-
});
|
|
21
|
-
const myCoupledStation1 = CoupledSiStation.fromSiDevice(fakeSiDevice);
|
|
22
|
-
expect(myCoupledStation1 instanceof CoupledSiStation).toBe(true);
|
|
23
|
-
expect(myCoupledStation1.ident).toBe('Remote-FakeSiDevice-fromSiDevice');
|
|
24
|
-
expect(myCoupledStation1.multiplexerTarget).toBe(SiTargetMultiplexerTarget.Remote);
|
|
25
|
-
const myCoupledStation2 = CoupledSiStation.fromSiDevice(fakeSiDevice);
|
|
26
|
-
expect(myCoupledStation2).toBe(myCoupledStation1);
|
|
27
|
-
expect(myCoupledStation2.ident).toBe('Remote-FakeSiDevice-fromSiDevice');
|
|
28
|
-
expect(myCoupledStation2.multiplexerTarget).toBe(SiTargetMultiplexerTarget.Remote);
|
|
29
|
-
});
|
|
30
|
-
test('fromSiTargetMultiplexer', () => {
|
|
31
|
-
const myTargetMultiplexer = new SiTargetMultiplexer({ ident: 'fake-ident' } as ISiDevice<ISiDeviceDriverData<unknown>>);
|
|
32
|
-
const myCoupledStation1 = CoupledSiStation.fromSiTargetMultiplexer(myTargetMultiplexer);
|
|
33
|
-
expect(myCoupledStation1 instanceof CoupledSiStation).toBe(true);
|
|
34
|
-
expect(myCoupledStation1.ident).toBe('Remote-fake-ident');
|
|
35
|
-
expect(myCoupledStation1.multiplexerTarget).toBe(SiTargetMultiplexerTarget.Remote);
|
|
36
|
-
const myCoupledStation2 = CoupledSiStation.fromSiTargetMultiplexer(myTargetMultiplexer);
|
|
37
|
-
expect(myCoupledStation2).toBe(myCoupledStation1);
|
|
38
|
-
expect(myCoupledStation2.ident).toBe('Remote-fake-ident');
|
|
39
|
-
expect(myCoupledStation2.multiplexerTarget).toBe(SiTargetMultiplexerTarget.Remote);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import type { ISiDevice, ISiDeviceDriverData } from '../SiDevice/ISiDevice';
|
|
2
|
-
import type { ISiStation } from './ISiStation';
|
|
3
|
-
import { type ISiTargetMultiplexer, SiTargetMultiplexerTarget } from './ISiTargetMultiplexer';
|
|
4
|
-
import { BaseSiStation } from './BaseSiStation';
|
|
5
|
-
import { SiTargetMultiplexer } from './SiTargetMultiplexer';
|
|
6
|
-
import { proto } from '../constants';
|
|
7
|
-
import * as siProtocol from '../siProtocol';
|
|
8
|
-
|
|
9
|
-
export class CoupledSiStation extends BaseSiStation<SiTargetMultiplexerTarget.Remote> implements ISiStation<SiTargetMultiplexerTarget.Remote> {
|
|
10
|
-
static fromSiDevice(siDevice: ISiDevice<ISiDeviceDriverData<unknown>>): CoupledSiStation {
|
|
11
|
-
const multiplexer = SiTargetMultiplexer.fromSiDevice(siDevice);
|
|
12
|
-
return this.fromSiTargetMultiplexer(multiplexer);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
static fromSiTargetMultiplexer(multiplexer: ISiTargetMultiplexer): CoupledSiStation {
|
|
16
|
-
return this.fromSiTargetMultiplexerWithGivenTarget(multiplexer, SiTargetMultiplexerTarget.Remote, () => new this(multiplexer, SiTargetMultiplexerTarget.Remote)) as CoupledSiStation;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async getBackupData(turnOff:boolean=true): Promise<{ code: number, cardNumber: number|undefined ; date: Date | undefined}[]> {
|
|
20
|
-
let backupData: { code: number, cardNumber: number|undefined ; date: Date | undefined}[] = []
|
|
21
|
-
let backupNextWritePointer:number = 0
|
|
22
|
-
|
|
23
|
-
// Get backup pointer
|
|
24
|
-
for(let tries = 0; tries<10 && (backupNextWritePointer == 0 || backupNextWritePointer == undefined); tries++){
|
|
25
|
-
try{
|
|
26
|
-
await this.siTargetMultiplexer.sendMessage(
|
|
27
|
-
SiTargetMultiplexerTarget.Remote,
|
|
28
|
-
{
|
|
29
|
-
command: proto.cmd.GET_SYS_VAL,
|
|
30
|
-
parameters: [0x1c,0x07]
|
|
31
|
-
},
|
|
32
|
-
1, 10000).then((d) => {
|
|
33
|
-
backupNextWritePointer = (d[0][3]<<24) | (d[0][4]<<16) | (d[0][8]<<8) | d[0][9]
|
|
34
|
-
}).catch(async (e) => {
|
|
35
|
-
await this.siTargetMultiplexer.sendMessage(
|
|
36
|
-
SiTargetMultiplexerTarget.Remote,
|
|
37
|
-
{
|
|
38
|
-
command: proto.WAKEUP,
|
|
39
|
-
parameters: []
|
|
40
|
-
},
|
|
41
|
-
0, 10000)
|
|
42
|
-
await new Promise( resolve => setTimeout(resolve, 500) );
|
|
43
|
-
})
|
|
44
|
-
}catch (e){ // ignore, try again
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if(backupNextWritePointer == 0 || backupNextWritePointer == undefined){
|
|
48
|
-
return Promise.reject(new Error("Unable to access coupled si station!"))
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let backupReadLocation = 0x0100
|
|
53
|
-
let backupMaxLocation = 0x200000
|
|
54
|
-
let backupStorageSize = 128
|
|
55
|
-
while(backupReadLocation < backupNextWritePointer && backupReadLocation < backupMaxLocation){
|
|
56
|
-
try{
|
|
57
|
-
const actualReadLength = Math.min(backupStorageSize,backupNextWritePointer-backupReadLocation)
|
|
58
|
-
await this.siTargetMultiplexer.sendMessage(
|
|
59
|
-
SiTargetMultiplexerTarget.Remote,
|
|
60
|
-
{
|
|
61
|
-
command: proto.cmd.GET_BACKUP,
|
|
62
|
-
parameters: [(backupReadLocation>>16)&0xff,(backupReadLocation>>8)&0xff,backupReadLocation&0xff,actualReadLength]
|
|
63
|
-
},
|
|
64
|
-
1, 10000)
|
|
65
|
-
.then((d) => {
|
|
66
|
-
let cn = (d[0][0]<<8)|d[0][1]
|
|
67
|
-
let addr = (d[0][2]<<16)|(d[0][3]<<8)|d[0][4]
|
|
68
|
-
let p = 5
|
|
69
|
-
while (p<d[0].length){
|
|
70
|
-
let sicard = siProtocol.arr2cardNumber([d[0][p+2],d[0][p+1],d[0][p+0]])
|
|
71
|
-
let datedata = [
|
|
72
|
-
d[0][p+3]>>2, // Year = bit 7-2
|
|
73
|
-
(((d[0][p+3]&0x3)<<2)|((d[0][p+4]>>6)&0x3)), // Month = bit 1-0 and 7-6
|
|
74
|
-
((d[0][p+4]>>1)&0x1F), // day = bit 5-1
|
|
75
|
-
(d[0][p+4]&0x1), // am/pm halfday = 0 bit
|
|
76
|
-
d[0][p+5],
|
|
77
|
-
d[0][p+6],
|
|
78
|
-
d[0][p+7]
|
|
79
|
-
]
|
|
80
|
-
let date = siProtocol.arr2date(datedata)
|
|
81
|
-
if(addr+p<=backupNextWritePointer){
|
|
82
|
-
backupData.push({code:cn,cardNumber:sicard,date:date})
|
|
83
|
-
}else{
|
|
84
|
-
break
|
|
85
|
-
}
|
|
86
|
-
p+=proto.REC_LEN
|
|
87
|
-
}
|
|
88
|
-
backupReadLocation += actualReadLength
|
|
89
|
-
})
|
|
90
|
-
}catch(e){
|
|
91
|
-
if(backupStorageSize >= 2*proto.REC_LEN){
|
|
92
|
-
backupStorageSize/=2
|
|
93
|
-
console.log("reduce requested backup block size to", backupStorageSize)
|
|
94
|
-
}else{
|
|
95
|
-
return Promise.reject("Unable to read backup data")
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Confirm read end with signal
|
|
102
|
-
await this.siTargetMultiplexer.sendMessage(
|
|
103
|
-
SiTargetMultiplexerTarget.Remote,
|
|
104
|
-
{
|
|
105
|
-
command: proto.cmd.SIGNAL,
|
|
106
|
-
parameters: [0x2]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
// Turn of unit if requested
|
|
110
|
-
if(turnOff){
|
|
111
|
-
await new Promise( resolve => setTimeout(resolve, 250) );
|
|
112
|
-
for(let tries = 0, hasTurnedOff=false; tries<5&&!hasTurnedOff; tries++){
|
|
113
|
-
await this.siTargetMultiplexer.sendMessage(
|
|
114
|
-
SiTargetMultiplexerTarget.Remote,
|
|
115
|
-
{
|
|
116
|
-
command: proto.cmd.OFF,
|
|
117
|
-
parameters: []
|
|
118
|
-
}
|
|
119
|
-
,1,10000
|
|
120
|
-
).then(()=>{
|
|
121
|
-
hasTurnedOff = true
|
|
122
|
-
}).catch(e=>{
|
|
123
|
-
hasTurnedOff = false
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return backupData
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ISiCard } from '../SiCard/ISiCard';
|
|
2
|
-
import * as utils from '../utils';
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
5
|
-
export interface ISiMainStation extends utils.IEventTarget<SiMainStationEvents> {}
|
|
6
|
-
|
|
7
|
-
export class SiMainStationSiCardInsertedEvent extends utils.Event<'siCardInserted'> {
|
|
8
|
-
constructor(public siMainStation: ISiMainStation, public siCard: ISiCard) {
|
|
9
|
-
super();
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class SiMainStationSiCardRemovedEvent extends utils.Event<'siCardRemoved'> {
|
|
14
|
-
constructor(public siMainStation: ISiMainStation, public siCard: ISiCard) {
|
|
15
|
-
super();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class SiMainStationSiCardObservedEvent extends utils.Event<'siCardObserved'> {
|
|
20
|
-
constructor(public siMainStation: ISiMainStation, public siCard: ISiCard) {
|
|
21
|
-
super();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type SiMainStationEvents = {
|
|
26
|
-
siCardInserted: SiMainStationSiCardInsertedEvent;
|
|
27
|
-
siCardRemoved: SiMainStationSiCardRemovedEvent;
|
|
28
|
-
siCardObserved: SiMainStationSiCardObservedEvent;
|
|
29
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { SiTargetMultiplexerTarget } from './ISiTargetMultiplexer';
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
4
|
-
export interface ISiStation<T extends SiTargetMultiplexerTarget> {
|
|
5
|
-
multiplexerTarget: T;
|
|
6
|
-
ident: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const SiStationMode = {
|
|
10
|
-
SIACSpecialFunction1: 0x01, // Source: SI Config+
|
|
11
|
-
// 7B=battery test, 7C=on, 7D=off, 7F=radio readout
|
|
12
|
-
Control: 0x02, // Source: SI Config+
|
|
13
|
-
Start: 0x03, // Source: SI Config+
|
|
14
|
-
Finish: 0x04, // Source: SI Config+
|
|
15
|
-
Readout: 0x05, // Source: SI Config+
|
|
16
|
-
Clear: 0x07, // Source: SI Config+
|
|
17
|
-
Check: 0x0a, // Source: SI Config+
|
|
18
|
-
Print: 0x0b, // Source: old SI Config
|
|
19
|
-
StartWithTimeTrigger: 0x0c, // Source: old SI Config
|
|
20
|
-
FinishWithTimeTrigger: 0x0d, // Source: old SI Config
|
|
21
|
-
SIACSpecialFunction2: 0x11, // Source: SI Config+
|
|
22
|
-
// 7C=test
|
|
23
|
-
BCControl: 0x12, // Source: old SI Config
|
|
24
|
-
BCStart: 0x13, // Source: old SI Config
|
|
25
|
-
BCFinish: 0x14, // Source: old SI Config
|
|
26
|
-
BCSlave: 0x1f, // Source: old SI Config
|
|
27
|
-
BeaconControl: 0x32, // Source: SI Config+
|
|
28
|
-
BeaconStart: 0x33, // Source: SI Config+
|
|
29
|
-
BeaconFinish: 0x34 // Source: SI Config+
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/* eslint-disable no-unused-vars,no-shadow */
|
|
33
|
-
export enum SiStationType {
|
|
34
|
-
Main = 0x00,
|
|
35
|
-
Sprint = 0x01,
|
|
36
|
-
Print = 0x02,
|
|
37
|
-
Field = 0x03,
|
|
38
|
-
Master = 0x04
|
|
39
|
-
}
|
|
40
|
-
/* eslint-enable no-unused-vars,no-shadow */
|
|
41
|
-
|
|
42
|
-
export const SiStationModel = {
|
|
43
|
-
BSF3: 0x8003,
|
|
44
|
-
BSF4: 0x8004,
|
|
45
|
-
BSF5: 0x8115,
|
|
46
|
-
BSF6: 0x8146,
|
|
47
|
-
BSF7A: 0x8117,
|
|
48
|
-
BSF7B: 0x8197,
|
|
49
|
-
BSF8A: 0x8118,
|
|
50
|
-
BSF8B: 0x8198,
|
|
51
|
-
BS7Master: 0x8187,
|
|
52
|
-
BS8Master: 0x8188,
|
|
53
|
-
BSM4: 0x8084,
|
|
54
|
-
BSM6: 0x8086,
|
|
55
|
-
BSM7: 0x9197,
|
|
56
|
-
BSM8: 0x9198,
|
|
57
|
-
BS7S: 0x9597,
|
|
58
|
-
BS7P: 0xb197,
|
|
59
|
-
BS7GSM: 0xb897,
|
|
60
|
-
BS8P: 0xb198
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
interface SiStationModelInfo {
|
|
64
|
-
description: string;
|
|
65
|
-
type: SiStationType;
|
|
66
|
-
series: number;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const SI_STATION_MODEL_INFO: { [model in keyof typeof SiStationModel]: SiStationModelInfo } = {
|
|
70
|
-
BSF3: { description: 'BSF3', type: SiStationType.Field, series: 3 },
|
|
71
|
-
BSF4: { description: 'BSF4', type: SiStationType.Field, series: 4 },
|
|
72
|
-
BSF5: { description: 'BSF5', type: SiStationType.Field, series: 5 },
|
|
73
|
-
BSF6: { description: 'BSF6', type: SiStationType.Field, series: 6 },
|
|
74
|
-
BSF7A: { description: 'BSF7', type: SiStationType.Field, series: 7 },
|
|
75
|
-
BSF7B: { description: 'BSF7', type: SiStationType.Field, series: 7 },
|
|
76
|
-
BSF8A: { description: 'BSF8', type: SiStationType.Field, series: 8 },
|
|
77
|
-
BSF8B: { description: 'BSF8', type: SiStationType.Field, series: 8 },
|
|
78
|
-
BS7Master: { description: 'BS7-Master', type: SiStationType.Master, series: 7 },
|
|
79
|
-
BS8Master: { description: 'BS8-Master', type: SiStationType.Master, series: 8 },
|
|
80
|
-
BSM4: { description: 'BSM4', type: SiStationType.Main, series: 4 },
|
|
81
|
-
BSM6: { description: 'BSM6', type: SiStationType.Main, series: 6 },
|
|
82
|
-
BSM7: { description: 'BSM7', type: SiStationType.Main, series: 7 },
|
|
83
|
-
BSM8: { description: 'BSM8', type: SiStationType.Main, series: 8 },
|
|
84
|
-
BS7S: { description: 'BS7-S', type: SiStationType.Sprint, series: 7 },
|
|
85
|
-
BS7P: { description: 'BS7-P', type: SiStationType.Print, series: 7 },
|
|
86
|
-
BS7GSM: { description: 'BS7-GSM', type: SiStationType.Field, series: 7 },
|
|
87
|
-
BS8P: { description: 'BS8-P', type: SiStationType.Print, series: 8 }
|
|
88
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as utils from '../utils';
|
|
2
|
-
import type * as siProtocol from '../siProtocol';
|
|
3
|
-
import type { ISiDevice, ISiDeviceDriverData } from '../SiDevice/ISiDevice';
|
|
4
|
-
import type { ISiStation } from './ISiStation';
|
|
5
|
-
import type { SiSendTask } from './SiSendTask';
|
|
6
|
-
|
|
7
|
-
export interface ISiTargetMultiplexer extends utils.IEventTarget<SiTargetMultiplexerEvents> {
|
|
8
|
-
_test: _ISiTargetMultiplexerTestData;
|
|
9
|
-
stations: { [Target in SiTargetMultiplexerTarget]?: ISiStation<Target> };
|
|
10
|
-
target: SiTargetMultiplexerTarget;
|
|
11
|
-
latestTarget: SiTargetMultiplexerTarget;
|
|
12
|
-
siDevice: ISiDevice<ISiDeviceDriverData<unknown>>;
|
|
13
|
-
sendMessage: (target: SiTargetMultiplexerTarget, message: siProtocol.SiMessage, numResponses?: number, timeoutInMiliseconds?: number) => Promise<number[][]>;
|
|
14
|
-
sendMessageToLatestTarget: (message: siProtocol.SiMessage, numResponses: number | undefined, timeoutInMiliseconds: number | undefined) => Promise<number[][]>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface _ISiTargetMultiplexerTestData {
|
|
18
|
-
latestTarget: SiTargetMultiplexerTarget;
|
|
19
|
-
sendQueue: SiSendTask[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* eslint-disable no-unused-vars,no-shadow */
|
|
23
|
-
export enum SiTargetMultiplexerTarget {
|
|
24
|
-
Unknown = 0,
|
|
25
|
-
Switching = 1,
|
|
26
|
-
Direct = 2,
|
|
27
|
-
Remote = 3
|
|
28
|
-
}
|
|
29
|
-
/* eslint-enable no-unused-vars,no-shadow */
|
|
30
|
-
|
|
31
|
-
export class SiTargetMultiplexerMessageEvent extends utils.Event<'message'> {
|
|
32
|
-
constructor(public siTargetMultiplexer: ISiTargetMultiplexer, public message: siProtocol.SiMessage) {
|
|
33
|
-
super();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class SiTargetMultiplexerDirectMessageEvent extends utils.Event<'directMessage'> {
|
|
37
|
-
constructor(public siTargetMultiplexer: ISiTargetMultiplexer, public message: siProtocol.SiMessage) {
|
|
38
|
-
super();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export class SiTargetMultiplexerRemoteMessageEvent extends utils.Event<'remoteMessage'> {
|
|
42
|
-
constructor(public siTargetMultiplexer: ISiTargetMultiplexer, public message: siProtocol.SiMessage) {
|
|
43
|
-
super();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type SiTargetMultiplexerEvents = {
|
|
48
|
-
message: SiTargetMultiplexerMessageEvent;
|
|
49
|
-
directMessage: SiTargetMultiplexerDirectMessageEvent;
|
|
50
|
-
remoteMessage: SiTargetMultiplexerRemoteMessageEvent;
|
|
51
|
-
};
|