Jump to content

Technical Reference:Operator Library

From BCI2000 Wiki
Revision as of 15:38, 13 January 2011 by Mellinger (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Operator Library is a shared library that encapsulates the Operator Module's core functionality into an easy-to-use interface that allows to embed Operator functionality into one's own application. This way, it is easy write your own Operator module, or to control BCI2000 from your own application, using any programming language that allows using a shared library (DLL).

System State

BCI2000 system state may be queried using BCI_GetStateOfOperation(), and modified using the BCI_SetConfig(), BCI_StartRun(), and BCI_StopRun() functions.

System state is one of the following:

BCI_StateUnavailable

The system is not available for changes to system state.

BCI_StateStartup

The Operator module is waiting for core modules to connect.

BCI_StateInitialization

Core modules are connected, the system is waiting to be parameterized via SetConfig().

BCI_StateResting

The system has been parameterized and is waiting for a StartRun() command.

BCI_StateSuspended

The system has been suspended via StopRun(), or from one of the modules setting the "Running" state variable to 0.

BCI_StateParamsModified

The system has been suspended, and parameters have been modified from one or more of the core modules.

BCI_StateRunning

The system is running.

BCI_StateTermination

The system is waiting for termination.

BCI_StateBusy

The system is currently busy, and not in one of the above states. It is not available for changes to system state.

System state may be manipulated calling one of the following functions:

int BCI_GetStateOfOperation()

Determines the externally visible state of the state machine, i.e. the state of operation of the BCI2000 system.

int BCI_SetConfig()

purpose: Applies current parameter settings to the BCI2000 system. returns: 1 if successful, 0 otherwise.

int BCI_StartRun()

purpose: Starts a new run. returns: 1 if successful, 0 otherwise.

int BCI_StopRun()

purpose: Stops the current run. returns: 1 if successful, 0 otherwise.

Callbacks

Miscellaneous Functions