Repository navigation
DEV-1306: Android HIL samplingRates, configuring straight after a stop - #138
Merged
JongChern merged 1 commit intoOct 23, 2026
Conversation
Up to driver 0.11.10_beta, a configuration written straight after stopStreaming() could lose its first chunk, the one holding the sampling rate: operationPrepare() cleared the instruction list while the STOP was still in flight, and the stop's reply then retired the next instruction in its place. The unit kept its old rate. The Java HIL's samplingRates found it on a Shimmer3 and a Shimmer3R. Android configures through the same driver code over both transports, and had no scenario for it. samplingRates, as in the Java and shimmer-logandstream HILs, writes 51.2, 256 and 512 Hz in turn and streams 5 s at each, then writes the unit's own rate back; every configure but the first comes straight after a stop. Unlike the Java HIL's configure, the Android one can finish on the manager's SUCCESS without looking at the rate, so the scenario checks that the rate read back is the one written. No SD card is needed. The runner runs it by default and the README lists it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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-1306. A new Android HIL scenario,
samplingRates, that reproduces the driver's configure-after-stop bug and shows #135's driver bump (0.11.11_beta, now on master) fixes it on Android. Stacked on #136; merge #128, #134 and #136 first.The bug
Up to driver 0.11.10_beta, a configuration written straight after
stopStreaming()could lose its first chunk, the one holding the sampling rate.operationPrepare()cleared the instruction list while the STOP was still in flight, and the stop's reply then retired the next instruction in its place. The unit kept its old rate, with no error. The Java HIL'ssamplingRatesfound it (Shimmer-Java-Android-API#337). Android configures through the same driver code over both transports, and the Android HIL had no scenario that configures after a stop.The scenario
As in the Java and shimmer-logandstream HILs, it writes 51.2, 256 and 512 Hz in turn and streams 5 s at each, then writes the unit's own rate back. Every configure but the first comes straight after a stop, as an app that changes the rate does.
The Android configure can finish on the manager's SUCCESS without looking at the rate, so the scenario also checks that the rate read back from the unit is the one written. No SD card is needed. The runner runs it by default and the README lists it.
Tested on the bench
s3r-2f31 (Shimmer3R, LogAndStream v1.1.22) over BLE, from an M2101K6G phone on Android 11, with a 1-byte link CRC:
The 0.11.7 log has DEV-1306's exact signature. After
STOP_STREAMING_COMMAND, the configuration sent only theSET_INFOMEMchunks at offsets 0x0080 and 0x0100. The chunk at 0x0000, which holds the sampling rate, was never sent, so the read-back still showed the old rate's divisor (0x0280, 51.2 Hz).🤖 Generated with Claude Code