|
Bitbrain SDK 2.10.6
Bitbrain SDK
|
Functions to query and change the device configuration. More...
Data Structures | |
| struct | bbt_device_signal_t |
| The bbt_device_signal_t class. More... | |
Enumerations | |
| enum | bbt_powerline_frequency_t { POWERLINE_DISABLED = 0 , POWERLINE_50 = 50 , POWERLINE_60 = 60 } |
| Powerline frequency options. More... | |
| enum | bbt_device_signal_type_t { Accelerometer = 0 , Analog_Aux , BVP , Digital_Aux , Digital_Input , Digital_Output , EEG , EXG , GSR , IMU , Photodiode , PPG , Digital_Input_Output } |
| Types of signal a Bitbrain device can acquire. More... | |
| enum | bbt_device_type_t { AIR = 0 , DIADEM , HERO , VERSATILE_8 , VERSATILE_16 , VERSATILE_32 , VERSATILE_64 , VERSATILE_BIO , RING , IKON , IKON_SLEEP , VERSATILE_PLUS_16 , VERSATILE_PLUS_32 } |
| Supported Bitbrain devices. More... | |
| enum | bbt_device_versatile_plus_dio_mode { DISABLED = 0 , DIGITAL_INPUT , DIGITAL_OUTPUT } |
| Signal modes of the Versatile Plus Digital I/O (DIO) port. More... | |
Functions | |
| BBT_SDK_API int | bbt_device_get_hardware_version (const bbt_device_t *device, unsigned short *major, unsigned short *minor) |
| Gets the major and minor versions of the device hardware. | |
| BBT_SDK_API int | bbt_device_get_firmware_version (const bbt_device_t *device, unsigned short *major, unsigned short *minor) |
| Gets the major and minor versions of the device firmware. | |
| BBT_SDK_API unsigned short | bbt_device_get_frequency (const bbt_device_t *device) |
| Returns the frequency that the device communicates new data when acquiring. | |
| BBT_SDK_API int | bbt_device_set_frequency (bbt_device_t *device, enum bbt_powerline_frequency_t powerline_info) |
| Sets the powerline frequency for the device. | |
| BBT_SDK_API const int | bbt_device_get_powerline_frequency (const bbt_device_t *device) |
| Gets the powerline frequency for the device. | |
| BBT_SDK_API const char * | bbt_device_get_conn_type (const bbt_device_t *device) |
| Gets the connection type (usb or bluetooth) | |
| BBT_SDK_API const int | bbt_device_get_versatile_plus_sampling_rate (const bbt_device_t *device) |
| Gets the sampling rate for the versatile plus signals. | |
| BBT_SDK_API enum bbt_device_type_t | bbt_device_get_type (const bbt_device_t *device) |
| Gets the type of the device that has been configured. | |
| BBT_SDK_API int | bbt_device_get_signals (const bbt_device_t *device, unsigned short *n, const struct bbt_device_signal_t **device_signals) |
| Get the list of signals available in the device. | |
| BBT_SDK_API int | bbt_device_get_signal_mode (const bbt_device_t *device, unsigned short n) |
| Gets the configuration mode of a signal in the device. | |
| BBT_SDK_API int | bbt_device_enable_signal (bbt_device_t *device, unsigned short n) |
| Enables the acquisition of this signal. | |
| BBT_SDK_API int | bbt_device_disable_signal (bbt_device_t *device, unsigned short n) |
| Disables the acquisition of this signal. | |
| BBT_SDK_API int | bbt_device_set_signal_mode (bbt_device_t *device, unsigned short n, int mode) |
| Sets the mode to a specific value. | |
| BBT_SDK_API int | bbt_device_has_sd_card_capabilities (const bbt_device_t *device) |
| Check if the device has SD Card capabilities to record the data. | |
| BBT_SDK_API int | bbt_device_is_sd_card_enabled (const bbt_device_t *device) |
| Check if the SD Card recording is enabled in the device. | |
| BBT_SDK_API int | bbt_device_enable_sd_card (bbt_device_t *device, const char *recording_folder_path, const char *recording_name) |
| Enable the SD Card recording in the device. | |
| BBT_SDK_API int | bbt_device_disable_sd_card (bbt_device_t *device) |
| Disable the SD Card recording in the device. | |
Functions to query and change the device configuration.
The initial state of a device after a reset is the configuration mode with all the signals disabled and the SD Card recording disabled too. You can query and modify the configuration of the device by calling the functions in this group. During configuration, no data streaming is available. Only a request/reply communication happens between the SDK and the device.
Powerline frequency options.
This enum identifies the state of the powerline frequency (values in Hz). Pass one of these values to bbt_device_set_frequency.
Types of signal a Bitbrain device can acquire.
Use bbt_device_get_signals to find which of these a given device provides.
@important Photodiode is mutually exclusive with the Digital_Input_Output. Only one of them can be acquired at a time. Disable the one you don't need before enabling the other. The same relationship is expected between Photodiode and Digital_Input for the VERSATILE_8 VERSATILE_16 DIADEM and AIR devices.
| Enumerator | |
|---|---|
| Accelerometer | Three-axis accelerometer. |
| Analog_Aux | Auxiliary analog input. |
| BVP | Blood volume pulse. |
| Digital_Aux | Auxiliary digital channel. |
| Digital_Input | Digital input port (trigger reception). |
| Digital_Output | Digital output port (trigger generation). |
| EEG | Electroencephalography. |
| EXG | Generic biopotential channel (ECG/EOG/EMG). |
| GSR | Galvanic skin response. |
| IMU | Inertial measurement unit. |
| Photodiode | Photodiode / light sensor. |
| PPG | Photoplethysmography. |
| Digital_Input_Output | Bidirectional Digital I/O port of the Versatile Plus devices. Unlike every other signal, this one is directional: enabling it is not enough, you must also choose whether the port reads or writes. Select the direction by passing a bbt_device_versatile_plus_dio_mode value to bbt_device_set_signal_mode instead of calling bbt_device_enable_signal. See Digital I/O (DIO) port. |
| enum bbt_device_type_t |
Supported Bitbrain devices.
This enum identifies the types of devices that could be used with this SDK
Signal modes of the Versatile Plus Digital I/O (DIO) port.
The DIO port of the Versatile Plus devices can either read triggers from external equipment or write TTL pulses for other equipment to read. Because a single signal covers both directions, the DIO signal cannot be turned on with bbt_device_enable_signal alone: you must state the direction by passing one of these values as the mode argument of bbt_device_set_signal_mode.
Locate the signal by scanning bbt_device_get_signals for the entry whose type is Digital_Input_Output, then set its mode:
| Enumerator | |
|---|---|
| DISABLED | Port inactive. The DIO signal is not acquired. Equivalent to bbt_device_disable_signal. |
| DIGITAL_INPUT | Input: the port receives trigger signals from compatible accessories and external equipment (a button box, a pedal, a TTL cable, etc.). Equivalent to bbt_device_enable_signal |
| DIGITAL_OUTPUT | Output: the port generates TTL pulses that the digital input of another device can receive over a TTL cable, synchronizing with other Bitbrain devices or external acquisition systems at sample level. The port sends a pulse every 30 s, each one randomly either short (125 ms) or long (250 ms). |
| BBT_SDK_API int bbt_device_get_hardware_version | ( | const bbt_device_t * | device, |
| unsigned short * | major, | ||
| unsigned short * | minor | ||
| ) |
Gets the major and minor versions of the device hardware.
| device | The handle to the device |
| major | The number of major version |
| minor | The number of minor version |
| BBT_SDK_API int bbt_device_get_firmware_version | ( | const bbt_device_t * | device, |
| unsigned short * | major, | ||
| unsigned short * | minor | ||
| ) |
Gets the major and minor versions of the device firmware.
| device | The handle to the device |
| major | The number of major version |
| minor | The number of minor version |
| BBT_SDK_API unsigned short bbt_device_get_frequency | ( | const bbt_device_t * | device | ) |
Returns the frequency that the device communicates new data when acquiring.
On acquisition, you should call bbt_device_read at this frequency to avoid data loss
| device | The handle to the device |
| BBT_SDK_API int bbt_device_set_frequency | ( | bbt_device_t * | device, |
| enum bbt_powerline_frequency_t | powerline_info | ||
| ) |
Sets the powerline frequency for the device.
| device | The handle to the device |
| powerline_info | The powerline frequency to apply, see bbt_powerline_frequency_t |
| BBT_SDK_API const int bbt_device_get_powerline_frequency | ( | const bbt_device_t * | device | ) |
Gets the powerline frequency for the device.
| device | The handle to the device |
| BBT_SDK_API const char * bbt_device_get_conn_type | ( | const bbt_device_t * | device | ) |
Gets the connection type (usb or bluetooth)
| BBT_SDK_API const int bbt_device_get_versatile_plus_sampling_rate | ( | const bbt_device_t * | device | ) |
Gets the sampling rate for the versatile plus signals.
| BBT_SDK_API enum bbt_device_type_t bbt_device_get_type | ( | const bbt_device_t * | device | ) |
Gets the type of the device that has been configured.
| device | The handle to the device |
| BBT_SDK_API int bbt_device_get_signals | ( | const bbt_device_t * | device, |
| unsigned short * | n, | ||
| const struct bbt_device_signal_t ** | device_signals | ||
| ) |
Get the list of signals available in the device.
The order of the list is crucial to be able to index the data received during acquisition with bbt_device_read.
| device | The handle to the device |
| n | Output parameter to receive the number of signals 0 <= n <= 10. |
| device_signals | Output parameter to receive the array of pointers to bbt_device_signal_t. The index in this array will be used to identify the signal in the device in other functions. |
| BBT_SDK_API int bbt_device_get_signal_mode | ( | const bbt_device_t * | device, |
| unsigned short | n | ||
| ) |
Gets the configuration mode of a signal in the device.
| device | The handle of the device |
| n | The index of the signal as returned in the bbt_device_get_signals function. |
| BBT_SDK_API int bbt_device_enable_signal | ( | bbt_device_t * | device, |
| unsigned short | n | ||
| ) |
Enables the acquisition of this signal.
The signal is enabled with its default mode.
| device | The handle to the device |
| n | The index of the signal to enable, as returned in the array from function bbt_device_get_signals |
| BBT_SDK_API int bbt_device_disable_signal | ( | bbt_device_t * | device, |
| unsigned short | n | ||
| ) |
Disables the acquisition of this signal.
| device | The handle to the device |
| n | The index of the signal to disable, as returned in the array from function bbt_device_get_signals |
| BBT_SDK_API int bbt_device_set_signal_mode | ( | bbt_device_t * | device, |
| unsigned short | n, | ||
| int | mode | ||
| ) |
Sets the mode to a specific value.
[!NOTE] For most signals this function is not needed, as they can be enabled and
disabled with bbt_device_enable_signal and bbt_device_disable_signal. Only specific signals require it.
The Versatile Plus Digital I/O signal (Digital_Input_Output) is one such signal: this function is the only way to select whether the port reads triggers or emits the signal. Pass a bbt_device_versatile_plus_dio_mode value as mode:
See Digital I/O (DIO) port for the full description of the port.
| device | The handle to the device |
| n | The index of the signal to set the mode, as returned in the array from function bbt_device_get_signals |
| mode | The mode to set. Acceptable values are from 0 to 255. A value of 0 disables the signal. For the DIO signal, use bbt_device_versatile_plus_dio_mode rather than a raw number. |
| BBT_SDK_API int bbt_device_has_sd_card_capabilities | ( | const bbt_device_t * | device | ) |
Check if the device has SD Card capabilities to record the data.
| device | The handle to the device |
| BBT_SDK_API int bbt_device_is_sd_card_enabled | ( | const bbt_device_t * | device | ) |
Check if the SD Card recording is enabled in the device.
| device | The handle to the device |
| BBT_SDK_API int bbt_device_enable_sd_card | ( | bbt_device_t * | device, |
| const char * | recording_folder_path, | ||
| const char * | recording_name | ||
| ) |
Enable the SD Card recording in the device.
Data is recorded in the device while acquired and can be recorded after the acquisition has stopped with the import functions.
| device | The handle to the device |
| recording_folder_path | The full path of a folder in the SD Card where the recording will take place |
| recording_name | A name to identify the recording. It will be used for the file names created in the SD Card and to identify them upon import. |
| BBT_SDK_API int bbt_device_disable_sd_card | ( | bbt_device_t * | device | ) |
Disable the SD Card recording in the device.
| device | The handle to the device |