Driver SDK  1.6
Typedefs | Functions
Signal Object

Typedefs

typedef struct bbt_signal_s bbt_signal_t
 Opaque type to handle signals from Bitbrain devices. More...
 

Functions

BBT_SDK_API char * bbt_signal_get_type (const bbt_signal_t *signal, char *output_buffer, unsigned int max_len)
 Gets the type of the signal. More...
 
BBT_SDK_API unsigned int bbt_signal_get_channels (const bbt_signal_t *signal)
 Gets the number of channels that compose the signal. More...
 
BBT_SDK_API unsigned int bbt_signal_get_samples (const bbt_signal_t *signal)
 Gets the number of measurements gathered in every message. More...
 
BBT_SDK_API int bbt_signal_get_mode (const bbt_signal_t *signal)
 Gets the current working mode of the signal. More...
 
BBT_SDK_API int bbt_signal_set_mode (const bbt_signal_t *signal, int mode)
 Sets the working mode of the signal. More...
 

Detailed Description

The bbt_signal_t object is the one used to manage the signals provided by a device.

The type of the signal is identified by a string of 5 characters (plus the '\0') and can be accessed using bbt_signal_get_type()

Each signal represents a different output from the device and is composed by different channels (bbt_signal_get_channels()). For instance, an EEG signal can have 8, 12, 16 or 32 channels, depending on the device you are using.

In addition, signal may have different sampling rates and thus, in each message read from the device (bbt_driver_read()) there are different number of samples (bbt_signal_get_samples()).

The mode of a signal (bbt_signal_get_mode()) indicates if the device is acquiring the specific signal or not. A signal with mode 0 is disabled and so it is not acquired. Signals with mode > 0 are enabled, acquired and trasnmitted to the computer. The mode can be configured with bbt_signal_set_mode(). Note that the bandwidth and the size of the output of bbt_driver_read() changes whit the configuration of the signals.

Typedef Documentation

◆ bbt_signal_t

typedef struct bbt_signal_s bbt_signal_t

Opaque type to handle signals from Bitbrain devices.

Each device may have several signals and are identified by the unique index from 0 to bbt_driver_get_number_of_signals() - 1. The handles are provided by the object bbt_driver_t using the function bbt_driver_get_signal() with the corresponding index.

Function Documentation

◆ bbt_signal_get_type()

BBT_SDK_API char* bbt_signal_get_type ( const bbt_signal_t signal,
char *  output_buffer,
unsigned int  max_len 
)

Gets the type of the signal.

Parameters
[in]signalThe signal object
[out]output_bufferThe buffer to write the string to.
[in]max_lenThe size of the output buffer
Precondition
The object signal must be not NULL
Returns
A string with the type of signal
Examples
example/main.cpp.

◆ bbt_signal_get_channels()

BBT_SDK_API unsigned int bbt_signal_get_channels ( const bbt_signal_t signal)

Gets the number of channels that compose the signal.

Parameters
[in]signalThe signal object
Precondition
The object signal must be not NULL
Returns
Number of channels that compose the signal
Examples
example/main.cpp.

◆ bbt_signal_get_samples()

BBT_SDK_API unsigned int bbt_signal_get_samples ( const bbt_signal_t signal)

Gets the number of measurements gathered in every message.

Parameters
[in]signalThe signal object
Precondition
The object signal must be not NULL
Returns
The number of samples per message of this signal
Examples
example/main.cpp.

◆ bbt_signal_get_mode()

BBT_SDK_API int bbt_signal_get_mode ( const bbt_signal_t signal)

Gets the current working mode of the signal.

A signal with mode 0 is disabled (no data will be received from the device) Signals may have different working modes. Any mode above 0 will enable the signal and the device will send data to the driver. Different working modes modify the type of data provided by the device. Check the documentation of the corresponding device for detailed information about the modes of each signal.

Parameters
[in]signalThe signal object
Precondition
The object signal must be not NULL
Returns
The current mode of the signal
Examples
example/main.cpp.

◆ bbt_signal_set_mode()

BBT_SDK_API int bbt_signal_set_mode ( const bbt_signal_t signal,
int  mode 
)

Sets the working mode of the signal.

A signal with mode 0 is disabled (no data will be received from the device) Signals may have different working modes. Any mode above 0 will enable the signal and the device will send data to the driver. Different working modes modify the type of data provided by the device. Mode 1 enables the signal in the basic functionality Check the documentation of the corresponding device for detailed information about the modes of each signal. If the mode is not valid for a signal, it will not be changed and false will be returned

Parameters
[in]signalThe signal object
[in]modeThe mode to set to the signal
Precondition
The object signal must be not NULL
Returns
> 0 if the mode can be successfully changed
Examples
example/main.cpp.