process Data
fun processData(data: ByteArray, deviceConfig: BADeviceConfig, lastSample: Int, batteryLevel: Float, isWriteToFile: Boolean = false, callback: (chunk: FloatArray, isDummy: Boolean, lastSample: Int) -> Unit, fileCallback: (arrayToWrite: DoubleArray) -> Unit = {}): Boolean
Processes raw ByteArray data from a BrainAccess device using the provided BADeviceConfig, and invokes a callback with parsed signal chunks.
Return
True if data was processed successfully, false on failure.
Parameters
data
The raw byte data received from the device.
device Config
The configuration of the device.
last Sample
The index of the last processed sample.
battery Level
Current battery level.
is Write To File
Whether to output values for file writing using fileCallback.
callback
Callback for each parsed data chunk with parameters: - chunk: Parsed EEG (and accelerometer) data with metadata. - isDummy: Whether the chunk is a dummy due to missing samples. - lastSample: Sample index.
file Callback
Optional callback for writing parsed data to a file (used when isWriteToFile is true).