OrbbecSDK 2.0.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
ob::Device Class Reference

#include <Device.hpp>

Public Types

typedef std::function< void(OBFwUpdateState state, const char *message, uint8_t percent)> DeviceFwUpdateCallback
 Callback function for device firmware update progress.
 
typedef std::function< void(OBDeviceState state, const char *message)> DeviceStateChangedCallback
 Callback function for device status updates.
 

Public Member Functions

 Device (ob_device_t *impl)
 Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
 
 Device (Device &&other) noexcept
 
Deviceoperator= (Device &&other) noexcept
 
 Device (const Device &)=delete
 
Deviceoperator= (const Device &)=delete
 
virtual ~Device () noexcept
 
ob_device_t * getImpl () const
 
std::shared_ptr< DeviceInfogetDeviceInfo () const
 Get device information.
 
bool isExtensionInfoExist (const std::string &infoKey) const
 Check if the extension information is exist.
 
const char * getExtensionInfo (const std::string &infoKey) const
 Get information about extensions obtained from SDK supported by the device.
 
std::shared_ptr< SensorListgetSensorList () const
 Get device sensor list.
 
std::shared_ptr< SensorgetSensor (OBSensorType type) const
 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 value) const
 Set int type of device property.
 
void setFloatProperty (OBPropertyID propertyId, float value) const
 Set float type of device property.
 
void setBoolProperty (OBPropertyID propertyId, bool value) const
 Set bool type of device property.
 
int32_t getIntProperty (OBPropertyID propertyId) const
 Get int type of device property.
 
float getFloatProperty (OBPropertyID propertyId) const
 Get float type of device property.
 
bool getBoolProperty (OBPropertyID propertyId) const
 Get bool type of device property.
 
OBIntPropertyRange getIntPropertyRange (OBPropertyID propertyId) const
 Get int type device property range (including current value and default value)
 
