| OrbbecSDK 1.10.18 OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ob::Device Class Reference

`#include <Device.hpp>`

## Public Member Functions
| Device (std::unique_ptr< DeviceImpl > impl)
| Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
virtual | ~Device () noexcept
std::shared_ptr< DeviceInfo > | getDeviceInfo ()
| Get device information.
std::shared_ptr< SensorList > | getSensorList ()
| Get device sensor list.
std::shared_ptr< Sensor > | getSensor (OBSensorType type)
| Get specific type of sensor if device not open, SDK will automatically open the connected device and return to the instance.
void | setIntProperty (OBPropertyID propertyId, int32_t property)
| Set int type of device property.
void | setFloatProperty (OBPropertyID propertyId, float property)
| Set float type of device property.
void | setBoolProperty (OBPropertyID propertyId, bool property)
| Set bool type of device property.
int32_t | getIntProperty (OBPropertyID propertyId)
| Get int type of device property.
float | getFloatProperty (OBPropertyID propertyId)
| Get float type of device property.
bool | getBoolProperty (OBPropertyID propertyId)
| Get bool type of device property.
OBIntPropertyRange | getIntPropertyRange (OBPropertyID propertyId)
| Get int type device property range (including current value and default value)
OBFloatPropertyRange | getFloatPropertyRange (OBPropertyID propertyId)
| Get float type device property range((including current value and default value)
OBBoolPropertyRange | getBoolPropertyRange (OBPropertyID propertyId)
| Get bool type device property range (including current value and default value)
void | writeAHB (uint32_t reg, uint32_t mask, uint32_t value)
| Write to an AHB register.
void | readAHB (uint32_t reg, uint32_t mask, uint32_t *value)
| Read from an AHB register.
void | writeI2C (uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t value)
| Write to an I2C register.
void | readI2C (uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t *value)
| Read from an I2C register.
void | writeFlash (uint32_t offset, const void *data, uint32_t dataSize, SetDataCallback callback, bool async=false)
| Set the properties for writing to Flash.
void | readFlash (uint32_t offset, uint32_t dataSize, GetDataCallback callback, bool async=false)
| Read a property from Flash.
void | writeCustomerData (const void *data, uint32_t dataSize)
| Set the customer data type of a device property.
void | readCustomerData (void *data, uint32_t *dataSize)
| Get the customer data type of a device property.
void | setRawData (OBPropertyID propertyId, const void *data, uint32_t dataSize, SetDataCallback callback, bool async=false)
| Set the raw data type of a device property (with asynchronous callback)
void | getRawData (OBPropertyID propertyId, GetDataCallback callback, bool async=false)
| Get the raw data type of a device property (with asynchronous callback)
void | setStructuredData (OBPropertyID propertyId, const void *data, uint32_t dataSize)
| Set the structured data type of a device property.
void | getStructuredData (OBPropertyID propertyId, void *data, uint32_t *dataSize)
| Get the structured data type of a device property.
void | setStructuredDataExt (OBPropertyID propertyId, std::shared_ptr< OBDataBundle > dataBundle, SetDataCallback callback)
| Set the structured data type of a device property (with extended data bundle)
std::shared_ptr< OBDataBundle > | getStructuredDataExt (OBPropertyID propertyId)
| Get the structured data type of a device property (with extended data bundle)
OBProtocolVersion | getProtocolVersion ()
| Get the property protocol version.
OBCmdVersion | getCmdVersion (OBPropertyID propertyId)
| Get the cmdVersion of a property.
uint32_t | getSupportedPropertyCount ()
| Get the number of properties supported by the device.
OBPropertyItem | getSupportedProperty (uint32_t index)
| Get the supported properties of the device.
bool | isPropertySupported (OBPropertyID propertyId, OBPermissionType permission)
| Check if a property permission is supported.
bool | isGlobalTimestampSupported ()
| Check if the global timestamp is supported for the device.
void | deviceUpgrade (const char *filePath, DeviceUpgradeCallback callback, bool async=true)
| Upgrade the device firmware.
void | deviceUpgradeFromData (const char *fileData, uint32_t fileSize, DeviceUpgradeCallback callback, bool async=true)
void | sendFile (const char *filePath, const char *dstPath, SendFileCallback callback, bool async=true)
| Send files to the specified path on the device side [Asynchronouscallback].
OBDeviceState | getDeviceState ()
| Get the current state.
void | setDeviceStateChangedCallback (DeviceStateChangedCallback callback)
| Set the device state changed callbacks.
bool | activateAuthorization (const char *authCode)
| Verify device authorization code.
void | writeAuthorizationCode (const char *authCodeStr)
| Write authorization code.
std::shared_ptr< CameraParamList > | getCalibrationCameraParamList ()
| Get the original parameter list of camera calibration saved in the device.
OBDepthWorkMode | getCurrentDepthWorkMode ()
| Get current depth work mode.
OBStatus | switchDepthWorkMode (const OBDepthWorkMode &workMode)
| Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to switch depth mode when known the complete name of depth work mode.
OBStatus | switchDepthWorkMode (const char *modeName)
| Switch depth work mode by work mode name.
std::shared_ptr< OBDepthWorkModeList > | getDepthWorkModeList ()
| Request support depth work mode list.
void | reboot ()
| Device restart.
void | reboot (uint32_t delayMs)
| Device restart delay mode.
DEPRECATED uint64_t | syncDeviceTime ()
| Synchronize the device time (synchronize local system time to device)
DEPRECATED OBDeviceSyncConfig | getSyncConfig ()
| get the current device synchronization configuration
DEPRECATED void | setSyncConfig (const OBDeviceSyncConfig &deviceSyncConfig)
| Set the device synchronization configuration.
uint16_t | getSupportedMultiDeviceSyncModeBitmap ()
| Get the supported multi device sync mode bitmap of the device.
void | setMultiDeviceSyncConfig (const OBMultiDeviceSyncConfig &config)
| set the multi device sync configuration of the device.
OBMultiDeviceSyncConfig | getMultiDeviceSyncConfig ()
| get the multi device sync configuration of the device.
void | triggerCapture ()
| send the capture command to the device.
void | setTimestampResetConfig (const OBDeviceTimestampResetConfig &config)
| set the timestamp reset configuration of the device.
OBDeviceTimestampResetConfig | getTimestampResetConfig ()
| get the timestamp reset configuration of the device.
void | timestampReset ()
| send the timestamp reset command to the device.
void | timerSyncWithHost ()
| synchronize the timer of the device with the host.
void | loadDepthFilterConfig (const char *filePath)
| Load depth filter config from file.
void | resetDefaultDepthFilterConfig ()
| Reset depth filter config to device default define.
const char * | getCurrentPresetName ()
| Get current preset name.
const char * | getCurrentDepthModeName ()
| Get current depth mode name.
void | loadPreset (const char *presetName)
| load the preset according to the preset name.
std::shared_ptr< DevicePresetList > | getAvailablePresetList ()
| Get available preset list.
void | loadPresetFromJsonFile (const char *filePath)
| Load custom preset from file.
void | loadPresetFromJsonData (const char *presetName, const uint8_t *data, uint32_t size)
| Load custom preset from data.
void | exportSettingsAsPresetJsonFile (const char *filePath)
| Export current device settings as a preset json file.
void | exportSettingsAsPresetJsonData (const char *presetName, const uint8_t **data, uint32_t *dataSize)
| Export current device settings as a preset json data.

## Protected Member Functions
| Device (Device &&device)

## Protected Attributes
std::unique_ptr< DeviceImpl > | impl_

## Friends
class | Pipeline
class | Recorder
class | CoordinateTransformHelper

## Detailed Description

Definition at line 29 of file Device.hpp.

## Constructor & Destructor Documentation

## ◆ Device() [1/2]

ob::Device::Device | ( | Device && | device | ) |
| protected

## ◆ Device() [2/2]

ob::Device::Device | ( | std::unique_ptr< DeviceImpl > | impl | ) |

Describe the entity of the RGBD camera, representing a specific model of RGBD camera.

## ◆ ~Device()

virtual ob::Device::~Device | ( |  | ) |
| virtual noexcept

## Member Function Documentation

## ◆ getDeviceInfo()

std::shared_ptr< DeviceInfo > ob::Device::getDeviceInfo | ( |  | ) |

Get device information.

Returns
  std::shared_ptr<DeviceInfo> return device information

## ◆ getSensorList()

std::shared_ptr< SensorList > ob::Device::getSensorList | ( |  | ) |

Get device sensor list.

Returns
  std::shared_ptr<SensorList> return the sensor list

## ◆ getSensor()

std::shared_ptr< Sensor > ob::Device::getSensor | ( | OBSensorType | type | ) |

Get specific type of sensor if device not open, SDK will automatically open the connected device and return to the instance.

Returns
  std::shared_ptr<Sensor> return the sensor example, if the device does not have the device,return nullptr

## ◆ setIntProperty()

void ob::Device::setIntProperty | ( | OBPropertyID | propertyId,
|  | int32_t | property
| ) |  |

Set int type of device property.

Parameters

  propertyId | Property id
  property | Property to be set

## ◆ setFloatProperty()

void ob::Device::setFloatProperty | ( | OBPropertyID | propertyId,
|  | float | property
| ) |  |

Set float type of device property.

Parameters

  propertyId | Property id
  property | Property to be set

## ◆ setBoolProperty()

void ob::Device::setBoolProperty | ( | OBPropertyID | propertyId,
|  | bool | property
| ) |  |

Set bool type of device property.

Parameters

  propertyId | Property id
  property | Property to be set

## ◆ getIntProperty()

int32_t ob::Device::getIntProperty | ( | OBPropertyID | propertyId | ) |

Get int type of device property.

Parameters

  propertyId | Property id

Returns
  int32_t Property to get

## ◆ getFloatProperty()

float ob::Device::getFloatProperty | ( | OBPropertyID | propertyId | ) |

Get float type of device property.

Parameters

  propertyId | Property id

Returns
  float Property to get

## ◆ getBoolProperty()

bool ob::Device::getBoolProperty | ( | OBPropertyID | propertyId | ) |

Get bool type of device property.

Parameters

  propertyId | Property id

Returns
  bool Property to get

## ◆ getIntPropertyRange()

OBIntPropertyRange ob::Device::getIntPropertyRange | ( | OBPropertyID | propertyId | ) |

Get int type device property range (including current value and default value)

Parameters

  propertyId | Property id

Returns
  OBIntPropertyRange Property range

## ◆ getFloatPropertyRange()

OBFloatPropertyRange ob::Device::getFloatPropertyRange | ( | OBPropertyID | propertyId | ) |

Get float type device property range((including current value and default value)

Parameters

  propertyId | Property id

Returns
  OBFloatPropertyRange Property range

## ◆ getBoolPropertyRange()

OBBoolPropertyRange ob::Device::getBoolPropertyRange | ( | OBPropertyID | propertyId | ) |

Get bool type device property range (including current value and default value)

Parameters

  propertyId | The ID of the property

Returns
  OBBoolPropertyRange The range of the property

## ◆ writeAHB()

void ob::Device::writeAHB | ( | uint32_t | reg,
|  | uint32_t | mask,
|  | uint32_t | value
| ) |  |

Write to an AHB register.

Parameters

  reg | The register to write to
  mask | The mask to apply
  value | The value to write

## ◆ readAHB()

void ob::Device::readAHB | ( | uint32_t | reg,
|  | uint32_t | mask,
|  | uint32_t * | value
| ) |  |

Read from an AHB register.

Parameters

  reg | The register to read from
  mask | The mask to apply
  value | The value to return

## ◆ writeI2C()

void ob::Device::writeI2C | ( | uint32_t | moduleId,
|  | uint32_t | reg,
|  | uint32_t | mask,
|  | uint32_t | value
| ) |  |

Write to an I2C register.

Parameters

  moduleId | The ID of the I2C module to write to
  reg | The register to write to
  mask | The mask to apply
  value | The value to write

## ◆ readI2C()

void ob::Device::readI2C | ( | uint32_t | moduleId,
|  | uint32_t | reg,
|  | uint32_t | mask,
|  | uint32_t * | value
| ) |  |

Read from an I2C register.

Parameters

  moduleId | The ID of the I2C module to read from
  reg | The register to read from
  mask | The mask to apply
  value | The value to return

## ◆ writeFlash()

void ob::Device::writeFlash | ( | uint32_t | offset,
|  | const void * | data,
|  | uint32_t | dataSize,
|  | SetDataCallback | callback,
|  | bool | async = `false`
| ) |  |

Set the properties for writing to Flash.

Parameters

  offset | The offset address in Flash
  data | The data to write
  dataSize | The size of the data to write
  callback | The callback for write progress
  async | Whether to execute asynchronously

## ◆ readFlash()

void ob::Device::readFlash | ( | uint32_t | offset,
|  | uint32_t | dataSize,
|  | GetDataCallback | callback,
|  | bool | async = `false`
| ) |  |

Read a property from Flash.

Parameters

  offset | The offset address in Flash
  dataSize | The size of the property to read
  callback | The callback for read progress and data
  async | Whether to execute asynchronously

## ◆ writeCustomerData()

void ob::Device::writeCustomerData | ( | const void * | data,
|  | uint32_t | dataSize
| ) |  |

Set the customer data type of a device property.

Parameters

  data | The data to set
  dataSize | The size of the data to set,the maximum length cannot exceed 65532 bytes.

## ◆ readCustomerData()

void ob::Device::readCustomerData | ( | void * | data,
|  | uint32_t * | dataSize
| ) |  |

Get the customer data type of a device property.

Parameters

  data | The property data obtained
  dataSize | The size of the data obtained

## ◆ setRawData()

void ob::Device::setRawData | ( | OBPropertyID | propertyId,
|  | const void * | data,
|  | uint32_t | dataSize,
|  | SetDataCallback | callback,
|  | bool | async = `false`
| ) |  |

Set the raw data type of a device property (with asynchronous callback)

Parameters

  propertyId | The ID of the property
  data | The data to set
  dataSize | The size of the data to set
  callback | The callback for set progress
  async | Whether to execute asynchronously

## ◆ getRawData()

void ob::Device::getRawData | ( | OBPropertyID | propertyId,
|  | GetDataCallback | callback,
|  | bool | async = `false`
| ) |  |

Get the raw data type of a device property (with asynchronous callback)

Parameters

  propertyId | The ID of the property
  callback | The callback for getting the data and progress
  async | Whether to execute asynchronously

## ◆ setStructuredData()

void ob::Device::setStructuredData | ( | OBPropertyID | propertyId,
|  | const void * | data,
|  | uint32_t | dataSize
| ) |  |

Set the structured data type of a device property.

Parameters

  propertyId | The ID of the property
  data | The data to set
  dataSize | The size of the data to set

## ◆ getStructuredData()

void ob::Device::getStructuredData | ( | OBPropertyID | propertyId,
|  | void * | data,
|  | uint32_t * | dataSize
| ) |  |

Get the structured data type of a device property.

Parameters

  propertyId | The ID of the property
  data | The property data obtained
  dataSize | The size of the data obtained

## ◆ setStructuredDataExt()

void ob::Device::setStructuredDataExt | ( | OBPropertyID | propertyId,
|  | std::shared_ptr< OBDataBundle > | dataBundle,
|  | SetDataCallback | callback
| ) |  |

Set the structured data type of a device property (with extended data bundle)

Parameters

  propertyId | The ID of the property
  dataBundle | The target data bundle
  callback | The callback for setting

## ◆ getStructuredDataExt()

std::shared_ptr< OBDataBundle > ob::Device::getStructuredDataExt | ( | OBPropertyID | propertyId | ) |

Get the structured data type of a device property (with extended data bundle)

Parameters

  propertyId | The ID of the property

Returns
  The data bundle

## ◆ getProtocolVersion()

OBProtocolVersion ob::Device::getProtocolVersion | ( |  | ) |

Get the property protocol version.

Returns
  The protocol version

## ◆ getCmdVersion()

OBCmdVersion ob::Device::getCmdVersion | ( | OBPropertyID | propertyId | ) |

Get the cmdVersion of a property.

Parameters

  propertyId | The ID of the property

Returns
  The cmdVersion

## ◆ getSupportedPropertyCount()

uint32_t ob::Device::getSupportedPropertyCount | ( |  | ) |

Get the number of properties supported by the device.

Returns
  The number of supported properties

## ◆ getSupportedProperty()

OBPropertyItem ob::Device::getSupportedProperty | ( | uint32_t | index | ) |

Get the supported properties of the device.

Parameters

  index | The index of the property

Returns
  The type of supported property

## ◆ isPropertySupported()

bool ob::Device::isPropertySupported | ( | OBPropertyID | propertyId,
|  | OBPermissionType | permission
| ) |  |

Check if a property permission is supported.

Parameters

  propertyId | The ID of the property
  permission | The read and write permissions to check

Returns
  Whether the property permission is supported

## ◆ isGlobalTimestampSupported()

bool ob::Device::isGlobalTimestampSupported | ( |  | ) |

Check if the global timestamp is supported for the device.

Returns
  Whether the global timestamp is supported

## ◆ deviceUpgrade()

void ob::Device::deviceUpgrade | ( | const char * | filePath,
|  | DeviceUpgradeCallback | callback,
|  | bool | async = `true`
| ) |  |

Upgrade the device firmware.

Parameters

  filePath | Firmware path
  callback | Firmware upgrade progress and status callback
  async | Whether to execute asynchronously

## ◆ deviceUpgradeFromData()

void ob::Device::deviceUpgradeFromData | ( | const char * | fileData,
|  | uint32_t | fileSize,
|  | DeviceUpgradeCallback | callback,
|  | bool | async = `true`
| ) |  |

## ◆ sendFile()

void ob::Device::sendFile | ( | const char * | filePath,
|  | const char * | dstPath,
|  | SendFileCallback | callback,
|  | bool | async = `true`
| ) |  |

Send files to the specified path on the device side [Asynchronouscallback].

Parameters

  filePath | Original file path
  dstPath | Accept the save path on the device side
  callback | File transfer callback
  async | Whether to execute asynchronously

## ◆ getDeviceState()

OBDeviceState ob::Device::getDeviceState | ( |  | ) |

Get the current state.

Returns
  OBDeviceState device state information

## ◆ setDeviceStateChangedCallback()

void ob::Device::setDeviceStateChangedCallback | ( | DeviceStateChangedCallback | callback | ) |

Set the device state changed callbacks.

Parameters

  callback | The callback function that is triggered when the device status changes (for example, the frame rate is automatically reduced or the stream is closed due to high temperature, etc.)

## ◆ activateAuthorization()

bool ob::Device::activateAuthorization | ( | const char * | authCode | ) |

Verify device authorization code.

Parameters

  authCode | Authorization code

Returns
  bool whether the activation is successful

## ◆ writeAuthorizationCode()

void ob::Device::writeAuthorizationCode | ( | const char * | authCodeStr | ) |

Write authorization code.

Parameters

  [in] | authCodeStr | Authorization code

## ◆ getCalibrationCameraParamList()

std::shared_ptr< CameraParamList > ob::Device::getCalibrationCameraParamList | ( |  | ) |

Get the original parameter list of camera calibration saved in the device.

Attention
  The parameters in the list do not correspond to the current open-current configuration. You need to select the parameters according to the actual situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the Pipeline::getCameraParam() interface.

Returns
  std::shared_ptr<CameraParamList> camera parameter list

## ◆ getCurrentDepthWorkMode()

OBDepthWorkMode ob::Device::getCurrentDepthWorkMode | ( |  | ) |

Get current depth work mode.

Returns
  ob_depth_work_mode Current depth work mode

## ◆ switchDepthWorkMode() [1/2]

OBStatus ob::Device::switchDepthWorkMode | ( | const OBDepthWorkMode & | workMode | ) |

Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to switch depth mode when known the complete name of depth work mode.

Parameters

  [in] | workMode | Depth work mode come from ob_depth_work_mode_list which return by ob_device_get_depth_work_mode_list

## ◆ switchDepthWorkMode() [2/2]

OBStatus ob::Device::switchDepthWorkMode | ( | const char * | modeName | ) |

Switch depth work mode by work mode name.

Parameters

  [in] | modeName | Depth work mode name which equals to OBDepthWorkMode.name

## ◆ getDepthWorkModeList()

std::shared_ptr< OBDepthWorkModeList > ob::Device::getDepthWorkModeList | ( |  | ) |

Request support depth work mode list.

Returns
  OBDepthWorkModeList list of ob_depth_work_mode

## ◆ reboot() [1/2]

void ob::Device::reboot | ( |  | ) |

Device restart.

Attention
  The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal. Please delete the object directly and obtain it again after the device is reconnected.

## ◆ reboot() [2/2]

void ob::Device::reboot | ( | uint32_t | delayMs | ) |

Device restart delay mode.

Attention
  The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal. Please delete the object directly and obtain it again after the device is reconnected. Support devices: Gemini2 L

Parameters

  [in] | delayMs | Time unit：ms。delayMs == 0：No delay；delayMs > 0, Delay millisecond connect to host device after reboot

## ◆ syncDeviceTime()

DEPRECATED uint64_t ob::Device::syncDeviceTime | ( |  | ) |

Synchronize the device time (synchronize local system time to device)

Deprecated:
  This interface is deprecated, please use timerSyncWithHost instead.

Returns
  The command (round trip time, rtt)

## ◆ getSyncConfig()

DEPRECATED OBDeviceSyncConfig ob::Device::getSyncConfig | ( |  | ) |

get the current device synchronization configuration

Device synchronization: including exposure synchronization function and multi-camera synchronization function of different sensors within a single machine

Deprecated:
  This interface is deprecated, please use getMultiDeviceSyncConfig instead.

Returns
  OBDeviceSyncConfig return the device synchronization configuration

## ◆ setSyncConfig()

DEPRECATED void ob::Device::setSyncConfig | ( | const OBDeviceSyncConfig & | deviceSyncConfig | ) |

Set the device synchronization configuration.

Used to configure the exposure synchronization function and multi-camera synchronization function of different sensors in a single machine

Deprecated:
  This interface is deprecated, please use setMultiDeviceSyncConfig instead.

Attention
  Calling this function will directly write the configuration to the device Flash, and it will still take effect after the device restarts. To avoid affecting the Flash lifespan, do not update the configuration frequently.

Parameters

  deviceSyncConfig | Device synchronization configuration

## ◆ getSupportedMultiDeviceSyncModeBitmap()

uint16_t ob::Device::getSupportedMultiDeviceSyncModeBitmap | ( |  | ) |

Get the supported multi device sync mode bitmap of the device.

For example, if the return value is 0b00001100, it means the device supports OB_MULTI_DEVICE_SYNC_MODE_PRIMARY and OB_MULTI_DEVICE_SYNC_MODE_SECONDARY. User can check the supported mode by the code:

if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN){
//support OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
}
if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_STANDALONE){
//support OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
}
// and so on
OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
@ OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
standalone mode
Definition ObTypes.h:1272
OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
@ OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
free run mode
Definition ObTypes.h:1265

