BrainBit for developers Subscribe for updates Visit website

Device

 

#include “cdevice.h”

 

Device class. Encapsulates low-level work with a physical device. Implements mechanisms for connecting and disconnecting, launching commands, setting and reading parameters, generating events. And also provides all available information about the device.

Description

create_Device

Function. Instantiating a device class.

Create an instance of a device class based on a device description.

Options:

enumerator

Description: device lookup class instance

Data type: DeviceEnumerator*

info

Description: Device Information

Data type: DeviceInfo

Return value:

Description: device class instance

Data type: Device*

device_connect

Function. Connect to device.

Initiate an attempt to connect to the device. Blocking method.

Options:

device

Description: Device class instance

Data type: Device*

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_disconnect

Function. Disconnecting a device.

Blocking method.

Options:

device

Description: Device class instance

Data type: Device*

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_delete

Function. Deleting an Instance of a Device Class.

Options:

device

Description: Device class instance

Data type: Device*

device_available_channels

Function. Supported hardware channels.

Request a list of supported hardware channels.

Available if device is connected.

Options:

device

Description: Device class instance

Data type: Device*

channelInfoArray

Description: pointer to the address of which the list of supported hardware channels of the device will be written

Data type: ChannelInfoArray *

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_available_commands

Function. Supported Command List.

Query for a list of supported commands.

Available if device is connected.

Options:

device

Description: Device class instance

Data type: Device*

commandArray

Description: pointer to the address of which the list of supported device commands will be written

Data type: CommandArray *

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_available_parameters

Function. Supported parameter list.

Query for a list of supported parameters.

Options:

device

Description: Device class instance

Data type: Device*

paramInfoArray

Description: pointer to the address of which the list of supported device parameters will be written

Data type: ParamInfoArray *

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_execute

Function. Command execution.

Execute the command with the device. Available if device is connected.

Options:

device

Description: Device class instance

Data type: Device*

command

Description: Executable command

Data type: Command

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_subscribe_param_changed

Function. Adding a listener for changing device parameters.

Subscribe to a parameter state change event.

Options:

device

Description: Device class instance

Data type: Device*

(Device*, Parameter, void *)

Description: pointer to the device parameter event handling method

Data type: void(*callback)

handle

Description: listener for device parameters change events. More details ParamChangedListenerHandle.

Data type: ParamChangedListenerHandle*

user_data

Description: any data structures will be passed to the event listener 

Data type: void *

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_subscribe_double_channel_data_received

Function. Adding a listener to a floating point data channel.

Subscribe to a floating point data feed. (only for ChannelTypeRespiration)​

Options:

device

Description: Device class instance

Data type: Device*

channelInfo

Description: Channel information

Data type: ChannelInfo

(Device*, ChannelInfo, DoubleDataArray, void *)

Description: floating point channel data processing method

Data type: void(*callback)

handle

Description: a listener for updating data in a floating point channel. More details DoubleDataListenerHandle.

Data type: DoubleDataListenerHandle*

user_data

Description: any data structures will be passed to the event listener 

Data type: void *

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

device_subscribe_int_channel_data_received

Function. Adding a listener to a data channel with integer values.

Subscribe to a data feed with integer values. (only for ​ChannelType.Battery)​

Options:

device

Description: Device class instance

Data type: Device*

channelInfo

Description: Channel information

Data type: ChannelInfo

(Device*, ChannelInfo, IntDataArray, void *)

Description: method of processing channel data with integer values.

Data type: void(*callback)

handle

Description: a listener for updating data in a channel with integer values. More details

IntDataListenerHandle.

Data type: IntDataListenerHandle*

user_data

Description: any data structures will be passed to the data processing method 

Data type: void *

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

free_ParamInfoArray

Function. Deleting a device parameter list.

Removes the list of device parameters.

Options:

paramInfoArray

Description: parameter list

Data type: ParamInfoArray

free_CommandArray

Function. Delete command list

Removes the list of device commands

Options:

сommandArray

Description: command list

Data type: CommandArray

free_ChannelInfoArray

Function. Delete channel list

Removes the list of channel information.

Options:

channelInfoArray

Description: channel list

Data type: ChannelInfoArray

free_DoubleDataArray

Function. Deleting a floating point list

Removes a floating point data list

Options:

doubleDataArray

Description: signal sample list

Data type: DoubleDataArray

free_IntDataArray

Function: Delete List of Integer Data

Removes a list of integer data

Options:

intDataArray

Description: signal sample list

Data type: IntDataArray