OrbbecSDK  1.5.7
OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices
Functions
Context.h File Reference

Context is a management class that describes the runtime of the SDK and is responsible for resource application and release of the SDK. Context has the ability to manage multiple devices. It is responsible for enumerating devices, monitoring device callbacks, and enabling multi device synchronization. More...

#include "ObTypes.h"

Go to the source code of this file.

Functions

ob_contextob_create_context (ob_error **error)
 create context api More...
 
ob_contextob_create_context_with_config (const char *config_path, ob_error **error)
 create context with config More...
 
void ob_delete_context (ob_context *context, ob_error **error)
 Delete context. More...
 
ob_device_listob_query_device_list (ob_context *context, ob_error **error)
 Get the list of enumerated devices. More...
 
ob_deviceob_create_net_device (ob_context *context, const char *address, uint16_t port, ob_error **error)
 创建网络设备 More...
 
void ob_set_device_changed_callback (ob_context *context, ob_device_changed_callback callback, void *user_data, ob_error **error)
 Set device plug-in callback function. More...
 
void ob_enable_multi_device_sync (ob_context *context, uint64_t repeatInterval, ob_error **error)
 Activate the multi-device synchronization function to synchronize the clock of the created device(the device needs to support this function) More...
 
void ob_set_logger_severity (ob_log_severity severity, ob_error **error)
 Set the global log level and this will affect both the log level output to the console and the log output to the file. More...
 
void ob_set_logger_to_file (ob_log_severity severity, const char *directory, ob_error **error)
 Set output log to file. More...
 
void ob_set_logger_to_console (ob_log_severity severity, ob_error **error)
 Set the output log to the console. More...
 

Detailed Description

Context is a management class that describes the runtime of the SDK and is responsible for resource application and release of the SDK. Context has the ability to manage multiple devices. It is responsible for enumerating devices, monitoring device callbacks, and enabling multi device synchronization.

Definition in file Context.h.

Function Documentation

ob_context* ob_create_context ( ob_error **  error)

create context api

Parameters
[out]errorrecord the error information
Returns
ob_context* return the context that created
ob_context* ob_create_context_with_config ( const char *  config_path,
ob_error **  error 
)

create context with config

Parameters
[in]config_pathConfigure the path of the file, and return null if the default path is used.
[out]errorLog error messages
Returns
ob_context* returns the context
void ob_delete_context ( ob_context context,
ob_error **  error 
)

Delete context.

Parameters
[in]contextThe context to delete
[out]errorLog error messages
ob_device_list* ob_query_device_list ( ob_context context,
ob_error **  error 
)

Get the list of enumerated devices.

Parameters
[in]contextContext
[out]errorLog error messages
Returns
ob_device_list* return device list object
ob_device* ob_create_net_device ( ob_context context,
const char *  address,
uint16_t  port,
ob_error **  error 
)

创建网络设备

Parameters
[in]context上下文环境
[in]address设备ip地址
[in]port设备端口
[out]error记录错误信息
Returns
[out] ob_device* 返回设备对象
void ob_set_device_changed_callback ( ob_context context,
ob_device_changed_callback  callback,
void *  user_data,
ob_error **  error 
)

Set device plug-in callback function.

Attention
The added and removed device list returned through the callback interface need to be released manually
Parameters
[in]contextContext
[in]callbackCallback triggered when the device is plugged and unplugged
[in]user_dataYou can pass in any user data and get it from the callback
[out]errorLog error messages
void ob_enable_multi_device_sync ( ob_context context,
uint64_t  repeatInterval,
ob_error **  error 
)

Activate the multi-device synchronization function to synchronize the clock of the created device(the device needs to support this function)

Parameters
[in]contextContext
[in]repeatIntervalsynchronization time interval (unit: ms; if repeatInterval=0, itmeans that it will only be synchronized once and will not be executedregularly)
[out]errorLog error messages
void ob_set_logger_severity ( ob_log_severity  severity,
ob_error **  error 
)

Set the global log level and this will affect both the log level output to the console and the log output to the file.

Parameters
[in]severityOutput log level
[out]errorLog error messages
void ob_set_logger_to_file ( ob_log_severity  severity,
const char *  directory,
ob_error **  error 
)

Set output log to file.

Parameters
[in]severitylog level output to file
[in]directoryThe log file output path. If the path is empty, the existing settings will continue to be used (if the existing configuration is also empty, the log will not be output to the file)
[out]errorLog error messages
void ob_set_logger_to_console ( ob_log_severity  severity,
ob_error **  error 
)

Set the output log to the console.

/**

Parameters
[in]logLog level
[out]errorLog error messages