Returns
  uint16_t return the supported multi device sync mode bitmap of the device.

## ◆ setMultiDeviceSyncConfig()

void ob::Device::setMultiDeviceSyncConfig | ( | const OBMultiDeviceSyncConfig & | config | ) |

set the multi device sync configuration of the device.

Parameters

  [in] | config | The multi device sync configuration.

## ◆ getMultiDeviceSyncConfig()

OBMultiDeviceSyncConfig ob::Device::getMultiDeviceSyncConfig | ( |  | ) |

get the multi device sync configuration of the device.

Returns
  OBMultiDeviceSyncConfig return the multi device sync configuration of the device.

## ◆ triggerCapture()

void ob::Device::triggerCapture | ( |  | ) |

send the capture command to the device.

The device will start one time image capture after receiving the capture command when it is in the OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING

Attention
  The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream. The number of frames per trigger can be set by framesPerTrigger.
  For some models，receive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling this function should not be too high, please refer to the product manual for the specific supported frequency.
  If the device is not in the OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.

## ◆ setTimestampResetConfig()

void ob::Device::setTimestampResetConfig | ( | const OBDeviceTimestampResetConfig & | config | ) |

set the timestamp reset configuration of the device.

## ◆ getTimestampResetConfig()

OBDeviceTimestampResetConfig ob::Device::getTimestampResetConfig | ( |  | ) |

