|
OrbbecSDK 2.5.5
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. | |
| 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. | |
| 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 | updateOptionalDepthPresets (const char filePathList[][OB_PATH_MAX], uint8_t pathCount, DeviceFwUpdateCallback callback) |
| Update the device optional depth presets. | |
| 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. | |
| bool | isFrameInterleaveSupported () const |
| Check if the device supports the frame interleave feature. | |
| void | loadFrameInterleave (const char *frameInterleaveName) const |
| load the frame interleave according to frame interleave name. | |
| std::shared_ptr< DeviceFrameInterleaveList > | getAvailableFrameInterleaveList () const |
| Get available frame interleave list. | |
| std::shared_ptr< PresetResolutionConfigList > | getAvailablePresetResolutionConfigList () const |
| Get the available preset resolution config list. | |
| 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 35 of file Device.hpp.
| typedef 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 44 of file Device.hpp.
| typedef 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 52 of file Device.hpp.
|
inlineexplicit |
Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
Definition at line 63 of file Device.hpp.
Referenced by Device(), Device(), deviceStateChangedCallback(), operator=(), operator=(), ob::PlaybackDevice::PlaybackDevice(), and ob::PlaybackDevice::PlaybackDevice().
|
inlinenoexcept |
Definition at line 65 of file Device.hpp.
|
delete |
|
inlinevirtualnoexcept |
Definition at line 83 of file Device.hpp.
Definition at line 69 of file Device.hpp.
Referenced by ob::PlaybackDevice::operator=().
|
inline |
Definition at line 89 of file Device.hpp.
|
inline |
Get device information.
Definition at line 98 of file Device.hpp.
|
inline |
Check if the extension information is exist.
| infoKey | The key of the extension information |
Definition at line 111 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 124 of file Device.hpp.
|
inline |
Get device sensor list.
Definition at line 136 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 149 of file Device.hpp.
|
inline |
Set int type of device property.
| propertyId | Property id |
| value | Property value to be set |
Definition at line 162 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 174 of file Device.hpp.
|
inline |
Set bool type of device property.
| propertyId | Property id |
| value | Property value to be set |
Definition at line 186 of file Device.hpp.
|
inline |
Get int type of device property.
| propertyId | Property id |
Definition at line 198 of file Device.hpp.
|
inline |
Get float type of device property.
| propertyId | Property id |
Definition at line 211 of file Device.hpp.
|
inline |
Get bool type of device property.
| propertyId | Property id |
Definition at line 224 of file Device.hpp.
|
inline |
Get int type device property range (including current value and default value)
| propertyId | Property id |
Definition at line 237 of file Device.hpp.
|
inline |
Get float type device property range((including current value and default value)
| propertyId | Property id |
Definition at line 250 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 263 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 277 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 290 of file Device.hpp.
|
inline |
Set the customer data type of a device property.
| data | The data to set |
| dataSize | The size of the data to set,the maximum length cannot exceed 65532 bytes. |
Definition at line 302 of file Device.hpp.
|
inline |
Get the customer data type of a device property.
| data | The property data obtained |
| dataSize | The size of the data obtained |
Definition at line 314 of file Device.hpp.
|
inline |
Get the number of properties supported by the device.
Definition at line 325 of file Device.hpp.
|
inline |
Get the supported properties of the device.
| index | The index of the property |
Definition at line 338 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 352 of file Device.hpp.
|
inline |
Check if the global timestamp is supported for the device.
Definition at line 364 of file Device.hpp.
|
inline |
Enable or disable the global timestamp.
| enable | Whether to enable the global timestamp |
Definition at line 376 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 389 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 404 of file Device.hpp.
Referenced by deviceUpgradeFromData().
|
inline |
Update the device optional depth presets.
| filePathList | A list(2D array) of preset file paths, each up to OB_PATH_MAX characters. |
| pathCount | The number of the preset file paths. |
| callback | Preset update progress and status callback |
Definition at line 418 of file Device.hpp.
|
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 431 of file Device.hpp.
|
inlinestatic |
Definition at line 438 of file Device.hpp.
Referenced by setDeviceStateChangedCallback().
|
inline |
Get current depth work mode.
Definition at line 448 of file Device.hpp.
|
inline |
Get current depth mode name.
According the current preset name to return current depth mode name
Definition at line 460 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 472 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 484 of file Device.hpp.
|
inline |
Request support depth work mode list.
Definition at line 495 of file Device.hpp.
|
inline |
Device restart.
Definition at line 507 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 521 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 534 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 555 of file Device.hpp.
|
inline |
set the multi device sync configuration of the device.
| [in] | config | The multi device sync configuration. |
Definition at line 567 of file Device.hpp.
|
inline |
get the multi device sync configuration of the device.
Definition at line 578 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 596 of file Device.hpp.
|
inline |
set the timestamp reset configuration of the device.
Definition at line 605 of file Device.hpp.
|
inline |
get the timestamp reset configuration of the device.
Definition at line 616 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 634 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 656 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 667 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 680 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 693 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 710 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 727 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 743 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 755 of file Device.hpp.
|
inline |
Get the current device status.
Definition at line 766 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 785 of file Device.hpp.
|
inline |
Check if the device supports the frame interleave feature.
Definition at line 796 of file Device.hpp.
|
inline |
load the frame interleave according to frame interleave name.
| frameInterleaveName | The frame interleave name to set. The name should be one of the frame interleave names returned by getAvailableFrameInterleaveList. |
Definition at line 808 of file Device.hpp.
|
inline |
Get available frame interleave list.
Definition at line 819 of file Device.hpp.
|
inline |
Get the available preset resolution config list.
Definition at line 831 of file Device.hpp.
|
inline |
Definition at line 848 of file Device.hpp.
|
inline |
Definition at line 852 of file Device.hpp.
|
inline |
Definition at line 856 of file Device.hpp.
|
inline |
Definition at line 863 of file Device.hpp.
|
protected |
Definition at line 55 of file Device.hpp.
Referenced by Device(), enableGlobalTimestamp(), enableHeartbeat(), exportSettingsAsPresetJsonData(), exportSettingsAsPresetJsonFile(), getAvailableFrameInterleaveList(), getAvailablePresetList(), getAvailablePresetResolutionConfigList(), getBoolProperty(), getBoolPropertyRange(), getCalibrationCameraParamList(), getCurrentDepthModeName(), getCurrentDepthWorkMode(), getCurrentPresetName(), getDepthWorkModeList(), getDeviceInfo(), getDeviceState(), ob::PlaybackDevice::getDuration(), getExtensionInfo(), getFloatProperty(), getFloatPropertyRange(), getImpl(), getIntProperty(), getIntPropertyRange(), getMultiDeviceSyncConfig(), ob::PlaybackDevice::getPlaybackStatus(), ob::PlaybackDevice::getPosition(), getSensor(), getSensorList(), getStructuredData(), getSupportedMultiDeviceSyncModeBitmap(), getSupportedProperty(), getSupportedPropertyCount(), getTimestampResetConfig(), isExtensionInfoExist(), isFrameInterleaveSupported(), isGlobalTimestampSupported(), isPropertySupported(), loadFrameInterleave(), loadPreset(), loadPresetFromJsonData(), loadPresetFromJsonFile(), operator=(), ob::PlaybackDevice::pause(), ob::PlaybackDevice::PlaybackDevice(), readCustomerData(), reboot(), ob::PlaybackDevice::resume(), ob::PlaybackDevice::seek(), sendAndReceiveData(), setBoolProperty(), setDeviceStateChangedCallback(), setFloatProperty(), setIntProperty(), setMultiDeviceSyncConfig(), ob::PlaybackDevice::setPlaybackRate(), ob::PlaybackDevice::setPlaybackStatusChangeCallback(), setStructuredData(), setTimestampResetConfig(), switchDepthWorkMode(), switchDepthWorkMode(), timerSyncWithHost(), timestampReset(), triggerCapture(), updateFirmware(), updateFirmwareFromData(), updateOptionalDepthPresets(), writeCustomerData(), and ~Device().
|
protected |
Definition at line 56 of file Device.hpp.
Referenced by setDeviceStateChangedCallback().
|
protected |
Definition at line 57 of file Device.hpp.
Referenced by updateFirmware(), updateFirmwareFromData(), and updateOptionalDepthPresets().