feat(sdk): add kinesis over Bluetooth transport#134
Draft
andrewjaykeller wants to merge 1 commit intomasterfrom
Draft
feat(sdk): add kinesis over Bluetooth transport#134andrewjaykeller wants to merge 1 commit intomasterfrom
andrewjaykeller wants to merge 1 commit intomasterfrom
Conversation
✅ Deploy Preview for neurosity-sdk-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Routes `neurosity.kinesis(label)` through the BLE transport whenever the active streaming mode is Bluetooth, giving offline / LAN-only clients feature parity with the cloud path. - `BluetoothClient` now multicasts the `kinesis` characteristic and exposes `kinesis(label?)` with cloud-equivalent label filtering. - `Neurosity.kinesis()` uses `_withStreamingModeObservable` so the BLE branch is taken when active, mirroring `focus`/`calm`/`accelerometer`. - Adds unit coverage for the BLE path at both layers (`BluetoothClient.kinesis` + `Neurosity.kinesis`). Note: `@neurosity/ipk@2.13.0` does not yet define a `kinesis` entry in `BLUETOOTH_CHARACTERISTICS`, so the BLE payload will remain inert at runtime until the firmware and IPK ship the characteristic UUID. The SDK-side routing is ready and will start emitting as soon as the IPK upgrade lands — no further SDK changes required. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c34237b to
8c20f8e
Compare
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.
Summary
Route
neurosity.kinesis(label)through the BLE transport whenever the activestreaming mode is Bluetooth, so offline / LAN-only clients get the same
classification stream as cloud-connected clients. The change mirrors the
dual-transport pattern used by
focus,calm, andaccelerometer— norefactoring of the transport-switching helper was needed.
Design choice
BluetoothClientgains a shared_kinesis$multicast on thekinesisBLE characteristic and a publickinesis(label?)method thatapplies cloud-equivalent label filtering client-side.
Neurosity.kinesis()now calls_withStreamingModeObservable({ wifi, bluetooth })instead of hard-coding the cloud path. WhenactiveModeisBLUETOOTH, the stream comes straight off the BLE characteristic with nocloud roundtrip.
label), which keeps the firmware payload simple:
{ metric, label, probability, timestamp }per classification event.Unknowns / needs firmware + IPK verification
The client routing is in place, but
@neurosity/ipk@2.13.0does not yetship a
kinesisentry inBLUETOOTH_CHARACTERISTICS. Until the firmwareexposes the characteristic and the IPK registers its UUID:
WebBluetoothTransport.characteristicsByName["kinesis"]will beundefinedat runtime, so the subscription stays idle (no events). This is the same
graceful-no-op behaviour every other feature had before its firmware shipped.
will start emitting automatically.
Follow-ups (not in this PR):
kinesisBLE characteristic (notify) thatemits the same JSON events the cloud emits.
@neurosity/ipk: add akinesisUUID toBLUETOOTH_CHARACTERISTICS.@neurosity/ipkin this repo to pick up the UUID.Test plan
npm run build— succeedsnpm test— 18 suites / 138 tests passing (6 pre-existing skips)npm run lint— no new warnings introducednpm audit— no new vulnerabilities introduced (pre-existingfollow-redirects+protobufjsadvisories already onmaster)BluetoothClient.kinesis()subscribing to thekinesischaracteristic, filtering by label, and emitting all eventswhen no label is provided
Neurosity.kinesis()selecting the BLE branch whenactiveMode === BLUETOOTHand propagating label filteringManual verification (requires firmware + IPK follow-ups above)
BLUETOOTH_WITH_WIFI_FALLBACK, callneurosity.kinesis("leftHandPinch"),confirm events flow without WiFi.
BLE.
🤖 Generated with Claude Code