get the timestamp reset configuration of the device.

Returns
  OBDeviceTimestampResetConfig return the timestamp reset configuration of the device.

## ◆ timestampReset()

void ob::Device::timestampReset | ( |  | ) |

send the timestamp reset command to the device.

The device will reset the timer for calculating the timestamp for output frames to 0 after receiving the timestamp reset command when the timestamp reset function is enabled. The timestamp reset function can be enabled by call ob_device_set_timestamp_reset_config.

Before calling this function, user should call ob_device_set_timestamp_reset_config to disable the timestamp reset function (It is not required for some models, but it is still recommended to do so for code compatibility).

Attention
  If the stream of the device is started, the timestamp of the continuous frames output by the stream will jump once after the timestamp reset.
  Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time. User can call this function periodically to reset the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.

## ◆ timerSyncWithHost()

void ob::Device::timerSyncWithHost | ( |  | ) |

synchronize the timer of the device with the host.

After calling this function, the timer of the device will be synchronized with the host. User can call this function to multiple devices to synchronize all timers of the devices.

Attention
  If the stream of the device is started, the timestamp of the continuous frames output by the stream will may jump once after the timer sync.
  Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time. User can call this function periodically to synchronize the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.

## ◆ loadDepthFilterConfig()

void ob::Device::loadDepthFilterConfig | ( | const char * | filePath | ) |

