BrainAccessClient
Entry point: owns the scanner (app-scoped, independent of connections, so scan-while- connected is trivial) and the live DeviceSessions. Multiple simultaneous devices are supported — each connection is an independent session with its own scope.
Parameters
the BLE stack (:transport-android in prod, a fake in tests).
config persistence (defaults to in-memory).
parent scope for sessions; cancel it to tear everything down.
Constructors
Properties
Phone Bluetooth adapter on/off, observed reactively (see Transport.bluetoothState).
Functions
Connect and bring device to DeviceState.Ready. Returns the session, or a failed Result (carrying a BrainAccessError) if connect/handshake fails — in which case any partial connection is torn down.
Disconnect and forget a single device.
Disconnect every active session.
Scan for BrainAccess devices; runs independently of any active session.