Bitbrain SDK 2.8.6
Bitbrain SDK
Loading...
Searching...
No Matches
Configure the device

Functions to query and change the device cnfiguration. More...

Data Structures

struct  bbt_device_signal_t
 The bbt_device_signal_t class. More...

Enumerations

enum  bbt_device_signal_type_t {
  Accelerometer = 0 , Analog_Aux , BVP , Digital_Aux ,
  Digital_Input , Digital_Output , EEG , EXG ,
  GSR , IMU , Photodiode , PPG
}
 The bbt_device_signal_type_t enum. 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_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 *full_recording_path)
 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.

Detailed Description

Functions to query and change the device cnfiguration.

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.

Enumeration Type Documentation

◆ bbt_device_signal_type_t

The bbt_device_signal_type_t enum.

This enum identifies the types of signals that the devices from Bitbrain can acquire

Function Documentation

◆ bbt_device_get_hardware_version()

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.

Parameters
deviceThe handle to the device
majorThe number of major version
minorThe number of minor version
Returns
True on success, false otherwise.

◆ bbt_device_get_firmware_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.

Parameters
deviceThe handle to the device
majorThe number of major version
minorThe number of minor version
Returns
True on success, false otherwise.

◆ bbt_device_get_frequency()

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

Parameters
deviceThe handle to the device
Returns
The frequency value in Hz. 0 If something went wrong.

◆ bbt_device_get_signals()

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.

Parameters
deviceThe handle to the device
nOutput parameter to receive the number of signals 0 <= n <= 10.
device_signalsOutput 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.
Returns
True on success. False otherwise

◆ bbt_device_get_signal_mode()

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.

Parameters
deviceThe handle of the device
nThe index of the signal as returned in the bbt_device_get_signals function.
Returns
The mode of the signal. 0 if it is disabled (not aquired). Values different from 0 indicate that the signal is being acquired.

◆ bbt_device_enable_signal()

BBT_SDK_API int bbt_device_enable_signal ( bbt_device_t * device,
unsigned short n )

Enables the acquisition of this signal.

Parameters
deviceThe handle to the device
nThe index of the signal to enable, as returned in the array from function bbt_device_get_signals
Returns
True on success, false otherwise

◆ bbt_device_disable_signal()

BBT_SDK_API int bbt_device_disable_signal ( bbt_device_t * device,
unsigned short n )

Disables the acquisition of this signal.

Parameters
deviceThehandle to the device
nThe index of the signal to disable, as returned in the array from function bbt_device_get_signals
Returns
True on success, false otherwise

◆ bbt_device_set_signal_mode()

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
This function is not needed in general, as the signals can be enabled/disabled using the corresponding functions. Only very specific uses of specific signals may require this function.
Parameters
deviceThe handle to the device
nThe index of the signal to set the mode, as returned in the array from function bbt_device_get_signals
modeThe mode to set. Acceptable values are from 0 to 255. A value of 0 disables the signal.
Returns
True on success, false otherwise

◆ bbt_device_has_sd_card_capabilities()

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.

Parameters
deviceThe handle to the device
Returns
True if the device can record data in the SD Card. False otherwise.

◆ bbt_device_is_sd_card_enabled()

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.

Parameters
deviceThe handle to the device
Returns
True if the recording to the SD card is enabled. False otherwise

◆ bbt_device_enable_sd_card()

BBT_SDK_API int bbt_device_enable_sd_card ( bbt_device_t * device,
const char * full_recording_path )

Enable the SD Card recording in the device.

Parameters
deviceThe handle to the device
full_recording_pathThe path in the SD Card where the recording will take place
Returns
True on success. False otherwise

◆ bbt_device_disable_sd_card()

BBT_SDK_API int bbt_device_disable_sd_card ( bbt_device_t * device)

Disable the SD Card recording in the device.

Parameters
deviceThe handle to the device
Returns
True on success. False otherwise