Driver SDK
1.6
|
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... | |
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 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.
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.
[in] | signal | The signal object |
[out] | output_buffer | The buffer to write the string to. |
[in] | max_len | The size of the output buffer |
signal
must be not NULLBBT_SDK_API unsigned int bbt_signal_get_channels | ( | const bbt_signal_t * | signal | ) |
Gets the number of channels that compose the signal.
[in] | signal | The signal object |
signal
must be not NULLBBT_SDK_API unsigned int bbt_signal_get_samples | ( | const bbt_signal_t * | signal | ) |
Gets the number of measurements gathered in every message.
[in] | signal | The signal object |
signal
must be not NULLBBT_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.
[in] | signal | The signal object |
signal
must be not NULLBBT_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
[in] | signal | The signal object |
[in] | mode | The mode to set to the signal |
signal
must be not NULL