Load depth filter config from file.

Parameters

  filePath | Path of the config file.

## ◆ resetDefaultDepthFilterConfig()

void ob::Device::resetDefaultDepthFilterConfig | ( |  | ) |

Reset depth filter config to device default define.

## ◆ getCurrentPresetName()

const char * ob::Device::getCurrentPresetName | ( |  | ) |

Get current preset name.

The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.

Returns
  const char* return the current preset name, it should be one of the preset names returned by getAvailablePresetList.

## ◆ getCurrentDepthModeName()

const char * ob::Device::getCurrentDepthModeName | ( |  | ) |

Get current depth mode name.

According the current preset name to return current depth mode name

Returns
  const char* return the current depth mode name.

## ◆ loadPreset()

void ob::Device::loadPreset | ( | const char * | presetName | ) |

load the preset according to the preset name.

Attention
  After loading the preset, the settings in the preset will set to the device immediately. Therefore, it is recommended to re-read the device settings to update the user program temporarily.

Parameters

  presetName | The preset name to set. The name should be one of the preset names returned by getAvailablePresetList.

## ◆ getAvailablePresetList()

std::shared_ptr< DevicePresetList > ob::Device::getAvailablePresetList | ( |  | ) |

Get available preset list.

The available preset list usually defined by the device manufacturer and restores on the device.