OBFloatPropertyRange getFloatPropertyRange (OBPropertyID propertyId) const
 Get float type device property range((including current value and default value)
 
OBBoolPropertyRange getBoolPropertyRange (OBPropertyID propertyId) const
 Get bool type device property range (including current value and default value)
 
void setStructuredData (OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const
 Set the structured data type of a device property.
 
void getStructuredData (OBPropertyID propertyId, uint8_t *data, uint32_t *dataSize) const
 Get the structured data type of a device property.
 
int getSupportedPropertyCount () const
 Get the number of properties supported by the device.
 
OBPropertyItem getSupportedProperty (uint32_t index) const
 Get the supported properties of the device.
 
bool isPropertySupported (OBPropertyID propertyId, OBPermissionType permission) const
 Check if a property permission is supported.
 
bool isGlobalTimestampSupported () const
 Check if the global timestamp is supported for the device.
 
void enableGlobalTimestamp (bool enable)
 Enable or disable the global timestamp.
 
void updateFirmware (const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
 Update the device firmware.
 
void updateFirmwareFromData (const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
 Update the device firmware from data.
 
void setDeviceStateChangedCallback (DeviceStateChangedCallback callback)
 Set the device state changed callbacks.
 
OBDepthWorkMode getCurrentDepthWorkMode () const
 Get current depth work mode.
 
const char * getCurrentDepthModeName ()
 Get current depth mode name.
 
OBStatus switchDepthWorkMode (const OBDepthWorkMode &workMode) const
 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) const
 Switch depth work mode by work mode name.
 
std::shared_ptr< OBDepthWorkModeListgetDepthWorkModeList () const
 Request support depth work mode list.
 
void reboot () const
 Device restart.
 
void reboot (uint32_t delayMs) const
 Device restart delay mode.
 
void enableHeartbeat (bool enable) const
 Enable or disable the device heartbeat.
 
uint16_t getSupportedMultiDeviceSyncModeBitmap () const
 Get the supported multi device sync mode bitmap of the device.
 
void setMultiDeviceSyncConfig (const OBMultiDeviceSyncConfig &config) const
 set the multi device sync configuration of the device.
 
OBMultiDeviceSyncConfig getMultiDeviceSyncConfig () const
 get the multi device sync configuration of the device.
 
void triggerCapture () const
 send the capture command to the device.
 
void setTimestampResetConfig (const OBDeviceTimestampResetConfig &config) const
 set the timestamp reset configuration of the device.
 
OBDeviceTimestampResetConfig getTimestampResetConfig () const
 get the timestamp reset configuration of the device.
 
void timestampReset () const
 send the timestamp reset command to the device.
 
void timerSyncWithHost () const
 synchronize the timer of the device with the host.
 
const char * getCurrentPresetName () const
 Get current preset name.
 
void loadPreset (const char *presetName) const
 load the preset according to the preset name.
 
std::shared_ptr< DevicePresetListgetAvailablePresetList () const
 Get available preset list.
 
void loadPresetFromJsonFile (const char *filePath) const
 Load custom preset from file.
 
void loadPresetFromJsonData (const char *presetName, const uint8_t *data, uint32_t size)
 Load custom preset from data.
 
void exportSettingsAsPresetJsonData (const char *presetName, const uint8_t **data, uint32_t *dataSize)
 Export current device settings as a preset json data.
 
void exportSettingsAsPresetJsonFile (const char *filePath) const
 Export current device settings as a preset json file.
 
OBDeviceState getDeviceState ()
 Get the current device status.
 
void sendAndReceiveData (const uint8_t *sendData, uint32_t sendDataSize, uint8_t *receiveData, uint32_t *receiveDataSize) const
 Send data to the device and receive data from the device.
 
void deviceUpgrade (const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
 
void deviceUpgradeFromData (const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
 
std::shared_ptr< CameraParamListgetCalibrationCameraParamList ()
 
void loadDepthFilterConfig (const char *filePath)
 

Static Public Member Functions

static void deviceStateChangedCallback (OBDeviceState state, const char *message, void *userData)
 

Protected Attributes

ob_deviceimpl_ = nullptr
 
DeviceStateChangedCallback deviceStateChangeCallback_
 
DeviceFwUpdateCallback fwUpdateCallback_
 

Detailed Description

Definition at line 33 of file Device.hpp.

Member Typedef Documentation

◆ DeviceFwUpdateCallback

std::function<void(OBFwUpdateState state, const char *message, uint8_t percent)> ob::Device::DeviceFwUpdateCallback

Callback function for device firmware update progress.

Parameters
stateThe device firmware update status.
messageStatus information.
percentThe percentage of the update progress.

Definition at line 42 of file Device.hpp.

◆ DeviceStateChangedCallback

std::function<void(OBDeviceState state, const char *message)> ob::Device::DeviceStateChangedCallback

Callback function for device status updates.

Parameters
stateThe device status.
messageStatus information.

Definition at line 50 of file Device.hpp.

Constructor & Destructor Documentation

◆ Device() [1/3]

ob::Device::Device ( ob_device_t * impl)
inlineexplicit

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

Definition at line 61 of file Device.hpp.

◆ Device() [2/3]

ob::Device::Device ( Device && other)
inlinenoexcept

Definition at line 63 of file Device.hpp.

◆ Device() [3/3]

ob::Device::Device ( const Device & )
delete

◆ ~Device()

virtual ob::Device::~Device ( )
inlinevirtualnoexcept

Definition at line 81 of file Device.hpp.

Member Function Documentation

◆ operator=() [1/2]

Device & ob::Device::operator= ( Device && other)
inlinenoexcept

Definition at line 67 of file Device.hpp.

◆ operator=() [2/2]

Device & ob::Device::operator= ( const Device & )
delete

◆ getImpl()

ob_device_t * ob::Device::getImpl ( ) const
inline

Definition at line 87 of file Device.hpp.

◆ getDeviceInfo()

std::shared_ptr< DeviceInfo > ob::Device::getDeviceInfo ( ) const
inline

Get device information.

Returns
std::shared_ptr<DeviceInfo> return device information

Definition at line 96 of file Device.hpp.

◆ isExtensionInfoExist()

bool ob::Device::isExtensionInfoExist ( const std::string & infoKey) const
inline

Check if the extension information is exist.

Parameters
infoKeyThe key of the extension information
Returns
bool Whether the extension information exists

Definition at line 109 of file Device.hpp.

◆ getExtensionInfo()

const char * ob::Device::getExtensionInfo ( const std::string & infoKey) const
inline

Get information about extensions obtained from SDK supported by the device.

Parameters
infoKeyThe key of the extension information
Returns
const char* Returns extended information about the device

Definition at line 122 of file Device.hpp.

◆ getSensorList()

std::shared_ptr< SensorList > ob::Device::getSensorList ( ) const
inline

Get device sensor list.

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

Definition at line 134 of file Device.hpp.

◆ getSensor()

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

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

Definition at line 147 of file Device.hpp.

◆ setIntProperty()

void ob::Device::setIntProperty ( OBPropertyID propertyId,
int32_t value ) const
inline

Set int type of device property.

Parameters
propertyIdProperty id
valueProperty value to be set

Definition at line 160 of file Device.hpp.

Referenced by reboot().

◆ setFloatProperty()

void ob::Device::setFloatProperty ( OBPropertyID propertyId,
float value ) const
inline

Set float type of device property.

Parameters
propertyIdProperty id
valueProperty value to be set

Definition at line 172 of file Device.hpp.

◆ setBoolProperty()

void ob::Device::setBoolProperty ( OBPropertyID propertyId,
bool value ) const
inline

Set bool type of device property.

Parameters
propertyIdProperty id
valueProperty value to be set

Definition at line 184 of file Device.hpp.

◆ getIntProperty()

int32_t ob::Device::getIntProperty ( OBPropertyID propertyId) const
inline

Get int type of device property.

Parameters
propertyIdProperty id
Returns
int32_t Property to get

Definition at line 196 of file Device.hpp.

◆ getFloatProperty()

float ob::Device::getFloatProperty ( OBPropertyID propertyId) const
inline

Get float type of device property.

Parameters
propertyIdProperty id
Returns
float Property to get

Definition at line 209 of file Device.hpp.

◆ getBoolProperty()

bool ob::Device::getBoolProperty ( OBPropertyID propertyId) const
inline

Get bool type of device property.

Parameters
propertyIdProperty id
Returns
bool Property to get

Definition at line 222 of file Device.hpp.

◆ getIntPropertyRange()

OBIntPropertyRange ob::Device::getIntPropertyRange ( OBPropertyID propertyId) const
inline

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

Parameters
propertyIdProperty id
Returns
OBIntPropertyRange Property range

Definition at line 235 of file Device.hpp.

◆ getFloatPropertyRange()

OBFloatPropertyRange ob::Device::getFloatPropertyRange ( OBPropertyID propertyId) const
inline

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

Parameters
propertyIdProperty id
Returns
OBFloatPropertyRange Property range

Definition at line 248 of file Device.hpp.

◆ getBoolPropertyRange()

OBBoolPropertyRange ob::Device::getBoolPropertyRange ( OBPropertyID propertyId) const
inline

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

Parameters
propertyIdThe ID of the property
Returns
OBBoolPropertyRange The range of the property

Definition at line 261 of file Device.hpp.

◆ setStructuredData()

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

Set the structured data type of a device property.

Parameters
propertyIdThe ID of the property
dataThe data to set
dataSizeThe size of the data to set

Definition at line 275 of file Device.hpp.

◆ getStructuredData()

void ob::Device::getStructuredData ( OBPropertyID propertyId,
uint8_t * data,
uint32_t * dataSize ) const
inline

Get the structured data type of a device property.

Parameters
propertyIdThe ID of the property
dataThe property data obtained
dataSizeThe size of the data obtained

Definition at line 288 of file Device.hpp.

◆ getSupportedPropertyCount()

int ob::Device::getSupportedPropertyCount ( ) const
inline

Get the number of properties supported by the device.

Returns
The number of supported properties

Definition at line 299 of file Device.hpp.

◆ getSupportedProperty()

OBPropertyItem ob::Device::getSupportedProperty ( uint32_t index) const
inline

Get the supported properties of the device.

Parameters
indexThe index of the property
Returns
The type of supported property

Definition at line 312 of file Device.hpp.

◆ isPropertySupported()

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

Check if a property permission is supported.

Parameters
propertyIdThe ID of the property
permissionThe read and write permissions to check
Returns
Whether the property permission is supported

Definition at line 326 of file Device.hpp.

◆ isGlobalTimestampSupported()

bool ob::Device::isGlobalTimestampSupported ( ) const
inline

Check if the global timestamp is supported for the device.

Returns
Whether the global timestamp is supported

Definition at line 338 of file Device.hpp.

◆ enableGlobalTimestamp()

void ob::Device::enableGlobalTimestamp ( bool enable)
inline

Enable or disable the global timestamp.

Parameters
enableWhether to enable the global timestamp

Definition at line 350 of file Device.hpp.

◆ updateFirmware()

void ob::Device::updateFirmware ( const char * filePath,
DeviceFwUpdateCallback callback,
bool async = true )
inline

Update the device firmware.

Parameters
filePathFirmware path
callbackFirmware Update progress and status callback
asyncWhether to execute asynchronously

Definition at line 363 of file Device.hpp.

Referenced by deviceUpgrade().

◆ updateFirmwareFromData()

void ob::Device::updateFirmwareFromData ( const uint8_t * firmwareData,
uint32_t firmwareDataSize,
DeviceFwUpdateCallback callback,
bool async = true )
inline

Update the device firmware from data.

Parameters
firmwareDataFirmware data
firmwareDataSizeFirmware data size
callbackFirmware Update progress and status callback
asyncWhether to execute asynchronously

Definition at line 378 of file Device.hpp.

Referenced by deviceUpgradeFromData().

◆ setDeviceStateChangedCallback()

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

Set the device state changed callbacks.

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

Definition at line 391 of file Device.hpp.

◆ deviceStateChangedCallback()

static void ob::Device::deviceStateChangedCallback ( OBDeviceState state,
const char * message,
void * userData )
inlinestatic

Definition at line 398 of file Device.hpp.

Referenced by setDeviceStateChangedCallback().

◆ getCurrentDepthWorkMode()

OBDepthWorkMode ob::Device::getCurrentDepthWorkMode ( ) const
inline

Get current depth work mode.

Returns
ob_depth_work_mode Current depth work mode

Definition at line 408 of file Device.hpp.

◆ getCurrentDepthModeName()

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

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.

Definition at line 420 of file Device.hpp.

◆ switchDepthWorkMode() [1/2]

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

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]workModeDepth work mode come from ob_depth_work_mode_list which return by ob_device_get_depth_work_mode_list

Definition at line 432 of file Device.hpp.

◆ switchDepthWorkMode() [2/2]

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

Switch depth work mode by work mode name.

Parameters
[in]modeNameDepth work mode name which equals to OBDepthWorkMode.name

Definition at line 444 of file Device.hpp.

◆ getDepthWorkModeList()

std::shared_ptr< OBDepthWorkModeList > ob::Device::getDepthWorkModeList ( ) const
inline

Request support depth work mode list.

Returns
OBDepthWorkModeList list of ob_depth_work_mode

Definition at line 455 of file Device.hpp.

◆ reboot() [1/2]

void ob::Device::reboot ( ) const
inline

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.

Definition at line 467 of file Device.hpp.

Referenced by reboot().

◆ reboot() [2/2]

void ob::Device::reboot ( uint32_t delayMs) const
inline

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]delayMsTime unit:ms。delayMs == 0:No delay;delayMs > 0, Delay millisecond connect to host device after reboot

Definition at line 481 of file Device.hpp.

◆ enableHeartbeat()

void ob::Device::enableHeartbeat ( bool enable) const
inline

Enable or disable the device heartbeat.

After enable the device heartbeat, the sdk will start a thread to send heartbeat signal to the device error every 3 seconds.

Attention
If the device does not receive the heartbeat signal for a long time, it will be disconnected and rebooted.
Parameters
[in]enableWhether to enable the device heartbeat.

Definition at line 494 of file Device.hpp.

◆ getSupportedMultiDeviceSyncModeBitmap()

uint16_t ob::Device::getSupportedMultiDeviceSyncModeBitmap ( ) const
inline

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
standalone mode
Definition ObTypes.h:1171
@ OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
free run mode
Definition ObTypes.h:1164
Returns
uint16_t return the supported multi device sync mode bitmap of the device.

Definition at line 515 of file Device.hpp.

◆ setMultiDeviceSyncConfig()

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

set the multi device sync configuration of the device.

Parameters
[in]configThe multi device sync configuration.

Definition at line 527 of file Device.hpp.

◆ getMultiDeviceSyncConfig()

OBMultiDeviceSyncConfig ob::Device::getMultiDeviceSyncConfig ( ) const
inline

get the multi device sync configuration of the device.

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

Definition at line 538 of file Device.hpp.

◆ triggerCapture()

void ob::Device::triggerCapture ( ) const
inline

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.

Definition at line 556 of file Device.hpp.

◆ setTimestampResetConfig()

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

set the timestamp reset configuration of the device.

Definition at line 565 of file Device.hpp.

◆ getTimestampResetConfig()

OBDeviceTimestampResetConfig ob::Device::getTimestampResetConfig ( ) const
inline

get the timestamp reset configuration of the device.

Returns
OBDeviceTimestampResetConfig return the timestamp reset configuration of the device.

Definition at line 576 of file Device.hpp.

◆ timestampReset()

void ob::Device::timestampReset ( ) const
inline

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.

Definition at line 594 of file Device.hpp.

◆ timerSyncWithHost()

void ob::Device::timerSyncWithHost ( ) const
inline

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.

Definition at line 616 of file Device.hpp.

◆ getCurrentPresetName()

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

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.

Definition at line 627 of file Device.hpp.

◆ loadPreset()

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

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
presetNameThe preset name to set. The name should be one of the preset names returned by getAvailablePresetList.

Definition at line 640 of file Device.hpp.

◆ getAvailablePresetList()

std::shared_ptr< DevicePresetList > ob::Device::getAvailablePresetList ( ) const
inline

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.

Definition at line 653 of file Device.hpp.

◆ loadPresetFromJsonFile()

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

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
filePathThe path of the custom preset file.

Definition at line 670 of file Device.hpp.

◆ loadPresetFromJsonData()

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

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
dataThe custom preset data.
sizeThe size of the custom preset data.

Definition at line 687 of file Device.hpp.

◆ exportSettingsAsPresetJsonData()

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

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]datareturn the preset json data.
[out]dataSizereturn the size of the preset json data.

Definition at line 703 of file Device.hpp.

◆ exportSettingsAsPresetJsonFile()

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

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
filePathThe path of the preset file to be exported.

Definition at line 715 of file Device.hpp.

◆ getDeviceState()

OBDeviceState ob::Device::getDeviceState ( )
inline

Get the current device status.

Returns
OBDeviceState The device state information.

Definition at line 726 of file Device.hpp.

◆ sendAndReceiveData()

void ob::Device::sendAndReceiveData ( const uint8_t * sendData,
uint32_t sendDataSize,
uint8_t * receiveData,
uint32_t * receiveDataSize ) const
inline

Send data to the device and receive data from the device.

This is a factory and debug function, which can be used to send and receive data from the device. The data format is secret and belongs to the device vendor.

Attention
The send and receive data buffer are managed by the caller, the receive data buffer should be allocated at 1024 bytes or larger.
Parameters
[in]sendDataThe data to be sent to the device.
[in]sendDataSizeThe size of the data to be sent to the device.
[out]receiveDataThe data received from the device.
[in,out]receiveDataSizeThe requeseted size of the data received from the device, and the actual size of the data received from the device.

Definition at line 745 of file Device.hpp.

◆ deviceUpgrade()

void ob::Device::deviceUpgrade ( const char * filePath,
DeviceFwUpdateCallback callback,
bool async = true )
inline

Definition at line 761 of file Device.hpp.

◆ deviceUpgradeFromData()

void ob::Device::deviceUpgradeFromData ( const uint8_t * firmwareData,
uint32_t firmwareDataSize,
DeviceFwUpdateCallback callback,
bool async = true )
inline

Definition at line 765 of file Device.hpp.

◆ getCalibrationCameraParamList()

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

Definition at line 769 of file Device.hpp.

◆ loadDepthFilterConfig()

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

Definition at line 776 of file Device.hpp.

Member Data Documentation

◆ impl_

◆ deviceStateChangeCallback_

DeviceStateChangedCallback ob::Device::deviceStateChangeCallback_
protected

Definition at line 54 of file Device.hpp.

Referenced by deviceStateChangedCallback(), and setDeviceStateChangedCallback().

◆ fwUpdateCallback_

DeviceFwUpdateCallback ob::Device::fwUpdateCallback_
protected

Definition at line 55 of file Device.hpp.

Referenced by updateFirmware(), and updateFirmwareFromData().


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