Skip to content

DEV-1305: C# HIL in-stream, start-on-connected, sampling-rate and app-thread items - #222

Merged
JongChern merged 1 commit into
masterfrom
DEV-1305_csharp_hil_parity
Oct 23, 2026
Merged

JongChern merged 1 commit into
masterfrom
DEV-1305_csharp_hil_parity

Conversation

@JongChern

@JongChern JongChern commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

DEV-1305. The C#, Java and shimmer-logandstream HILs check the same firmware on the same bench, but each grew its own items, so a defect one finds can go unchecked in another API. This adds the four items the C# HIL lacked that one of the other two already runs. Companion PRs add the Java and shimmer-logandstream gaps: ShimmerResearch/Shimmer-Java-Android-API#336 and ShimmerResearch/shimmer-host-core#10.

New items

Item What it does Fails when
stream.in_stream Reads the battery and the SD directory while streaming: three times each on its own, then twice both at once, both written before either reply. As the Java HIL's inStream does. A reply doesn't arrive within 3 s (5 s when they overlap), the battery reads outside 3.0-4.5 V, or the stream fails the checks
link.start_on_connected Configures the unit on one link. Then, on a second link, starts streaming as soon as the API reports Connected, while Connect() is still reading the configuration, as an app reacting to the state change would. The Java HIL checks this on every connect (DEV-1275). The API never streams, the start or Connect() fails, the API reads the configuration wrongly, or the stream fails the checks
config.sampling_rate Writes 51.2, 256 and 512 Hz in turn, streams 5 s at each, and judges each stream against its own rate. Then writes the suite's rate back. As the shimmer-logandstream HIL's item of that name does. A write doesn't take, a stream fails the checks, or the rate doesn't go back
stream.app_threads Streams 20 s while three app threads call the API in loops: one reads the battery, one the SD directory, one queries the API's state and configuration. As the Java HIL's queueStress does. A call or the replies stall for 10 s, a call throws, no request of either kind is answered, or the stream fails the checks. Unanswered requests are counted, not failed

Supporting changes:

  • Link.Open takes an action to run when the API first reports Connected.
  • Link.Record takes the rate to judge a stream against.

On the bench

The four items ran over Classic and BLE on a Shimmer3R (LogAndStream 1.1.22) and a Shimmer3 (LogAndStream 1.1.7, RN4678), with master's API.

Shimmer3R, Classic Shimmer3R, BLE Shimmer3, Classic Shimmer3, BLE
stream.in_stream pass: 8 of 8 answered pass: 8 of 8 pass: 8 of 8, 1 sample skipped accel only (DEV-1271)
link.start_on_connected pass pass pass accel only (DEV-1271)
config.sampling_rate pass at all three rates pass 512 Hz: 1.87 % missing not covered (DEV-1246)
stream.app_threads pass pass pass accel only (DEV-1271)

Starting on Connected is safe in this API. The start went in 1.2-1.4 s before Connect() returned, with one reply to the connect sequence still to come. The stream came up whole every time, and the API's configuration was intact. So the C# API doesn't have the problem the Java HIL's DEV-1275 check catches.

Calls from app threads held up. During stream.app_threads, the API answered 40 battery reads, about 32 directory reads and about 850 state queries in 20 s, with no stall. Over both transports, the Shimmer3R missed one directory reply out of 32.

The Shimmer3 loses samples over Classic at 512 Hz on its own side. The 46 missing samples came in five clean bursts of 3-15 samples, with nothing misaligned. The C# API isn't the cause. The other two APIs see the same on this unit at 512 Hz: 0.20 % in a 5 s Java stream, and 2-3 % from shimmer-logandstream. The Shimmer3R loses nothing at 512 Hz in any of the three.

The directory read back empty on both units. That is the reply the firmware sends when the unit isn't logging. It arrived, which is what the item checks.

🤖 Generated with Claude Code

…-thread items

Four items the Java and shimmer-logandstream HILs already have an equivalent of:

- stream.in_stream: reads the battery and the SD directory while streaming, three times each on
  its own and then twice both at once, as the Java HIL's inStream does. Fails on a reply that does
  not arrive within 3 s (5 s overlapping), a battery outside 3.0-4.5 V, or the stream checks.
- link.start_on_connected: configures the unit on one link, then on a second starts streaming as
  soon as the API reports Connected, while Connect() is still reading the configuration, as an app
  reacting to the state change would (the Java HIL's DEV-1275 check). Fails if the API never
  streams, a call fails, the API reads the configuration wrongly, or the stream fails the checks.
- config.sampling_rate: writes 51.2, 256 and 512 Hz in turn, streams 5 s at each and judges each
  against its own rate, then writes the suite's rate back, as the shimmer-logandstream HIL does.
- stream.app_threads: streams 20 s while three app threads read the battery, read the SD directory
  and query the API's state in loops, as the Java HIL's queueStress does. Fails on a 10 s stall, a
  call that throws, no reply of either kind, or the stream checks; unanswered requests are counted.

Link.Open takes an action to run when the API first reports Connected, and Record a rate to judge
the stream against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JongChern
JongChern merged commit 1d1c998 into master Oct 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant