Driver SDK  1.6
Functions
Device Configuration

Functions

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

Detailed Description

Functions to get and set the configuration of the device. Here you can see a snippet of the configuration of a device.

std::cout << "Initial signals:\n";
print_device_configuration(driver);
std::cout << "Enable all signals:\n";
enable_all_signals(driver);
std::cout << "Configure sd card:\n";
configure_sd_card(driver);

Function Documentation

◆ bbt_driver_get_number_of_signals()

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.

Parameters
[in]driverThe driver object
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
The number of signals available
Examples
example/main.cpp.

◆ bbt_driver_get_signal()

BBT_SDK_API bbt_signal_t* bbt_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.

Parameters
[in]driverThe driver object
[in]indexThe index of the signal
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
Examples
example/main.cpp.

◆ bbt_driver_has_sd_card_capability()

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.

Parameters
[in]driverThe driver object
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
True if the device can record the data in a SD card
Examples
example/main.cpp.

◆ bbt_driver_is_sd_card_enabled()

BBT_SDK_API int bbt_driver_is_sd_card_enabled ( const bbt_driver_t driver)

Checks if the SD card record is enabled.

Parameters
[in]driverThe driver object
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
True if the SD card record is enabled
Examples
example/main.cpp.

◆ bbt_driver_enable_sd_card()

BBT_SDK_API int bbt_driver_enable_sd_card ( bbt_driver_t driver,
int  enable 
)

Enables or disables the SD card recording.

Configures the device to, in addition to sending the data to the computer, record the data in the sd card. To enable the recording, the card must be inserted in the device. Otherwise this function will return false. This fact can be used to check if the sd card is inserted in the device.

Parameters
[in]driverThe driver object
[in]enableTrue to enable, false to disable
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
If enable is true, the SD card must be inserted for success. Otherwise, it will return false.
Returns
True on success
Examples
example/main.cpp.

◆ bbt_driver_get_folder()

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.

Parameters
[in]driverThe driver object
[out]output_bufferThe buffer to write the name to
[in]max_lenThe maximum size of the buffer buf
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
True if the folder name was correctly gathered
Examples
example/main.cpp.

◆ bbt_driver_set_folder()

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.

Parameters
[in]driverThe driver object
[in]folderThe name of the folder
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
True on success
Examples
example/main.cpp.

◆ bbt_driver_get_file()

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.

Parameters
driverThe driver object
[out]output_bufferThe buffer to write the name to
[in]max_lenThe maximum size of the buffer buf
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
True if the file name was correctly gathered
Examples
example/main.cpp.

◆ bbt_driver_set_file()

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.

Parameters
[in]driverThe driver object
[in]fileThe name of the folder
Precondition
The object driver must be not NULL
The driver must be connected (bbt_driver_is_connected() == true)
Returns
True on success
Examples
example/main.cpp.