BrainBit foe developers Subscribe for updates Visit website
Home
SDK
Windows
iOS
Android
DotNet
Web
Device

DeviceEnumerator

 

#include “cscanner.h

 

Device search and creation class. Designed to search for available devices. It is also designed to create an instance of a device class based on information about the device.

Important information:

To search and create devices, the hardware must support BLE, as well as the application must have permission to use BLE and GPS, while BLE and GPS modules must be enabled separately, since the SDK does not provide this functionality.

The search for devices starts immediately after the class is instantiated.

Description

create_device_enumerator

Function. Creating an instance of the device search class.

Creates an instance of the class for searching and creating devices

Options.

deviceType

Description: Device type, must be specified DeviceTypeBrainbit

Data type: Devicetype

Return value.

Description: class instance DeviceEnumerator

Data type: DeviceEnumerator*

enumerator_delete

Function. Deleting an Instance of a Device Finder Class.

Stop searching and release the resources of an instance of this class. The method must be called after the work has been completed with it and, if necessary, instances of the device class are created.

Options.

deviceEnumerator

Description: class instance DeviceEnumerator

Data type: DeviceEnumerator*

enumerator_set_device_list_changed_callback

Function. Add a listener for the device list update event.

Install a listener for updating the list of found devices.

Options:

deviceEnumerator

Description: class instance DeviceEnumerator

Data type: DeviceEnumerator*

(DeviceEnumerator *, void *)

Description: method for handling the event of updating the list of found devices.

Data type: void(*callback)

handle

Description: listener for updating the list of found devices. More details DeviceListListener.

Data type: DeviceListListener*

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.

enumerator_unsubscribe_device_list_changed

Function. Unsign the device list update event.

Unsigns the event for updating the list of found devices.

Options:

handle

Description: listener for updating the list of found devices.

Data type: DeviceListListener*

enumerator_get_device_list

Function. List of descriptions of found devices.

Lets you get a list of found devices.

Options:

scanner_ptr

Description: class instance DeviceEnumerator

Data type: DeviceEnumerator*

out_device_array

Description: list of found devices

Data type: DeviceInfoArray

Return value:

Description: An indication of an error. More details sdk_error

Data type: int.

free_DeviceInfoArray

Function. Deleting the list of found devices.

Cleans up the resources needed to store the list of found devices.

Options.

info_array

Description: List of found devices

Data type: DeviceInfoArray