User can load the custom preset by calling loadPresetFromJsonFile to append the available preset list.

Returns
  DevicePresetList return the available preset list.

## ◆ loadPresetFromJsonFile()

void ob::Device::loadPresetFromJsonFile | ( | const char * | filePath | ) |

Load custom preset from file.

After loading the custom preset, the settings in the custom preset will set to the device immediately.

After loading the custom preset, the available preset list will be appended with the custom preset and named as the file name.

Attention
  The user should ensure that the custom preset file is adapted to the device and the settings in the file are valid.
  It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.

Parameters

  filePath | The path of the custom preset file.

## ◆ loadPresetFromJsonData()

void ob::Device::loadPresetFromJsonData | ( | const char * | presetName,
|  | const uint8_t * | data,
|  | uint32_t | size
| ) |  |

Load custom preset from data.

After loading the custom preset, the settings in the custom preset will set to the device immediately.

After loading the custom preset, the available preset list will be appended with the custom preset and named as the presetName.

Attention
  The user should ensure that the custom preset data is adapted to the device and the settings in the data are valid.
  It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.

Parameters

  data | The custom preset data.
  size | The size of the custom preset data.

## ◆ exportSettingsAsPresetJsonFile()

void ob::Device::exportSettingsAsPresetJsonFile | ( | const char * | filePath | ) |

