| OrbbecSDK 1.5.7 OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | 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. More...
virtual | ~Device () noexcept
std::shared_ptr< DeviceInfo > | getDeviceInfo ()
| Get device information. More...
std::shared_ptr< SensorList > | getSensorList ()
| Get device sensor list. More...
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. More...
void | setIntProperty (OBPropertyID propertyId, int32_t property)
| Set int type of device property. More...
void | setFloatProperty (OBPropertyID propertyId, float property)
| Set float type of device property. More...
void | setBoolProperty (OBPropertyID propertyId, bool property)
| Set bool type of device property. More...
int32_t | getIntProperty (OBPropertyID propertyId)
| Get int type of device property. More...
float | getFloatProperty (OBPropertyID propertyId)
| Get float type of device property. More...
bool | getBoolProperty (OBPropertyID propertyId)
| Get bool type of device property. More...
OBIntPropertyRange | getIntPropertyRange (OBPropertyID propertyId)
| Get int type device property range (ncluding current valueand default value) More...
OBFloatPropertyRange | getFloatPropertyRange (OBPropertyID propertyId)
| Get float type device property range((including current valueand default value) More...
OBBoolPropertyRange | getBoolPropertyRange (OBPropertyID propertyId)
| Get bool type device property range (including current value anddefault value) More...
void | writeAHB (uint32_t reg, uint32_t mask, uint32_t value)
| AHB register write. More...
void | readAHB (uint32_t reg, uint32_t mask, uint32_t *value)
| AHB AHB register read. More...
void | writeI2C (uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t value)
| I2C register write. More...
void | readI2C (uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t *value)
| I2C registers read. More...
void | writeFlash (uint32_t offset, const void *data, uint32_t dataSize, SetDataCallback callback, bool async=false)
| Set the properties of writing to Flash. More...
void | readFlash (uint32_t offset, uint32_t dataSize, GetDataCallback callback, bool async=false)
| Read Flash property. More...
void | setRawData (OBPropertyID propertyId, const void *data, uint32_t dataSize, SetDataCallback callback, bool async=false)
| Set raw data type of device property [Asynchronous callback]. More...
void | getRawData (OBPropertyID propertyId, GetDataCallback callback, bool async=false)
| Get raw data type of device property [Asynchronous callback]. More...
void | setStructuredData (OBPropertyID propertyId, const void *data, uint32_t dataSize)
| Set structured data type of device property. More...
void | getStructuredData (OBPropertyID propertyId, void *data, uint32_t *dataSize)
| Get structured data type of device property. More...
void | setStructuredDataExt (OBPropertyID propertyId, std::shared_ptr< OBDataBundle > dataBundle, SetDataCallback callback)
| Get structured data type of device property. More...
std::shared_ptr< OBDataBundle > | getStructuredDataExt (OBPropertyID propertyId)
| Get structured data type of device property. More...
OBProtocolVersion | getProtocolVersion ()
| Get the property protocol version. More...
OBCmdVersion | getCmdVersion (OBPropertyID propertyId)
| Get cmdVersion of property. More...
uint32_t | getSupportedPropertyCount ()
| Get number of devices supported property. More...
OBPropertyItem | getSupportedProperty (uint32_t index)
| Get device supported properties. More...
bool | isPropertySupported (OBPropertyID propertyId, OBPermissionType permission)
| Judge property permission support. More...
uint64_t | syncDeviceTime ()
| Synchronize device time (synchronize local systemtime to device) More...
void | deviceUpgrade (const char *filePath, DeviceUpgradeCallback callback, bool async=true)
| Upgrade the device firmware. More...
void | sendFile (const char *filePath, const char *dstPath, SendFileCallback callback, bool async=true)
| Send files to the specified path on the device side [Asynchronouscallback]. More...
OBDeviceState | getDeviceState ()
| Get the current state. More...
void | setDeviceStateChangedCallback (DeviceStateChangedCallback callback)
| Set the device state changed callbacks. More...
bool | activateAuthorization (const char *authCode)
| Verify device authorization code. More...
void | writeAuthorizationCode (const char *authCodeStr)
| Write authorization code. More...
std::shared_ptr< CameraParamList > | getCalibrationCameraParamList ()
| Get the original parameter list of camera calibration saved in the device. 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. More...
OBDepthWorkMode | getCurrentDepthWorkMode ()
| Get current depth work mode. More...
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. More...
OBStatus | switchDepthWorkMode (const char *modeName)
| Switch depth work mode by work mode name. More...
std::shared_ptr< OBDepthWorkModeList > | getDepthWorkModeList ()
| Request support depth work mode list. More...
void | reboot ()
| Device restart. More...
OBDeviceSyncConfig | getSyncConfig ()
| 获取当前设备同步配置 More...
void | setSyncConfig (const OBDeviceSyncConfig &deviceSyncConfig)
| 设置设备同步配置 More...

## Friends
class | Pipeline
class | Recorder

## Detailed Description

Definition at line 33 of file Device.hpp.

## Constructor & Destructor Documentation

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

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

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

## Member Function Documentation

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

Get device information.

Returns
  std::shared_ptr<DeviceInfo> returns device information

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

Get device sensor list.

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

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> eturns the sensor example, if the device does not have the device,returns nullptr

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

Set int type of device property.

Parameters

  propertyId | Property id
  property | Property to be set

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

Set float type of device property.

Parameters

  propertyId | Property id
  property | Property to be set

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

Set bool type of device property.

Parameters

  propertyId | Property id
  property | Property to be set

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

Get int type of device property.

Parameters

  propertyId | Property id

Returns
  int32_t Property to get

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

Get float type of device property.

Parameters

  propertyId | Property id

Returns
  float Property to get

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

Get bool type of device property.

Parameters

  propertyId | Property id

Returns
  bool Property to get

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

Get int type device property range (ncluding current valueand default value)

Parameters

  propertyId | Property id

Returns
  OBIntPropertyRange Property range

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

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

Parameters

  propertyId | Property id

Returns
  OBFloatPropertyRange Property range

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

Get bool type device property range (including current value anddefault value)

Parameters

  propertyId | Property id

Returns
  OBBoolPropertyRange Property range

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

AHB register write.

Parameters

  reg | Register to be written
  mask | The mask to be writen
  value | The value to be written

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

AHB AHB register read.

Parameters

  reg | Register to be read
  mask | The mask to be read
  value | The value to be returned

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

I2C register write.

Parameters

  reg | I2C module ID to be written
  reg | Register to be written
  mask | The mask to be written
  value | he value to be written

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

I2C registers read.

Parameters

  reg | I2C module ID to be read
  reg | Register to be read
  mask | The mask to be read
  value | The value to be returned

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

Set the properties of writing to Flash.

Parameters

  offset | flash offset address
  data | Property data to be written
  dataSize | The size of the property to be written
  callback | Write flash progress callback
  async | Whether to execute asynchronously

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

Read Flash property.

Parameters

  offset | flash offset address
  data | Property data to be read
  dataSize | The size of the property to get
  callback | Read data returned by flash and progress callback
  async | Whether to execute asynchronously

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

Set raw data type of device property [Asynchronous callback].

Parameters

  propertyId | Property id
  data | Property data to be set
  dataSize | The size of the property data to be set
  callback | rawdata set progress callback
  async | Whether to execute asynchronously

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

Get raw data type of device property [Asynchronous callback].

Parameters

  propertyId | Property id
  data | Property data obtained
  dataSize | Get the size of the property
  callback | Get the returned data and progress callback
  async | Whether to execute asynchronously

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

Set structured data type of device property.

Parameters

  propertyId | Property id
  data | Property data to be set
  dataSize | The size of the attribute to be set

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

Get structured data type of device property.

Parameters

  propertyId | Property id
  data | Property data obtained
  dataSize | Get the size of the attribute

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

Get structured data type of device property.

Parameters

  propertyId | Property id
  dataBundle | Target data
  callback | Callback of setting

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

Get structured data type of device property.

Parameters

  propertyId | Property id

Returns
  Data bundle

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

Get the property protocol version.

Returns
  OBProtocolVersion

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

Get cmdVersion of property.

Parameters

  propertyId | Property id

Returns
  OBCmdVersion

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

Get number of devices supported property.

Returns
  uint32_t returns the number of supported attributes

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

Get device supported properties.

Parameters

  uint32_t | Property index

Returns
  OBPropertyItem returns the type of supported properties

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

Judge property permission support.

Parameters

  propertyId | Property id
  permission | Types of read and write permissions that need to be interpreted

Returns
  bool returns whether it is supported

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

Synchronize device time (synchronize local systemtime to device)

Returns
  uint64_t command (round trip time， rtt）

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

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

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

Get the current state.

Returns
  OBDeviceState device state information

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

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

Verify device authorization code.

Parameters

  authCode | Authorization code

Returns
  bool whether the activation is successfu

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

Write authorization code.

Parameters

  authCode | Authorization code

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

Get the original parameter list of camera calibration saved in the device. 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

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

Get current depth work mode.

Returns
  ob_depth_work_mode Current depth work mode

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

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

Switch depth work mode by work mode name.

Parameters

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

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

Request support depth work mode list.

Returns
  OBDepthWorkModeList list of ob_depth_work_mode

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.

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

获取当前设备同步配置

设备同步：包括单机内的不同 Sensor 的曝光同步功能 和 多机同步功能

Returns
  OBDeviceSyncConfig 返回设备同步配置

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

设置设备同步配置

用于配置 单机内的不同 Sensor 的曝光同步功能 和 多机同步功能

Attention
  调用本函数会直接将配置写入设备Flash，设备重启后依然会生效。为了避免影响Flash寿命，不要频繁更新配置。

Parameters

  [out] | deviceSyncConfig | 设备同步配置

## Friends And Related Function Documentation

friend class Pipeline
| friend

Definition at line 714 of file Device.hpp.

friend class Recorder
| friend

Definition at line 715 of file Device.hpp.

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

- /root/libobsensor/include/libobsensor/hpp/Device.hpp