Skip to content

DEV-1504 Native BLE as a ShimmerPC transport (for Consensys 2.2.14) - #358

Open
JongChern wants to merge 2 commits into
masterfrom
DEV-1504_consensys_native_ble_alpha
Open

JongChern wants to merge 2 commits into
masterfrom
DEV-1504_consensys_native_ble_alpha

Conversation

@JongChern

@JongChern JongChern commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Hold: merge only after Consensys 2.2.13 is released. This is for Consensys 2.2.14, which also brings the Shimmer3R microphone update.

What

Native BLE as a transport of ShimmerPC. Consensys can connect a Shimmer3/3R through shimmerble, an in-process BLE library (Rust on btleplug, loaded through JNI), instead of the gRPC BLE server.

  • ByteCommunicationNativeBle is a ByteCommunication, like ByteCommunicationJSSC. ShimmerPC.setNativeBleDevice() selects it; without it, ShimmerPC uses its COM port as before. The device object, its protocol and its state are the same over Classic and BLE.
  • A link lost over BLE makes reads and writes fail, as a lost COM port does, so ShimmerPC's existing connection-lost handling applies.
  • shimmerble/, the driver.ble.nativeble binding and the native-ble.yml workflow come from the DEV-1132 prototype. ShimmerBLENative is left out; the transport replaces it.
  • The Windows x64 and macOS arm64 builds of the library are committed under ShimmerDriverPC/src/main/resources/native/, both from one run of the Native BLE library workflow (37553575065), so every build of the driver carries them, Consensys's release build included. The READMEs say how to refresh them: bump the version, run the workflow, commit its binaries. A local buildNative is not to be committed.

Other APIs

None need this change: it is a transport for the Java driver, with no change to the wire format, parsing, calibration or timestamps. shimmer-host-core is not affected.

Tests

  • API_00053_ByteCommunicationNativeBleTest (11) and API_00054_ShimmerPCTransportTest (4) run against a fake radio, so they need no Bluetooth. Both pass.
  • On hardware, Windows 11, Consensys from source, a Shimmer3R docked: the BT | BLE choice survives a restart; connect over BLE (Ready in about 6 s) and reconnect three times; stream, stop and disconnect; the docked unit stays one device with one state; Classic to BLE and back in one session on the same device; and a unit over BLE and another over Classic streaming together at 100%.
  • Not tested yet: a link lost mid-stream, the message when the library can't load, a Shimmer3 (RN4678) over native BLE, and anything on macOS.
  • DEV-1544 asks for the full test on macOS and Windows.

Related

🤖 Generated with Claude Code

JongChern and others added 2 commits November 19, 2026 14:25
Adds shimmerble, the in-process BLE library (Rust on btleplug, loaded
through JNI), and lets ShimmerPC talk through it instead of its COM
port. ByteCommunicationNativeBle is a ByteCommunication, like
ByteCommunicationJSSC, and ShimmerPC.setNativeBleDevice() chooses it.
The device object, its protocol and its state stay the same over
Bluetooth Classic and BLE.

- shimmerble/, the driver.ble.nativeble binding and the native-ble.yml
  workflow come from the DEV-1134 branch, where the DEV-1132 prototype
  continued. ShimmerBLENative is left out; the transport replaces it.
- A link lost over BLE makes reads and writes fail, as a lost COM port
  does, so ShimmerPC's existing connection-lost handling applies.
- buildNative builds the library into src/main/resources/native/. The
  binaries are not committed.
- Tests: API_00051 to API_00054, run against a fake radio, so they need
  no Bluetooth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shimmerble.dll (Windows x64) and libshimmerble.dylib (macOS arm64) go
into ShimmerDriverPC/src/main/resources/native/, so every build of the
driver carries them. That includes Consensys's release build, which
compiles the driver from source for both installers. Both binaries are
the Native BLE library workflow's builds of this shimmerble/ source,
from one run (37553575065).

The READMEs say how to refresh them when shimmerble/ changes: bump the
version, run the workflow, and commit its binaries with the change. A
local buildNative is not to be committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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