ba_set_config#

Change the BrainAccess library configuration.

Function Signature#

function config = ba_set_config(varargin)

Usage#

config = ba_set_config(name, value, ...)

Inputs#

name, value

one or more of these settings:

'enable_logs'

logical; false writes no log file at all.

'log_path'

path of the log file (default ‘bacore.log’ in the current folder).

'log_level'

0 verbose, 1 debug, 2 info (default), 3 warning, 4 error.

'append_logs'

logical; false (default) overwrites the file.

'timestamps_enabled'

logical; prefix log lines with a timestamp.

'thread_ids_enabled'

logical; include the thread ID in log lines.

'autoflush'

logical; flush the log after every line.

'log_buffer_size'

log buffer size in bytes.

'chunk_size'

samples per stream chunk, 1 to 100 (default 25).

'adapter_index'

Linux only: Bluetooth controller to use, 0 to 255.

'update_path'

firmware image for ba_start_update.

Outputs#

config

the full configuration after the change.

Example#

ba_set_config('enable_logs', false)
ba_set_config('log_path', fullfile(tempdir, 'bacore.log'), 'log_level', 3)

Notes#

Initializes the library like ba_init if needed. The settings stay in force for the rest of the MATLAB session, also across ba_close and ba_init, until MATLAB exits or the MEX gateway is cleared (clear mex). chunk_size applies from the next stream, adapter_index from the next scan or connect.

Source File#

matlab/ba_set_config.m