OrbbecSDK 2.0.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
|
#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 | |
Device & | operator= (Device &&other) noexcept |
Device (const Device &)=delete | |
Device & | operator= (const Device &)=delete |
virtual | ~Device () noexcept |
ob_device_t * | getImpl () const |
std::shared_ptr< DeviceInfo > | getDeviceInfo () 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< SensorList > | getSensorList () const |
Get device sensor list. | |
std::shared_ptr< Sensor > | getSensor (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< OBDepthWorkModeList > | getDepthWorkModeList () 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< DevicePresetList > | getAvailablePresetList () 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< CameraParamList > | getCalibrationCameraParamList () |
void | loadDepthFilterConfig (const char *filePath) |
Static Public Member Functions | |
static void | deviceStateChangedCallback (OBDeviceState state, const char *message, void *userData) |
Protected Attributes | |
ob_device * | impl_ = nullptr |
DeviceStateChangedCallback | deviceStateChangeCallback_ |
DeviceFwUpdateCallback | fwUpdateCallback_ |
Definition at line 33 of file Device.hpp.
std::function<void(OBFwUpdateState state, const char *message, uint8_t percent)> ob::Device::DeviceFwUpdateCallback |
Callback function for device firmware update progress.
state | The device firmware update status. |
message | Status information. |
percent | The percentage of the update progress. |
Definition at line 42 of file Device.hpp.
std::function<void(OBDeviceState state, const char *message)> ob::Device::DeviceStateChangedCallback |
Callback function for device status updates.
state | The device status. |
message | Status information. |
Definition at line 50 of file Device.hpp.
|
inlineexplicit |
Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
Definition at line 61 of file Device.hpp.
|
inlinenoexcept |
Definition at line 63 of file Device.hpp.
|
delete |
|
inlinevirtualnoexcept |
Definition at line 81 of file Device.hpp.
Definition at line 67 of file Device.hpp.
|
inline |
Definition at line 87 of file Device.hpp.
|
inline |
Get device information.
Definition at line 96 of file Device.hpp.
|
inline |
Check if the extension information is exist.
infoKey | The key of the extension information |
Definition at line 109 of file Device.hpp.
|
inline |
Get information about extensions obtained from SDK supported by the device.
infoKey | The key of the extension information |
Definition at line 122 of file Device.hpp.
|
inline |
Get device sensor list.
Definition at line 134 of file Device.hpp.
|
inline |
Get specific type of sensor if device not open, SDK will automatically open the connected device and return to the instance.
Definition at line 147 of file Device.hpp.
|
inline |
Set int type of device property.
propertyId | Property id |
value | Property value to be set |
Definition at line 160 of file Device.hpp.
Referenced by reboot().
|
inline |
Set float type of device property.
propertyId | Property id |
value | Property value to be set |
Definition at line 172 of file Device.hpp.
|
inline |
Set bool type of device property.
propertyId | Property id |
value | Property value to be set |
Definition at line 184 of file Device.hpp.
|
inline |
Get int type of device property.
propertyId | Property id |
Definition at line 196 of file Device.hpp.
|
inline |
Get float type of device property.
propertyId | Property id |
Definition at line 209 of file Device.hpp.
|
inline |
Get bool type of device property.
propertyId | Property id |
Definition at line 222 of file Device.hpp.
|
inline |
Get int type device property range (including current value and default value)
propertyId | Property id |
Definition at line 235 of file Device.hpp.
|
inline |
Get float type device property range((including current value and default value)
propertyId | Property id |
Definition at line 248 of file Device.hpp.
|
inline |
Get bool type device property range (including current value and default value)
propertyId | The ID of the property |
Definition at line 261 of file Device.hpp.
|
inline |
Set the structured data type of a device property.
propertyId | The ID of the property |
data | The data to set |
dataSize | The size of the data to set |
Definition at line 275 of file Device.hpp.
|
inline |
Get the structured data type of a device property.
propertyId | The ID of the property |
data | The property data obtained |
dataSize | The size of the data obtained |
Definition at line 288 of file Device.hpp.
|
inline |
Get the number of properties supported by the device.
Definition at line 299 of file Device.hpp.
|
inline |
Get the supported properties of the device.
index | The index of the property |
Definition at line 312 of file Device.hpp.
|
inline |
Check if a property permission is supported.
propertyId | The ID of the property |
permission | The read and write permissions to check |
Definition at line 326 of file Device.hpp.
|
inline |
Check if the global timestamp is supported for the device.
Definition at line 338 of file Device.hpp.
|
inline |
Enable or disable the global timestamp.
enable | Whether to enable the global timestamp |
Definition at line 350 of file Device.hpp.
|
inline |
Update the device firmware.
filePath | Firmware path |
callback | Firmware Update progress and status callback |
async | Whether to execute asynchronously |
Definition at line 363 of file Device.hpp.
Referenced by deviceUpgrade().
|
inline |
Update the device firmware from data.
firmwareData | Firmware data |
firmwareDataSize | Firmware data size |
callback | Firmware Update progress and status callback |
async | Whether to execute asynchronously |
Definition at line 378 of file Device.hpp.
Referenced by deviceUpgradeFromData().
|
inline |
Set the device state changed callbacks.
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.) |
Definition at line 391 of file Device.hpp.
|
inlinestatic |
Definition at line 398 of file Device.hpp.
Referenced by setDeviceStateChangedCallback().
|
inline |
Get current depth work mode.
Definition at line 408 of file Device.hpp.
|
inline |
Get current depth mode name.
According the current preset name to return current depth mode name
Definition at line 420 of file Device.hpp.
|
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.
[in] | workMode | Depth 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.
|
inline |
Switch depth work mode by work mode name.
[in] | modeName | Depth work mode name which equals to OBDepthWorkMode.name |
Definition at line 444 of file Device.hpp.
|
inline |
Request support depth work mode list.
Definition at line 455 of file Device.hpp.
|
inline |
Device restart.
Definition at line 467 of file Device.hpp.
Referenced by reboot().
|
inline |
Device restart delay mode.
[in] | delayMs | Time unit:ms。delayMs == 0:No delay;delayMs > 0, Delay millisecond connect to host device after reboot |
Definition at line 481 of file Device.hpp.
|
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.
[in] | enable | Whether to enable the device heartbeat. |
Definition at line 494 of file Device.hpp.
|
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:
Definition at line 515 of file Device.hpp.
|
inline |
set the multi device sync configuration of the device.
[in] | config | The multi device sync configuration. |
Definition at line 527 of file Device.hpp.
|
inline |
get the multi device sync configuration of the device.
Definition at line 538 of file Device.hpp.
|
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
Definition at line 556 of file Device.hpp.
|
inline |
set the timestamp reset configuration of the device.
Definition at line 565 of file Device.hpp.
|
inline |
get the timestamp reset configuration of the device.
Definition at line 576 of file Device.hpp.
|
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).
Definition at line 594 of file Device.hpp.
|
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.
Definition at line 616 of file Device.hpp.
|
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.
Definition at line 627 of file Device.hpp.
|
inline |
load the preset according to the preset name.
presetName | The preset name to set. The name should be one of the preset names returned by getAvailablePresetList. |
Definition at line 640 of file Device.hpp.
|
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.
Definition at line 653 of file Device.hpp.
|
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.
filePath | The path of the custom preset file. |
Definition at line 670 of file Device.hpp.
|
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.
data | The custom preset data. |
size | The size of the custom preset data. |
Definition at line 687 of file Device.hpp.
|
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.
[out] | data | return the preset json data. |
[out] | dataSize | return the size of the preset json data. |
Definition at line 703 of file Device.hpp.
|
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.
filePath | The path of the preset file to be exported. |
Definition at line 715 of file Device.hpp.
|
inline |
Get the current device status.
Definition at line 726 of file Device.hpp.
|
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.
[in] | sendData | The data to be sent to the device. |
[in] | sendDataSize | The size of the data to be sent to the device. |
[out] | receiveData | The data received from the device. |
[in,out] | receiveDataSize | The 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.
|
inline |
Definition at line 761 of file Device.hpp.
|
inline |
Definition at line 765 of file Device.hpp.
|
inline |
Definition at line 769 of file Device.hpp.
|
inline |
Definition at line 776 of file Device.hpp.
|
protected |
Definition at line 53 of file Device.hpp.
Referenced by enableGlobalTimestamp(), enableHeartbeat(), exportSettingsAsPresetJsonData(), exportSettingsAsPresetJsonFile(), getAvailablePresetList(), getBoolProperty(), getBoolPropertyRange(), getCalibrationCameraParamList(), getCurrentDepthModeName(), getCurrentDepthWorkMode(), getCurrentPresetName(), getDepthWorkModeList(), getDeviceInfo(), getDeviceState(), getExtensionInfo(), getFloatProperty(), getFloatPropertyRange(), getImpl(), getIntProperty(), getIntPropertyRange(), getMultiDeviceSyncConfig(), getSensor(), getSensorList(), getStructuredData(), getSupportedMultiDeviceSyncModeBitmap(), getSupportedProperty(), getSupportedPropertyCount(), getTimestampResetConfig(), isExtensionInfoExist(), isGlobalTimestampSupported(), isPropertySupported(), loadPreset(), loadPresetFromJsonData(), loadPresetFromJsonFile(), operator=(), reboot(), sendAndReceiveData(), setBoolProperty(), setDeviceStateChangedCallback(), setFloatProperty(), setIntProperty(), setMultiDeviceSyncConfig(), setStructuredData(), setTimestampResetConfig(), switchDepthWorkMode(), switchDepthWorkMode(), timerSyncWithHost(), timestampReset(), triggerCapture(), updateFirmware(), updateFirmwareFromData(), and ~Device().
|
protected |
Definition at line 54 of file Device.hpp.
Referenced by deviceStateChangedCallback(), and setDeviceStateChangedCallback().
|
protected |
Definition at line 55 of file Device.hpp.
Referenced by updateFirmware(), and updateFirmwareFromData().