Package-level declarations

Types

Link copied to clipboard

Channel type strings of the BrainAccess Board LSL contract (v1), in their canonical spelling. Board and the SDK classify columns by these exact strings.

Link copied to clipboard

Channel unit strings of the BrainAccess Board LSL contract (v1).

Link copied to clipboard
class DecodeState(var lastSample: Int = 0, var batteryPct: Float = -1.0f, var anchorOnNextPacket: Boolean = false, var counterJumps: Long = 0, var stalePackets: Long = 0)

Mutable per-device decode state carried across packets (sample cursor and battery level).

Link copied to clipboard
data class DeviceConfig(val model: DeviceModel, val channels: List<String>, val gain: List<Int>, val bias: List<Boolean>, val active: List<Boolean>, val srate: Int, val impedanceMode: ImpedanceMode)

Immutable device configuration.

Link copied to clipboard

Hardware generation of a headset, as the device itself reports it in the Device Information Service Model Number string (0x2A24): a decimal code shared with the BrainAccess C SDK and the device firmware.

Link copied to clipboard

BrainAccess device montages, each with its channel layout and factory defaults; EXG8 (the 8-channel V3 board, advertised as "BA EXG8 ") carries the MINI layout.

Link copied to clipboard
class EegFrame(val samples: FloatArray, val accel: FloatArray?, val gyro: FloatArray?, val sampleIndex: Long, val isDummy: Boolean, val batteryPct: Float, val digitalInput: Boolean = false)

One decoded sample (one time-point across all active electrodes), with typed fields for electrodes, IMU, sample index, gap flag and battery.

Link copied to clipboard
Link copied to clipboard
data class Electrode(val channel: String, val x: Float, val y: Float, val z: Float)

10-5 / 10-20 electrode coordinates, ported as reference data for consumers (montage, visualization).

Link copied to clipboard
object Electrodes

What every BrainAccess cap and HALO electrode is made of, as the Board contract publishes it (hardware of each channel, cap node). The forehead electrodes PAD_CHANNELS are gold pads, every other electrode has spring-loaded pins.

Link copied to clipboard
object GattUuids

GATT service / characteristic / descriptor UUIDs for BrainAccess devices.

Link copied to clipboard

Electrode impedance measurement mode — config blob byte 0 (codes are the wire contract, shared with the BrainAccess C SDK). Non-OFF modes make the device inject a small AC test current through the bias electrodes at the given frequency; the device computes electrode impedance on-chip (Ohm's law, Z = Vpp / I) and streams it directly in kΩ.

Link copied to clipboard
object OtaControl

Firmware-update control opcodes for GattUuids.FIRMWARE_UPDATE_SERVICE (vendor OTA contract).

Link copied to clipboard

What the device streams on its EEG channels — the one-byte value of the output-mode characteristic (GattUuids.OUTPUT_MODE_CHARACTERISTIC); codes are the wire contract, shared with the BrainAccess C SDK. Firmware 3.7.0 and later expose the characteristic; older firmware has none and always streams NORMAL.

Link copied to clipboard

Wire codec for BrainAccess stream packets and the channel-config blob.

Link copied to clipboard

Wire protocol v1 of the time-sync characteristic (GattUuids.TIME_SYNC_CHARACTERISTIC, firmware 3.8.0+), shared with the device firmware. The device builds the 20-byte value inside its read handler from its own clock and the sample it numbered last, so one timed read ties the host's clock, the device's clock and the ADS1299 sample counter together (see TimeSync in :core). Little-endian:

Link copied to clipboard
data class TimeSyncReply(val flags: Int, val streamGen: Int, val seq: Int, val sampleNumber: Long, val sampleAgeUs: Long, val tNowUs: Long, val connInterval: Int)

One decoded reply of GattUuids.TIME_SYNC_CHARACTERISTIC (wire protocol v1, firmware 3.8.0+). See TimeSyncBlock for the byte layout. Unsigned wire fields are widened so every value is non-negative: 8- and 16-bit fields are Int, 32-bit fields are Long.

Properties

Link copied to clipboard
const val ADC_PRECISION_BITS: Int = 24

ADC resolution of every BrainAccess amplifier (ADS1299), bits.

Link copied to clipboard
const val ADXL343_COUNTS_PER_G: Float = 256.0f

ADXL343 as the V2 firmware programs it (DATA_FORMAT = 0, ±2 g, right-justified): 3.9 mg/LSB.

Link copied to clipboard
const val GYRO_FULL_SCALE_DPS: Float = 250.0f

ICM-42670-P gyroscope full scale as the firmware programs it (GYRO_UI_FS_SEL = ±250 dps).

Link copied to clipboard
const val ICM42670_COUNTS_PER_G: Float = 16384.0f

ICM-42670-P at ±2 g full scale, 16-bit two's complement.

Link copied to clipboard
const val STANDARD_GRAVITY: Float = 9.80665f

Standard gravity in m/s² per g.