After each Power Cycle, the TSE Store is locked and no transactions are possible until the time of the host has been synchronized with the time of the TSE using this command.
Depending on the accuracy of the internal clock, this command must also be repeated regularly to keep the host and TSE time synchronized. How often the time must be synchronized is announced in worm_info_maxTimeSynchronizationDelay.
After each power cycle, the TSE runs a self test to ensure proper operation of its internal modules. The self test requires to check that the TSE is plugged into an authorized system.
The self test can be repeated whenever it is desired by the ERS, but it must be run at least once every 25 hours. Otherwise, the TSE will set the state selfTestRun to inactive, which makes all future commands fail until the self test is run successfully again. The time until the selfTestRun state will be made inactive can be obtained with worm_info_timeUntilNextSelfTest.
The self test is a potentially long running operation that might take up to 60 seconds to complete.
Hier aufgepasst: Ist die TSE mit dem Computer verbunden und das Kassenprogramm hat seit 25 Stunden die Zeit nicht mehr geupdated (falls dieses am Wochenende nicht aktiv war) kommt es zu folgendem Problem:
SelbstTest wird durchgeführt -> Zeit wird upgedated (25 Stunden nach vorne) -> SelbstTest müsste wieder durchgeführt werden.
SwissBit empfiehlt folgenden Ablauf beim Starten der Kassensoftware:
1. Check `worm_info_hasPassedSelfTest`. If true, selfTest is not required, go to 3.
2. Run SelfTest.
3. Check `worm_info_hasValidTime`. If true, nothing to do, go to 7.
4. Login TimeAdmin (might not be needed in case ECR is already logged in, but also does not do any harm except of taking 250ms)
--> if this fails with WORM_ERROR_SIG_ERROR or WORM_ERROR_POWER_CYCLE_DETECTED, goto 2
5. UpdateTime
--> if this fails with WORM_ERROR_SIG_ERROR, goto 2
6. Go to 1. (since UpdateTime might invalidate the SelfTest in case the time jumps too far into the future with regards to the last time that was set on the TSE)
7. Done