Repository navigation
DEV-1305: Java HIL rollover, idleStart and samplingRates scenarios - #336
Merged
Merged
Conversation
Three checks the C# and shimmer-logandstream HILs already run on the same bench: - rollover: streams 10 minutes, past the 512 s wrap of the unit's 3-byte timestamp counter, and fails on streamRest's checks or if the raw counter never wrapped. TimestampWraps counts the wraps from the TIMESTAMP channel's raw ticks, which HilSession now records with each sample. - idleStart: leaves the link idle 60 s with the driver's timers on, then fails if the link was lost or a command timed out during the wait, if streaming starts more than 500 ms after startStreaming(), or on the stream checks. - samplingRates: writes 51.2, 256 and 512 Hz in turn the Consensys way, streams 5 s at each and checks the rate, then writes the unit's own rate back. run-java-hil.ps1 runs all eight scenarios by default, so -Report requires the new ones too. TimestampWrapsTest runs in CI. No driver code changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DEV-1305. The Java, C# and shimmer-logandstream HILs check the same firmware on the same bench, but each grew its own scenarios, so a defect one finds can go unchecked in another API. This adds the three the Java HIL lacked that one of the other two already runs. Companion PRs add the C# and shimmer-logandstream gaps: ShimmerResearch/Shimmer-C-API#222 and ShimmerResearch/shimmer-host-core#10.
samplingRatesfails on master, because it found a driver bug (below). Until the driver is fixed, a-Reportrun, which needs every scenario to pass, will fail.New scenarios
rolloverstreamRestdoes, then streams 600 s (hil.rolloverSeconds), across the 512 s wrap of the 3-byte timestamp. As the C# HIL'sstream.rolloverdoes.streamRest's checks, a parser error or command timeout, a lost link, or a raw counter that never wraps. The report recordscounterWrapsidleStarthil.idleSeconds) with the driver's timers on, then streams 10 s. As C#'slink.idle_startand shimmer-logandstream'sclassic.idle_startdo.startStreaming(); orstreamRest's checks. The report recordsstartMsandstatusRequestsWhileIdlesamplingRatesconfigureAccelOnly(the Consensys path), streams 5 s at each, then writes the unit's own rate back. As shimmer-logandstream'sconfig.sampling_ratedoes.All three use the watchdog and the DEV-1275 connect check.
run-java-hil.ps1runs all eight scenarios by default, and-Reportrequires all eight.TimestampWraps, the wrap counter, is unit-tested in CI.On the bench
Run on a Shimmer3 (LogAndStream 1.1.7, RN4678) and a Shimmer3R (LogAndStream 1.1.22) over Classic:
rolloveridleStartsamplingRatesAt 512 Hz, the Shimmer3 lost 5 samples in 2 gaps (0.20 %), and the Shimmer3R lost none. The C# and shimmer-logandstream HILs also see the Shimmer3 lose samples over Classic at 512 Hz, so that loss is the unit's own.
The bug
samplingRatesfoundA configuration written straight after
stopStreaming()loses its first InfoMem chunk.SET_INFOMEM_COMMANDs, and the first one holds the sampling rate.ShimmerBluetooth's handling of the stop's ACK while streaming (about line 845). It ends withremoveInstruction(0), and by then the head of the instruction list is the first chunk queued after the stop.This PR changes test code only and leaves the driver alone. A side effect on the bench: the failed write-back left both units at 512 Hz, until they were reconfigured.
🤖 Generated with Claude Code