Skip to content

DEV-1473: Shimmer Capture on the Java driver, to shimmer-host-core's CAPTURE.md - #350

Merged
JongChern merged 7 commits into
masterfrom
DEV-1473_java_shimmer_capture
Nov 14, 2026
Merged

JongChern merged 7 commits into
masterfrom
DEV-1473_java_shimmer_capture

Conversation

@JongChern

@JongChern JongChern commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

DEV-1473. A Swing Shimmer Capture on this repository's Java driver, in ShimmerPCBasicExamples (com.shimmerresearch.capture, ./gradlew runCapture). It does what shimmer-host-core's bindings/CAPTURE.md says every Capture app does, as far as the driver can do it today, so its figures and CSV files compare with the host-core apps'. It also opens DEV-971's event markers window and draws each button or TTL edge on the plot.

On master. The DEV-971 event channel work it needs is merged (#343), and master is merged into this branch, so this diff is the Capture app only: 9 files in ShimmerPCBasicExamples.

What it does

  • Link: Bluetooth Classic, one device at a time, through BasicShimmerBluetoothManagerPc with its BLE (gRPC) server not started.
  • Figures: CAPTURE.md's table, counted as it defines them:
    • Missing samples, from gaps in the device timestamps.
    • Reception, delay, Rx /s and the time since the last sample.
    • PRR, battery, link lost, errors, and the hardware / firmware summary.
  • Stream: Start and Stop, the plot in CAPTURE.md's panels, and Record to CSV in CAPTURE.md's format:
    • names, units, and the driver's channel order;
    • numbers written as JavaScript writes them;
    • RFC 4180 cells and CRLF line ends.
  • Device:
    • read battery and status, and the red LED;
    • read and set the clock, and read the Bluetooth module's version;
    • the sampling rate, and start and stop SD logging;
    • the driver's own sensor and settings dialogs.
  • Event markers: the DEV-971 window (byte 232, opt in, live records, status, event files). While streaming, each edge is drawn on the plot, placed by its own Shimmer clock against the samples' device time.

The README lists what CAPTURE.md asks for that the driver has no command for yet: the data-rate test, the factory test, the names, the SD card over Bluetooth, the SD configuration file update, and the module update. It also lists what the app itself does not do yet: several devices, BLE, USB, the clock drift, CAPTURE.md's configuration editor, and the no-hardware check.

Tested

  • CaptureRulesTest, 15 tests, with host-core's Java Capture test inputs and results for the numbers, cells, file names and figures.
    The two newest check that a unit connected by its COM port is named by the MAC in its configuration (bytes 224-229), since the driver's getMacId() is empty there, and that erased MAC bytes count as no MAC.

  • On a Shimmer3R (LogAndStream v1.1.26, Classic, COM port), run three times, connecting each time:

    • live event records, idle and while streaming, on USB power and on battery;
    • SD logging started and stopped by double presses;
    • byte 232 written and read back.

    Every record arrived in sequence; the bench results are on DEV-971: Java event markers - event files, live records, status, and a test window #348 and DEV-971: fix five event-channel parser defects found in #348's review #349.

  • CI does not build ShimmerPCBasicExamples, so it was built and tested locally.

Not tested

The CSV has been checked only by its tests, not against a host-core app's recording of the same stream.

🤖 Generated with Claude Code

JongChern and others added 3 commits November 13, 2026 15:41
…CAPTURE.md

A Swing Shimmer Capture on this repository's driver, in ShimmerPCBasicExamples
(com.shimmerresearch.capture, ./gradlew runCapture). It does what
shimmer-host-core's bindings/CAPTURE.md says every Capture app does, as far as
the driver can today, so its figures and files compare with the host-core apps':

- Bluetooth Classic, one device, through BasicShimmerBluetoothManagerPc with
  its BLE (gRPC) server not started;
- CAPTURE.md's figures, counted as it defines them (missing samples from gaps
  in the device timestamps, reception, delay, Rx /s, last sample, PRR, battery,
  link lost, errors, the hardware / firmware summary);
- start, stop, the plot in CAPTURE.md's panels, and Record to CSV in its format
  (names, units, the driver's channel order, JavaScript number text, RFC 4180,
  CRLF);
- read battery and status, the red LED, read and set the clock, the Bluetooth
  module, the sampling rate, start and stop SD logging, and the driver's own
  sensor and settings dialogs.

The README lists what CAPTURE.md asks for that the driver has no command for
yet (data-rate test, factory test, names, SD card over Bluetooth, the SD config
file update, module update) and what this app does not do yet.

CaptureRulesTest (13 tests) uses host-core's Java Capture test inputs and
results for the numbers, cells, file names and figures. CI does not build this
module; built, tested and started locally.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… button is pressed

Stacked on DEV-971's Java event channel (#348). The Stream tab's Event markers
button opens its window (byte 232, opt in, live records, status, event files),
and each button or TTL edge is drawn on every plot panel shown, placed by its
own Shimmer clock against the samples' device time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JongChern
JongChern changed the base branch from DEV-971_java_event_markers to DEV-971_event_channel November 13, 2026 07:57
@JongChern
JongChern changed the base branch from DEV-971_event_channel to master November 13, 2026 09:14
JongChern and others added 3 commits November 13, 2026 17:20
Brings in #343 as merged, with #351's event channel fixes and renumbered tests.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
… driver's lock

Found in review of the Capture app:
- Closing the window stops a stream, closes a recording and closes the link
  before it exits. It exited at once, so a recording's rows since its last
  one-second flush were lost.
- A paint copies out the points in its window under the lock, then draws
  without it. It held the lock add() takes on the driver's thread for the
  whole paint, and made an array per point.
- A recording is closed when a write fails, and when its header rows fail.
- Connect is refused while a connect is under way.
- The plot's format is kept in a field, not read from its box on the
  driver's thread.
- STREAMING_LOGGED_DATA is STREAMING. It fell through to DISCONNECTED.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@JongChern
JongChern marked this pull request as ready for review November 13, 2026 09:29
…r a COM port

Connected by its COM port, the unit's Bluetooth MAC is null: the manager has
no address to give it, and the driver's getMacId() then never looks at the
MAC in the configuration read on connect (bytes 224-229). So recordings were
named Shimmer3R_0000_... and the device panel showed no MAC; seen on a
Shimmer3R on COM32 whose MAC ends 2F31.

CaptureDevice.macIdOf() falls back to that MAC, unless it is erased (FF) or
zero. CaptureRulesTest gains two tests; the first failed before the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JongChern
JongChern merged commit fd52a10 into master Nov 14, 2026
2 checks passed
@JongChern
JongChern deleted the DEV-1473_java_shimmer_capture branch November 14, 2026 08:03
JongChern added a commit that referenced this pull request Nov 16, 2026
Master gained only the Capture app in ShimmerPCBasicExamples. No conflicts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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