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

- 首页
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

Device.hpp
浏览该文件的文档.
1
11 #pragma once
12 #include "Types.hpp"
13
14 #include "libobsensor/h/Property.h"
15
16 #include <memory>
17 #include <string>
18 #include <vector>
19
20 struct DeviceImpl;
21 struct DeviceInfoImpl;
22 struct DeviceListImpl;
23 struct CameraParamListImpl;
24
25 namespace ob {
26 class SensorList;
27 class Context;
28 class DeviceInfo;
29 class Sensor;
30 class CameraParamList;
31 class OBDepthWorkModeList;
32
33 class OB_EXTENSION_API Device {
34 private:
35 std::unique_ptr<DeviceImpl> impl_;
36
37 public:
45 Device(std::unique_ptr<DeviceImpl> impl);
46 virtual ~Device() noexcept;
58 std::shared_ptr<DeviceInfo> getDeviceInfo();
59
71 std::shared_ptr<SensorList> getSensorList();
72
86 std::shared_ptr<Sensor> getSensor(OBSensorType type);
100 void setIntProperty(OBPropertyID propertyId, int32_t property);
101
115 void setFloatProperty(OBPropertyID propertyId, float property);
116
130 void setBoolProperty(OBPropertyID propertyId, bool property);
131
145 int32_t getIntProperty(OBPropertyID propertyId);
146
160 float getFloatProperty(OBPropertyID propertyId);
161
175 bool getBoolProperty(OBPropertyID propertyId);
176
190 OBIntPropertyRange getIntPropertyRange(OBPropertyID propertyId);
191
205 OBFloatPropertyRange getFloatPropertyRange(OBPropertyID propertyId);
206
220 OBBoolPropertyRange getBoolPropertyRange(OBPropertyID propertyId);
221
237 void writeAHB(uint32_t reg, uint32_t mask, uint32_t value);
238
254 void readAHB(uint32_t reg, uint32_t mask, uint32_t *value);
255
273 void writeI2C(uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t value);
274
292 void readI2C(uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t *value);
293
313 void writeFlash(uint32_t offset, const void *data, uint32_t dataSize, SetDataCallback callback, bool async = false);
314
334 void readFlash(uint32_t offset, uint32_t dataSize, GetDataCallback callback, bool async = false);
335
355 void setRawData(OBPropertyID propertyId, const void *data, uint32_t dataSize, SetDataCallback callback, bool async = false);
356
376 void getRawData(OBPropertyID propertyId, GetDataCallback callback, bool async = false);
377
393 void setStructuredData(OBPropertyID propertyId, const void *data, uint32_t dataSize);
394
410 void getStructuredData(OBPropertyID propertyId, void *data, uint32_t *dataSize);
411
427 void setStructuredDataExt(OBPropertyID propertyId, std::shared_ptr<OBDataBundle> dataBundle, SetDataCallback callback);
428
442 std::shared_ptr<OBDataBundle> getStructuredDataExt(OBPropertyID propertyId);
443
455 OBProtocolVersion getProtocolVersion();
456
470 OBCmdVersion getCmdVersion(OBPropertyID propertyId);
471
483 uint32_t getSupportedPropertyCount();
484
498 OBPropertyItem getSupportedProperty(uint32_t index);
499
515 bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission);
516
526 uint64_t syncDeviceTime();
527
543 void deviceUpgrade(const char *filePath, DeviceUpgradeCallback callback, bool async = true);
544
562 void sendFile(const char *filePath, const char *dstPath, SendFileCallback callback, bool async = true);
563
573 OBDeviceState getDeviceState();
574
586 void setDeviceStateChangedCallback(DeviceStateChangedCallback callback);
587
599 bool activateAuthorization(const char *authCode);
600
610 void writeAuthorizationCode(const char *authCodeStr);
611
626 std::shared_ptr<CameraParamList> getCalibrationCameraParamList();
627
639 OBDepthWorkMode getCurrentDepthWorkMode();
640
654 OBStatus switchDepthWorkMode(const OBDepthWorkMode &workMode);
655
669 OBStatus switchDepthWorkMode(const char *modeName);
670
681 std::shared_ptr<OBDepthWorkModeList> getDepthWorkModeList();
682
694 void reboot();
695
702 OBDeviceSyncConfig getSyncConfig();
703
712 void setSyncConfig(const OBDeviceSyncConfig &deviceSyncConfig);
713
714 friend class Pipeline;
715 friend class Recorder;
716 };
717
726 class OB_EXTENSION_API DeviceInfo {
727 private:
728 std::unique_ptr<DeviceInfoImpl> impl_;
729
730 public:
731 DeviceInfo(std::unique_ptr<DeviceInfoImpl> impl);
732 virtual ~DeviceInfo() noexcept;
744 const char *name();
745
757 int pid();
758
770 int vid();
771
783 const char *uid();
784
796 const char *serialNumber();
797
809 const char *firmwareVersion();
810
822 DEPRECATED const char *usbType();
823
835 const char *connectionType();
836
848 const char *hardwareVersion();
849
861 const char *supportedMinSdkVersion();
862
874 const char *asicName();
875
887 OBDeviceType deviceType();
888
889 friend class Context;
890 friend class DeviceList;
891 friend class Pipeline;
892 };
893
894 class OB_EXTENSION_API DeviceList {
895 private:
896 std::unique_ptr<DeviceListImpl> impl_;
897
898 public:
899 DeviceList(std::unique_ptr<DeviceListImpl> impl);
900 ~DeviceList() noexcept;
901
913 uint32_t deviceCount();
914
928 DEPRECATED const char *name(uint32_t index);
929
943 int pid(uint32_t index);
944
958 int vid(uint32_t index);
959
973 const char *uid(uint32_t index);
974
988 const char *serialNumber(uint32_t index);
989
1003 std::shared_ptr<Device> getDevice(uint32_t index);
1004
1018 std::shared_ptr<Device> getDeviceBySN(const char *serialNumber);
1019
1033 std::shared_ptr<Device> getDeviceByUid(const char *uid);
1034 };
1035
1036 class OB_EXTENSION_API CameraParamList {
1037 private:
1038 std::unique_ptr<CameraParamListImpl> impl_;
1039
1040 public:
1041 CameraParamList(std::unique_ptr<CameraParamListImpl> impl);
1042 ~CameraParamList() noexcept;
1054 uint32_t count();
1055
1069 OBCameraParam getCameraParam(uint32_t index);
1070 };
1071
1080 class OB_EXTENSION_API OBDepthWorkModeList {
1081 private:
1082 std::unique_ptr<OBDepthWorkModeListImpl> impl_;
1083
1084 public:
1085 OBDepthWorkModeList(std::unique_ptr<OBDepthWorkModeListImpl> impl_);
1086 ~OBDepthWorkModeList();
1098 uint32_t count();
1099
1114 OBDepthWorkMode getOBDepthWorkMode(uint32_t index);
1115
1128 std::string getName(uint32_t index);
1129
1144 OBDepthWorkMode operator[](uint32_t index);
1145 };
1146
1147 } // namespace ob
OBStatus
OBStatus
错误码
Definition: ObTypes.h:86
DEPRECATED
#define DEPRECATED
Definition: ObTypes.h:35
ob::Recorder
Definition: RecordPlayback.hpp:27
OBFloatPropertyRange
浮点型范围的结构体
Definition: ObTypes.h:358
Property.h
控制命令属性列表维护
ob::OBDepthWorkModeList
相机深度模式列表
Definition: Device.hpp:1080
OBProtocolVersion
控制命令协议版本号
Definition: ObTypes.h:1083
ob::CameraParamList
Definition: Device.hpp:1036
SetDataCallback
std::function< void(OBDataTranState state, uint8_t percent)> SetDataCallback
设置raw data属性数据时进度回调
Definition: Types.hpp:95
SendFileCallback
std::function< void(OBFileTranState state, const char *message, uint8_t percent)> SendFileCallback
文件传输回调
Definition: Types.hpp:35
ob
Definition: Context.hpp:20
ob::Device
Definition: Device.hpp:33
DeviceUpgradeCallback
std::function< void(OBUpgradeState state, const char *message, uint8_t percent)> DeviceUpgradeCallback
设备升级回调
Definition: Types.hpp:50
OBPropertyID
OBPropertyID
描述设备所有的属性控制命令的枚举值
Definition: Property.h:33
OBCmdVersion
enum OB_CMD_VERSION OBCmdVersion
OBPermissionType
OBPermissionType
接口 / 属性的访问权限类型
Definition: ObTypes.h:71
OBSensorType
OBSensorType
描述传感器类型的枚举值
Definition: ObTypes.h:159
OBCameraParam
相机参数
Definition: ObTypes.h:434
Types.hpp
提供SDK的结构体、枚举常量定义（依赖libobsensor/h/ObTypes.h）
DeviceStateChangedCallback
std::function< void(OBDeviceState state, const char *message)> DeviceStateChangedCallback
设备状态回调
Definition: Types.hpp:65
OBDeviceType
OBDeviceType
设备类型枚举
Definition: ObTypes.h:668
GetDataCallback
std::function< void(OBDataTranState state, OBDataChunk *dataChunk)> GetDataCallback
获取raw data属性数据时数据及进度回调
Definition: Types.hpp:80
OBDepthWorkMode
相机深度工作模式
Definition: ObTypes.h:1070
ob::DeviceInfo
描述设备信息的类，代表一个RGBD相机的名称，id，序列号等其他设备自身基本信息。
Definition: Device.hpp:726
OBPropertyItem
用于描述每一个属性的特性
Definition: Property.h:189
ob::DeviceList
Definition: Device.hpp:894
ob::Pipeline
Definition: Pipeline.hpp:32
ob::Context
Definition: Context.hpp:25
OBBoolPropertyRange
布尔型范围的结构体
Definition: ObTypes.h:373
OBDeviceState
uint64_t OBDeviceState
设备状态码
Definition: ObTypes.h:624
OBDeviceSyncConfig
设备同步配置
Definition: ObTypes.h:959
OB_EXTENSION_API
#define OB_EXTENSION_API
Definition: ObTypes.h:25
OBIntPropertyRange
整形范围的结构体
Definition: ObTypes.h:343