Driver SDK  1.6
Functions
Synchronization Management

Functions

BBT_SDK_API int bbt_driver_synchronize (const bbt_driver_t *driver, unsigned long *rtt, long *offset)
 Computes the rtt and clock offset between the computer and the device. More...
 

Detailed Description

The offset computed is valid until a new synchronization process or the device is restarted Functions to synchronize the device with the computer

Since
Device synchronization is available for driver and firmware versions equal or newer than 1.0 (check the version with bbt_driver_get_fw_version())

Function Documentation

◆ bbt_driver_synchronize()

BBT_SDK_API int bbt_driver_synchronize ( const bbt_driver_t driver,
unsigned long *  rtt,
long *  offset 
)

Computes the rtt and clock offset between the computer and the device.

Parameters
[in]driverThe driver object
[out]rttRound trip time between the computer and the device
[out]offsetThe difference (in microseconds) between the two clocks
Precondition
The object driver must be not NULL
The device firmware major version must be >= 1
Returns
True on success computation of the offset and rtt
std::cout << "Start synchronization\n";
long offset;
unsigned long rtt;
if (bbt_driver_synchronize(driver, &rtt, &offset)) {
std::cout << "RTT computed: " << rtt << "\n";
std::cout << "Offset computed: " << offset << "\n";
} else {
std::cout << "Unable to synchronize\n";
}
BBT_SDK_API int bbt_driver_synchronize(const bbt_driver_t *driver, unsigned long *rtt, long *offset)
Computes the rtt and clock offset between the computer and the device.
Examples
example/main.cpp.