Bitbrain SDK 2.10.6
Bitbrain SDK
Loading...
Searching...
No Matches
Create and destroy Bitbrain device handlers

Constructors and destructors of device handlers. More...

Typedefs

typedef struct bbt_device_s bbt_device_t
 bbt_device_t is an opaque type that identifies a connection to a device
 

Functions

BBT_SDK_API bbt_device_t * bbt_device_new_air (const char *device_name)
 Creates an instance of a handler to an air type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_diadem (const char *device_name)
 Creates an instance of a handler to a diadem type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_hero (const char *device_name)
 Creates an instance of a handler to a hero type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_8 (const char *device_name)
 Creates an instance of a handler to an 8-channels versatile type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_16 (const char *device_name)
 Creates an instance of a handler to a 16-channels versatile type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_32 (const char *device_name)
 Creates an instance of a handler to a 32-channels versatile type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_64 (const char *left_device_name, const char *right_device_name)
 Creates an instance of a handler to a 64-channels versatile type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_bio (const char *device_name)
 Creates an instance of a handler to a biosignal versatile type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_ring (const char *device_name)
 Creates an instance of a handler to a ring type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_ikon (const char *device_name)
 Creates an instance of a handler to an ikon type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_ikon_sleep (const char *device_name)
 Creates an instance of a handler to a ikon-sleep type device.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_plus_16 (const char *device_name, const char *connection_type, unsigned short sampling_rate)
 Creates an instance of a handler to a versatile plus type device with 16 channels.
 
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_plus_32 (const char *device_name, const char *connection_type, unsigned short sampling_rate)
 Creates an instance of a handler to a versatile plus type device with 32 channels.
 
BBT_SDK_API void bbt_device_free (bbt_device_t *device)
 Destroys the handler to a device.
 

Detailed Description

Constructors and destructors of device handlers.

The main interaction to a specific device is performed using a handler to it as the first parameter for most of the functions in the SDK. The handler is provided by the bbt_device_new_ family of functions. These functions initialize the data to interact to a given device and return a handler to use in future SDK calls to act on the specific device. The handler must be kept as long as it lasts the interaction to the specific device. There is no need to generate a new handler upon disconnections or reconnections. In other words, the handler to a device outlives the connection to it.

‍[!IMPORTANT] The call to bbt_device_free is mandatory to properly finish the device handler. Otherwise, memory

leaks might be caused.

Typedef Documentation

◆ bbt_device_t

typedef struct bbt_device_s bbt_device_t

bbt_device_t is an opaque type that identifies a connection to a device

It is used along the SDK to identify the device to interact with.

Function Documentation

◆ bbt_device_new_air()

BBT_SDK_API bbt_device_t * bbt_device_new_air ( const char *  device_name)

Creates an instance of a handler to an air type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_diadem()

BBT_SDK_API bbt_device_t * bbt_device_new_diadem ( const char *  device_name)

Creates an instance of a handler to a diadem type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_hero()

BBT_SDK_API bbt_device_t * bbt_device_new_hero ( const char *  device_name)

Creates an instance of a handler to a hero type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_8()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_8 ( const char *  device_name)

Creates an instance of a handler to an 8-channels versatile type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_16()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_16 ( const char *  device_name)

Creates an instance of a handler to a 16-channels versatile type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_32()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_32 ( const char *  device_name)

Creates an instance of a handler to a 32-channels versatile type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_64()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_64 ( const char *  left_device_name,
const char *  right_device_name 
)

Creates an instance of a handler to a 64-channels versatile type device.

Parameters
left_device_nameThe name of the device on the left of the setup
right_device_nameThe name of the device on the right of the setup
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_bio()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_bio ( const char *  device_name)

Creates an instance of a handler to a biosignal versatile type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_ring()

BBT_SDK_API bbt_device_t * bbt_device_new_ring ( const char *  device_name)

Creates an instance of a handler to a ring type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_ikon()

BBT_SDK_API bbt_device_t * bbt_device_new_ikon ( const char *  device_name)

Creates an instance of a handler to an ikon type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_ikon_sleep()

BBT_SDK_API bbt_device_t * bbt_device_new_ikon_sleep ( const char *  device_name)

Creates an instance of a handler to a ikon-sleep type device.

Parameters
device_nameThe name of the device to interact with as written in the label
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_plus_16()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_plus_16 ( const char *  device_name,
const char *  connection_type,
unsigned short  sampling_rate 
)

Creates an instance of a handler to a versatile plus type device with 16 channels.

Parameters
device_nameThe name of the device to interact with as written in the label
connection_typeThe type of the connection with the device ("Bluetooth", "USB")
sampling_rateSampling rate of the devices (see Versatile Plus: Device-specific settings).
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_new_versatile_plus_32()

BBT_SDK_API bbt_device_t * bbt_device_new_versatile_plus_32 ( const char *  device_name,
const char *  connection_type,
unsigned short  sampling_rate 
)

Creates an instance of a handler to a versatile plus type device with 32 channels.

Parameters
device_nameThe name of the device to interact with as written in the label
connection_typeThe type of the connection with the device ("Bluetooth", "USB")
sampling_rateSampling rate of the devices (see Versatile Plus: Device-specific settings).
Returns
On success, a pointer to the opaque structure. On failure, NULL is returned

◆ bbt_device_free()

BBT_SDK_API void bbt_device_free ( bbt_device_t *  device)

Destroys the handler to a device.

Parameters
deviceThe handler to the device