The Core Rule
Your device adapter should emitHeadbandFrameV1 frames through a
HeadbandTransport.
That is the compatibility boundary for browser apps and downstream analysis.
If the frame contract is correct, app code can stay simple. If the frame
contract is unstable, everything above it becomes harder to trust.
HeadbandFrameV1
Every transport produces the same top-level frame shape:
eeg as the required block and add
other blocks only when the device exposes them clearly.
HeadbandSignalBlock
The EEG payload should be normalized into this shape:
What Must Stay Stable
| Field | What good looks like |
|---|---|
source | A stable, readable identifier such as vendor-ble |
sequenceId | Monotonic within the running session |
sampleRateHz | Matches the actual device behavior |
channelNames | Stable and documented |
channelCount | Always matches the real row width |
samples | Each row is one time step and uses the same channel order |
timestampsMs | Optional, but aligned with the emitted rows when present |
clockSource | Explicitly documented as device or local |
HeadbandTransport
All transports implement the same lifecycle surface:
Lifecycle Expectations
| Method | Expected behavior |
|---|---|
connect() | Pair or attach to the device and prepare the session |
start() | Begin streaming valid frames |
stop() | Stop streaming without corrupting the session |
disconnect() | Release the session and underlying resources |
HeadbandTransportStatus
Status updates should be explicit enough for apps to react correctly:
Practical Rules for Integrators
Keep channel order fixed
If the device streams
TP9, AF7, AF8, TP10, every emitted row should use
that order consistently.Make row width match channel count
A row should never contain more or fewer EEG values than
channelCount.Document timestamp behavior
State whether timestamps come from the device clock or a local browser clock.
Minimal Usage Pattern
Related Docs
Next
Protocol Requirements
Gather the packet and metadata details needed to satisfy the contract.
Adapter Implementation
Wire the contract into a real device adapter.