Export current device settings as a preset json file.

The exported preset file can be loaded by calling loadPresetFromJsonFile to restore the device setting.

After exporting the preset, a new preset named as the filePath will be added to the available preset list.

Parameters

  filePath | The path of the preset file to be exported.

## ◆ exportSettingsAsPresetJsonData()

void ob::Device::exportSettingsAsPresetJsonData | ( | const char * | presetName,
|  | const uint8_t ** | data,
|  | uint32_t * | dataSize
| ) |  |

Export current device settings as a preset json data.

After exporting the preset, a new preset named as the presetName will be added to the available preset list.

Attention
  The memory of the data is allocated by the SDK, and will automatically be released by the SDK.
  The memory of the data will be reused by the SDK on the next call, so the user should copy the data to a new buffer if it needs to be preserved.

Parameters

  [out] | data | return the preset json data.
  [out] | dataSize | return the size of the preset json data.

## Friends And Related Symbol Documentation

## ◆ Pipeline

friend class Pipeline
| friend

Definition at line 632 of file Device.hpp.

## ◆ Recorder

friend class Recorder
| friend

Definition at line 633 of file Device.hpp.

## ◆ CoordinateTransformHelper

friend class CoordinateTransformHelper
| friend

Definition at line 634 of file Device.hpp.

## Member Data Documentation

## ◆ impl_

std::unique_ptr<DeviceImpl> ob::Device::impl_
| protected

Definition at line 31 of file Device.hpp.

The documentation for this class was generated from the following file:

- E:/Projects/Jenkins/workspace/OrbbecSDK/libobsensor/include/libobsensor/hpp/Device.hpp