Driver SDK  1.6
Macros | Typedefs | Functions | Variables
bbt_driver.h File Reference

Header for the Bitbrain driver SDK. More...

Go to the source code of this file.

Macros

#define BBT_SDK_API
 
#define BBT_SDK_DEPRECATED   __declspec(deprecated)
 
#define BBT_SDK_DEPRECATED_EXPORT   BBT_SDK_API BBT_SDK_DEPRECATED
 
#define BBT_SDK_DEPRECATED_NO_EXPORT   BBT_SDK_NO_EXPORT BBT_SDK_DEPRECATED
 

Typedefs

typedef struct bbt_signal_s bbt_signal_t
 Opaque type to handle signals from Bitbrain devices. More...
 
typedef typedefBBT_SDK_API struct bbt_driver_s bbt_driver_t
 Opaque data type that represents the driver for a BBT device.
 

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...
 
BBT_SDK_API bbt_driver_tbbt_driver_new_bluetooth (const char *device_name, int eeg_sensor_type)
 Creates a driver for a bluetooth device. It must be released using bbt_driver_free() More...
 
BBT_SDK_API bbt_driver_tbbt_driver_new_usb (int port, int eeg_sensor_type)
 Creates a driver for a usb device. It must be released using bbt_driver_free() More...
 
BBT_SDK_API bbt_driver_tbbt_driver_new_eeg64 (const char *left_device_name, const char *right_device_name)
 Creates a driver for a eeg64 device with wet sensors. It must be released using bbt_driver_free() More...
 
BBT_SDK_API void bbt_driver_free (bbt_driver_t *driver)
 Releases the memory of the driver created by bbt_driver_new_*() More...
 
BBT_SDK_API void bbt_driver_connect (bbt_driver_t *driver)
 Connects with the device associated to the driver. More...
 
BBT_SDK_API void bbt_driver_disconnect (bbt_driver_t *driver)
 Disconnects from the device associated. More...
 
BBT_SDK_API void bbt_driver_reconnect (bbt_driver_t *driver)
 Reconnects to the device associated. More...
 
BBT_SDK_API int bbt_driver_is_connected (const bbt_driver_t *driver)
 Checks if the driver is connected to the device. More...
 
BBT_SDK_API int bbt_driver_get_hw_version (const bbt_driver_t *driver, unsigned short *major, unsigned short *minor)
 Gets the hardware version of the device. More...
 
BBT_SDK_API int bbt_driver_get_fw_version (const bbt_driver_t *driver, unsigned short *major, unsigned short *minor)
 Gets the major and minor firmware version of the device. More...
 
BBT_SDK_API unsigned short bbt_driver_get_frequency (const bbt_driver_t *driver)
 Gets the number of data messages sent by the device each second. More...
 
BBT_SDK_API unsigned short bbt_driver_get_number_of_signals (const bbt_driver_t *driver)
 Gets the number of signals available in the device. More...
 
BBT_SDK_API bbt_signal_tbbt_driver_get_signal (const bbt_driver_t *driver, unsigned short index)
 Gets a handler to the signal with the corresponding index that can be later used with functions in Signal Object. More...
 
BBT_SDK_API int bbt_driver_has_sd_card_capability (const bbt_driver_t *driver)
 Checks if the device can record the data in a SD card. More...
 
BBT_SDK_API int bbt_driver_is_sd_card_enabled (const bbt_driver_t *driver)
 Checks if the SD card record is enabled. More...
 
BBT_SDK_API int bbt_driver_enable_sd_card (bbt_driver_t *driver, int enable)
 Enables or disables the SD card recording. More...
 
BBT_SDK_API char * bbt_driver_get_folder (const bbt_driver_t *driver, char *output_buffer, unsigned int max_len)
 Gets the name of the folder in the SD card where the data is going to be recorded. More...
 
BBT_SDK_API int bbt_driver_set_folder (bbt_driver_t *driver, const char *folder)
 Sets the name of the folder in the SD card where the data is going to be recorded. More...
 
BBT_SDK_API char * bbt_driver_get_file (const bbt_driver_t *driver, char *output_buffer, unsigned int max_len)
 Gets the name of the file in the SD card where the data is going to be recorded. More...
 
BBT_SDK_API int bbt_driver_set_file (bbt_driver_t *driver, const char *file)
 Sets the name of the file in the SD card where the data is going to be recorded. More...
 
BBT_SDK_API int bbt_driver_synchronize (const bbt_driver_t *driver, unsigned long *rtt, long *offset)
 Computes the rtt and clock offset between the computer and the device. More...
 
BBT_SDK_API int bbt_driver_start (bbt_driver_t *driver)
 Stars a new recording. More...
 
BBT_SDK_API int bbt_driver_stop (bbt_driver_t *driver)
 Stops the current recording. More...
 
BBT_SDK_API int bbt_driver_is_running (const bbt_driver_t *driver)
 Checks if the recording is active. More...
 
BBT_SDK_API unsigned long bbt_driver_read_data_size (const bbt_driver_t *driver)
 Gets the size of the data vector read on each block depending on the configuration of the driver. More...
 
BBT_SDK_API double * bbt_driver_read (bbt_driver_t *driver, unsigned short *sequence, short *battery, unsigned short *flags)
 Reads one data message from the device. More...
 
BBT_SDK_API unsigned short bbt_driver_get_eeg_impedance (const bbt_driver_t *driver, unsigned short index)
 Reads the impedance value for the index channel of the EEG signal (if any) More...
 
BBT_SDK_API int bbt_driver_import_sd_record (const char *input_folder, const char *input_file, const char *output_folder)
 Imports the recordings from the sd card into readable csv files. More...
 
BBT_SDK_API int bbt_driver_import_eeg64_sd_record (const char *left_input_folder, const char *right_input_folder, const char *input_file, const char *output_folder)
 Imports the eeg 64 recordings from the sd card into readable csv files. More...
 

Variables

BBT_SDK_API const int bbt_dry_eeg_sensor
 dry eeg sensor More...
 
BBT_SDK_API const int bbt_water_eeg_sensor
 water based eeg sensor More...
 
BBT_SDK_API const short bbt_driver_battery_unknown
 unknown battery level More...
 
BBT_SDK_API const short bbt_driver_battery_charging
 battery charging More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_ok
 data recording is ok More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_sd_card_removed
 SD card was removed. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_sd_card_access_error
 SD card cannot be accessed. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_sd_card_folder_error
 SD card folder error. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_sd_card_time_error
 SD card creation time error. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_sd_card_file_error
 SD card file error. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_sd_card_full_error
 SD card full error. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_eeg64_not_synchronized
 EEG64 device not synchronized. More...
 
BBT_SDK_API const unsigned short bbt_driver_flags_bad_anchor_configuration
 Bad anchor configuration. More...
 
BBT_SDK_API const unsigned short bbt_driver_impedance_unknown
 bbt_driver_impedance_unknown
 
BBT_SDK_API const unsigned short bbt_driver_impedance_saturated
 bbt_driver_impedance_saturated
 
BBT_SDK_API const unsigned short bbt_driver_impedance_bad
 bbt_driver_impedance_bad
 
BBT_SDK_API const unsigned short bbt_driver_impedance_fair
 bbt_driver_impedance_fair
 
BBT_SDK_API const unsigned short bbt_driver_impedance_good
 bbt_driver_impedance_good
 

Detailed Description

Header for the Bitbrain driver SDK.

Date
01-2022