OrbbecSDK 2.5.5
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
Device.hpp
Go to the documentation of this file.
1// Copyright (c) Orbbec Inc. All Rights Reserved.
2// Licensed under the MIT License.
3
9#pragma once
10#include "Types.hpp"
11
17
18#include "Error.hpp"
19#include <memory>
20#include <string>
21#include <vector>
22#include <thread>
23#include <chrono>
24
25namespace ob {
26
27class DeviceInfo;
28class SensorList;
31class CameraParamList;
34
35class Device {
36public:
44 typedef std::function<void(OBFwUpdateState state, const char *message, uint8_t percent)> DeviceFwUpdateCallback;
45
52 typedef std::function<void(OBDeviceState state, const char *message)> DeviceStateChangedCallback;
53
54protected:
55 ob_device *impl_ = nullptr;
58
59public:
63 explicit Device(ob_device_t *impl) : impl_(impl) {}
64
65 Device(Device &&other) noexcept : impl_(other.impl_) {
66 other.impl_ = nullptr;
67 }
68
69 Device &operator=(Device &&other) noexcept {
70 if(this != &other) {
71 ob_error *error = nullptr;
72 ob_delete_device(impl_, &error);
73 Error::handle(&error);
74 impl_ = other.impl_;
75 other.impl_ = nullptr;
76 }
77 return *this;
78 }
79
80 Device(const Device &) = delete;
81 Device &operator=(const Device &) = delete;
82
83 virtual ~Device() noexcept {
84 ob_error *error = nullptr;
85 ob_delete_device(impl_, &error);
86 Error::handle(&error, false);
87 }
88
89 ob_device_t *getImpl() const {
90 return impl_;
91 }
92
98 std::shared_ptr<DeviceInfo> getDeviceInfo() const {
99 ob_error *error = nullptr;
100 auto info = ob_device_get_device_info(impl_, &error);
101 Error::handle(&error);
102 return std::make_shared<DeviceInfo>(info);
103 }
104
111 bool isExtensionInfoExist(const std::string &infoKey) const {
112 ob_error *error = nullptr;
113 auto exist = ob_device_is_extension_info_exist(impl_, infoKey.c_str(), &error);
114 Error::handle(&error);
115 return exist;
116 }
117
124 const char *getExtensionInfo(const std::string &infoKey) const {
125 ob_error *error = nullptr;
126 const char *info = ob_device_get_extension_info(impl_, infoKey.c_str(), &error);
127 Error::handle(&error);
128 return info;
129 }
130
136 std::shared_ptr<SensorList> getSensorList() const {
137 ob_error *error = nullptr;
138 auto list = ob_device_get_sensor_list(impl_, &error);
139 Error::handle(&error);
140 return std::make_shared<SensorList>(list);
141 }
142
149 std::shared_ptr<Sensor> getSensor(OBSensorType type) const {
150 ob_error *error = nullptr;
151 auto sensor = ob_device_get_sensor(impl_, type, &error);
152 Error::handle(&error);
153 return std::make_shared<Sensor>(sensor);
154 }
155
162 void setIntProperty(OBPropertyID propertyId, int32_t value) const {
163 ob_error *error = nullptr;
164 ob_device_set_int_property(impl_, propertyId, value, &error);
165 Error::handle(&error);
166 }
167
174 void setFloatProperty(OBPropertyID propertyId, float value) const {
175 ob_error *error = nullptr;
176 ob_device_set_float_property(impl_, propertyId, value, &error);
177 Error::handle(&error);
178 }
179
186 void setBoolProperty(OBPropertyID propertyId, bool value) const {
187 ob_error *error = nullptr;
188 ob_device_set_bool_property(impl_, propertyId, value, &error);
189 Error::handle(&error);
190 }
191
198 int32_t getIntProperty(OBPropertyID propertyId) const {
199 ob_error *error = nullptr;
200 auto value = ob_device_get_int_property(impl_, propertyId, &error);
201 Error::handle(&error);
202 return value;
203 }
204
211 float getFloatProperty(OBPropertyID propertyId) const {
212 ob_error *error = nullptr;
213 auto value = ob_device_get_float_property(impl_, propertyId, &error);
214 Error::handle(&error);
215 return value;
216 }
217
224 bool getBoolProperty(OBPropertyID propertyId) const {
225 ob_error *error = nullptr;
226 auto value = ob_device_get_bool_property(impl_, propertyId, &error);
227 Error::handle(&error);
228 return value;
229 }
230
238 ob_error *error = nullptr;
239 auto range = ob_device_get_int_property_range(impl_, propertyId, &error);
240 Error::handle(&error);
241 return range;
242 }
243
251 ob_error *error = nullptr;
252 auto range = ob_device_get_float_property_range(impl_, propertyId, &error);
253 Error::handle(&error);
254 return range;
255 }
256
264 ob_error *error = nullptr;
265 auto range = ob_device_get_bool_property_range(impl_, propertyId, &error);
266 Error::handle(&error);
267 return range;
268 }
269
277 void setStructuredData(OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const {
278 ob_error *error = nullptr;
279 ob_device_set_structured_data(impl_, propertyId, data, dataSize, &error);
280 Error::handle(&error);
281 }
282
290 void getStructuredData(OBPropertyID propertyId, uint8_t *data, uint32_t *dataSize) const {
291 ob_error *error = nullptr;
292 ob_device_get_structured_data(impl_, propertyId, data, dataSize, &error);
293 Error::handle(&error);
294 }
295
302 void writeCustomerData(const void *data, uint32_t dataSize) {
303 ob_error *error = nullptr;
304 ob_device_write_customer_data(impl_, data, dataSize, &error);
305 Error::handle(&error);
306 }
307
314 void readCustomerData(void *data, uint32_t *dataSize) {
315 ob_error *error = nullptr;
316 ob_device_read_customer_data(impl_, data, dataSize, &error);
317 Error::handle(&error);
318 }
319
326 ob_error *error = nullptr;
327 auto count = ob_device_get_supported_property_count(impl_, &error);
328 Error::handle(&error);
329 return count;
330 }
331
338 OBPropertyItem getSupportedProperty(uint32_t index) const {
339 ob_error *error = nullptr;
340 auto item = ob_device_get_supported_property_item(impl_, index, &error);
341 Error::handle(&error);
342 return item;
343 }
344
352 bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission) const {
353 ob_error *error = nullptr;
354 auto result = ob_device_is_property_supported(impl_, propertyId, permission, &error);
355 Error::handle(&error);
356 return result;
357 }
358
365 ob_error *error = nullptr;
366 auto result = ob_device_is_global_timestamp_supported(impl_, &error);
367 Error::handle(&error);
368 return result;
369 }
370
376 void enableGlobalTimestamp(bool enable) {
377 ob_error *error = nullptr;
379 Error::handle(&error);
380 }
381
389 void updateFirmware(const char *filePath, DeviceFwUpdateCallback callback, bool async = true) {
390 ob_error *error = nullptr;
391 fwUpdateCallback_ = callback;
392 ob_device_update_firmware(impl_, filePath, &Device::firmwareUpdateCallback, async, this, &error);
393 Error::handle(&error);
394 }
395
404 void updateFirmwareFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async = true) {
405 ob_error *error = nullptr;
406 fwUpdateCallback_ = callback;
407 ob_device_update_firmware_from_data(impl_, firmwareData, firmwareDataSize, &Device::firmwareUpdateCallback, async, this, &error);
408 Error::handle(&error);
409 }
410
418 void updateOptionalDepthPresets(const char filePathList[][OB_PATH_MAX], uint8_t pathCount, DeviceFwUpdateCallback callback) {
419 ob_error *error = nullptr;
420 fwUpdateCallback_ = callback;
421 ob_device_update_optional_depth_presets(impl_, filePathList, pathCount, &Device::firmwareUpdateCallback, this, &error);
422 Error::handle(&error);
423 }
424
437
438 static void deviceStateChangedCallback(OBDeviceState state, const char *message, void *userData) {
439 auto device = static_cast<Device *>(userData);
440 device->deviceStateChangeCallback_(state, message);
441 }
442
449 ob_error *error = nullptr;
450 auto mode = ob_device_get_current_depth_work_mode(impl_, &error);
451 Error::handle(&error);
452 return mode;
453 }
454
461 ob_error *error = nullptr;
463 Error::handle(&error);
464 return name;
465 }
466
473 ob_error *error = nullptr;
474 auto status = ob_device_switch_depth_work_mode(impl_, &workMode, &error);
475 Error::handle(&error);
476 return status;
477 }
478
484 OBStatus switchDepthWorkMode(const char *modeName) const {
485 ob_error *error = nullptr;
486 auto status = ob_device_switch_depth_work_mode_by_name(impl_, modeName, &error);
487 Error::handle(&error);
488 return status;
489 }
490
495 std::shared_ptr<OBDepthWorkModeList> getDepthWorkModeList() const {
496 ob_error *error = nullptr;
497 auto list = ob_device_get_depth_work_mode_list(impl_, &error);
498 Error::handle(&error);
499 return std::make_shared<OBDepthWorkModeList>(list);
500 }
501
507 void reboot() const {
508 ob_error *error = nullptr;
509 ob_device_reboot(impl_, &error);
510 Error::handle(&error);
511 }
512
521 void reboot(uint32_t delayMs) const {
523 reboot();
524 }
525
534 void enableHeartbeat(bool enable) const {
535 ob_error *error = nullptr;
536 ob_device_enable_heartbeat(impl_, enable, &error);
537 Error::handle(&error);
538 }
539
556 ob_error *error = nullptr;
558 Error::handle(&error);
559 return mode;
560 }
561
568 ob_error *error = nullptr;
570 Error::handle(&error);
571 }
572
579 ob_error *error = nullptr;
580 auto config = ob_device_get_multi_device_sync_config(impl_, &error);
581 Error::handle(&error);
582 return config;
583 }
584
596 void triggerCapture() const {
597 ob_error *error = nullptr;
599 Error::handle(&error);
600 }
601
606 ob_error *error = nullptr;
608 Error::handle(&error);
609 }
610
617 ob_error *error = nullptr;
618 auto config = ob_device_get_timestamp_reset_config(impl_, &error);
619 Error::handle(&error);
620 return config;
621 }
622
634 void timestampReset() const {
635 ob_error *error = nullptr;
637 Error::handle(&error);
638 }
639
643#define timerReset timestampReset
644
656 void timerSyncWithHost() const {
657 ob_error *error = nullptr;
659 Error::handle(&error);
660 }
661
667 const char *getCurrentPresetName() const {
668 ob_error *error = nullptr;
669 const char *name = ob_device_get_current_preset_name(impl_, &error);
670 Error::handle(&error);
671 return name;
672 }
673
680 void loadPreset(const char *presetName) const {
681 ob_error *error = nullptr;
682 ob_device_load_preset(impl_, presetName, &error);
683 Error::handle(&error);
684 }
685
693 std::shared_ptr<DevicePresetList> getAvailablePresetList() const {
694 ob_error *error = nullptr;
695 auto list = ob_device_get_available_preset_list(impl_, &error);
696 Error::handle(&error);
697 return std::make_shared<DevicePresetList>(list);
698 }
699
710 void loadPresetFromJsonFile(const char *filePath) const {
711 ob_error *error = nullptr;
713 Error::handle(&error);
714 }
715
727 void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size) {
728 ob_error *error = nullptr;
729 ob_device_load_preset_from_json_data(impl_, presetName, data, size, &error);
730 }
731
743 void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize) {
744 ob_error *error = nullptr;
745 ob_device_export_current_settings_as_preset_json_data(impl_, presetName, data, dataSize, &error);
746 }
747
755 void exportSettingsAsPresetJsonFile(const char *filePath) const {
756 ob_error *error = nullptr;
758 Error::handle(&error);
759 }
760
767 OBDeviceState state = {};
768 ob_error *error = nullptr;
769 state = ob_device_get_device_state(impl_, &error);
770 return state;
771 }
772
785 void sendAndReceiveData(const uint8_t *sendData, uint32_t sendDataSize, uint8_t *receiveData, uint32_t *receiveDataSize) const {
786 ob_error *error = nullptr;
787 ob_device_send_and_receive_data(impl_, sendData, sendDataSize, receiveData, receiveDataSize, &error);
788 Error::handle(&error);
789 }
790
797 ob_error *error = nullptr;
799 Error::handle(&error);
800 return ret;
801 }
802
808 void loadFrameInterleave(const char *frameInterleaveName) const {
809 ob_error *error = nullptr;
810 ob_device_load_frame_interleave(impl_, frameInterleaveName, &error);
811 Error::handle(&error);
812 }
813
819 std::shared_ptr<DeviceFrameInterleaveList> getAvailableFrameInterleaveList() const {
820 ob_error *error = nullptr;
822 Error::handle(&error);
823 return std::make_shared<DeviceFrameInterleaveList>(list);
824 }
825
831 std::shared_ptr<PresetResolutionConfigList> getAvailablePresetResolutionConfigList() const {
832 ob_error *error = nullptr;
834 Error::handle(&error);
835 return std::make_shared<PresetResolutionConfigList>(list);
836 }
837
838private:
839 static void firmwareUpdateCallback(ob_fw_update_state state, const char *message, uint8_t percent, void *userData) {
840 auto device = static_cast<Device *>(userData);
841 if(device && device->fwUpdateCallback_) {
842 device->fwUpdateCallback_(state, message, percent);
843 }
844 }
845
846public:
847 // The following interfaces are deprecated and are retained here for compatibility purposes.
848 void deviceUpgrade(const char *filePath, DeviceFwUpdateCallback callback, bool async = true) {
849 updateFirmware(filePath, callback, async);
850 }
851
852 void deviceUpgradeFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async = true) {
853 updateFirmwareFromData(firmwareData, firmwareDataSize, callback, async);
854 }
855
856 std::shared_ptr<CameraParamList> getCalibrationCameraParamList() {
857 ob_error *error = nullptr;
859 Error::handle(&error);
860 return std::make_shared<CameraParamList>(impl);
861 }
862
863 void loadDepthFilterConfig(const char *filePath) {
864 // In order to compile, some high-version compilers will warn that the function parameters are not used.
865 (void)filePath;
866 }
867};
868
873private:
874 ob_device_info_t *impl_ = nullptr;
875
876public:
877 explicit DeviceInfo(ob_device_info_t *impl) : impl_(impl) {}
878 ~DeviceInfo() noexcept {
879 ob_error *error = nullptr;
880 ob_delete_device_info(impl_, &error);
881 Error::handle(&error, false);
882 }
883
889 const char *getName() const {
890 ob_error *error = nullptr;
891 const char *name = ob_device_info_get_name(impl_, &error);
892 Error::handle(&error);
893 return name;
894 }
895
901 int getPid() const {
902 ob_error *error = nullptr;
903 int pid = ob_device_info_get_pid(impl_, &error);
904 Error::handle(&error);
905 return pid;
906 }
907
913 int getVid() const {
914 ob_error *error = nullptr;
915 int vid = ob_device_info_get_vid(impl_, &error);
916 Error::handle(&error);
917 return vid;
918 }
919
925 const char *getUid() const {
926 ob_error *error = nullptr;
927 const char *uid = ob_device_info_get_uid(impl_, &error);
928 Error::handle(&error);
929 return uid;
930 }
931
937 const char *getSerialNumber() const {
938 ob_error *error = nullptr;
939 const char *sn = ob_device_info_get_serial_number(impl_, &error);
940 Error::handle(&error);
941 return sn;
942 }
943
949 const char *getFirmwareVersion() const {
950 ob_error *error = nullptr;
951 const char *version = ob_device_info_get_firmware_version(impl_, &error);
952 Error::handle(&error);
953 return version;
954 }
955
962 const char *getConnectionType() const {
963 ob_error *error = nullptr;
964 const char *type = ob_device_info_get_connection_type(impl_, &error);
965 Error::handle(&error);
966 return type;
967 }
968
976 const char *getIpAddress() const {
977 ob_error *error = nullptr;
978 const char *ip = ob_device_info_get_ip_address(impl_, &error);
979 Error::handle(&error);
980 return ip;
981 }
982
988 const char *getHardwareVersion() const {
989 ob_error *error = nullptr;
990 const char *version = ob_device_info_get_hardware_version(impl_, &error);
991 Error::handle(&error);
992 return version;
993 }
994
1000 const char *getSupportedMinSdkVersion() const {
1001 ob_error *error = nullptr;
1002 const char *version = ob_device_info_get_supported_min_sdk_version(impl_, &error);
1003 Error::handle(&error);
1004 return version;
1005 }
1006
1012 const char *getAsicName() const {
1013 ob_error *error = nullptr;
1014 const char *name = ob_device_info_get_asicName(impl_, &error);
1015 Error::handle(&error);
1016 return name;
1017 }
1018
1025 ob_error *error = nullptr;
1026 OBDeviceType type = ob_device_info_get_device_type(impl_, &error);
1027 Error::handle(&error);
1028 return type;
1029 }
1030
1036 const char *getDeviceSubnetMask() const {
1037 ob_error *error = nullptr;
1038 const char *subnetMask = ob_device_info_get_subnet_mask(impl_, &error);
1039 Error::handle(&error);
1040 return subnetMask;
1041 }
1042
1048 const char *getDevicegateway() const {
1049 ob_error *error = nullptr;
1050 const char *subnetMask = ob_device_info_get_gateway(impl_, &error);
1051 Error::handle(&error);
1052 return subnetMask;
1053 }
1054
1055public:
1056 // The following interfaces are deprecated and are retained here for compatibility purposes.
1057 const char *name() const {
1058 return getName();
1059 }
1060
1061 int pid() const {
1062 return getPid();
1063 }
1064
1065 int vid() const {
1066 return getVid();
1067 }
1068
1069 const char *uid() const {
1070 return getUid();
1071 }
1072
1073 const char *serialNumber() const {
1074 return getSerialNumber();
1075 }
1076
1077 const char *firmwareVersion() const {
1078 return getFirmwareVersion();
1079 }
1080
1081 const char *connectionType() const {
1082 return getConnectionType();
1083 }
1084
1085 const char *ipAddress() const {
1086 return getIpAddress();
1087 }
1088
1089 const char *hardwareVersion() const {
1090 return getHardwareVersion();
1091 }
1092
1093 const char *supportedMinSdkVersion() const {
1095 }
1096
1097 const char *asicName() const {
1098 return getAsicName();
1099 }
1100
1102 return getDeviceType();
1103 }
1104};
1105
1110private:
1111 ob_device_list_t *impl_ = nullptr;
1112
1113public:
1114 explicit DeviceList(ob_device_list_t *impl) : impl_(impl) {}
1115 ~DeviceList() noexcept {
1116 ob_error *error = nullptr;
1117 ob_delete_device_list(impl_, &error);
1118 Error::handle(&error, false);
1119 }
1120
1126 uint32_t getCount() const {
1127 ob_error *error = nullptr;
1128 auto count = ob_device_list_get_count(impl_, &error);
1129 Error::handle(&error);
1130 return count;
1131 }
1132
1139 int getPid(uint32_t index) const {
1140 ob_error *error = nullptr;
1141 auto pid = ob_device_list_get_device_pid(impl_, index, &error);
1142 Error::handle(&error);
1143 return pid;
1144 }
1145
1152 int getVid(uint32_t index) const {
1153 ob_error *error = nullptr;
1154 auto vid = ob_device_list_get_device_vid(impl_, index, &error);
1155 Error::handle(&error);
1156 return vid;
1157 }
1158
1165 const char *getUid(uint32_t index) const {
1166 ob_error *error = nullptr;
1167 auto uid = ob_device_list_get_device_uid(impl_, index, &error);
1168 Error::handle(&error);
1169 return uid;
1170 }
1171
1178 const char *getSerialNumber(uint32_t index) const {
1179 ob_error *error = nullptr;
1180 auto sn = ob_device_list_get_device_serial_number(impl_, index, &error);
1181 Error::handle(&error);
1182 return sn;
1183 }
1184
1194 const char *getName(uint32_t index) const {
1195 ob_error *error = nullptr;
1196 auto name = ob_device_list_get_device_name(impl_, index, &error);
1197 Error::handle(&error);
1198 return name;
1199 }
1200
1207 const char *getConnectionType(uint32_t index) const {
1208 ob_error *error = nullptr;
1209 auto type = ob_device_list_get_device_connection_type(impl_, index, &error);
1210 Error::handle(&error);
1211 return type;
1212 }
1213
1222 const char *getIpAddress(uint32_t index) const {
1223 ob_error *error = nullptr;
1224 auto ip = ob_device_list_get_device_ip_address(impl_, index, &error);
1225 Error::handle(&error);
1226 return ip;
1227 }
1228
1237 const char *getSubnetMask(uint32_t index) const {
1238 ob_error *error = nullptr;
1239 auto subnetMask = ob_device_list_get_device_subnet_mask(impl_, index, &error);
1240 Error::handle(&error);
1241 return subnetMask;
1242 }
1243
1252 const char *getGateway(uint32_t index) const {
1253 ob_error *error = nullptr;
1254 auto gateway = ob_device_list_get_device_gateway(impl_, index, &error);
1255 Error::handle(&error);
1256 return gateway;
1257 }
1258
1267 const char *getLocalMacAddress(uint32_t index) const {
1268 ob_error *error = nullptr;
1269 auto mac = ob_device_list_get_device_local_mac(impl_, index, &error);
1270 Error::handle(&error);
1271 return mac;
1272 }
1273
1282 const char *getLocalIP(uint32_t index) const {
1283 ob_error *error = nullptr;
1284 auto ip = ob_device_list_get_device_local_ip(impl_, index, &error);
1285 Error::handle(&error);
1286 return ip;
1287 }
1288
1297 uint8_t getLocalSubnetLength(uint32_t index) const {
1298 ob_error *error = nullptr;
1299 auto subnetMask = ob_device_list_get_device_local_subnet_length(impl_, index, &error);
1300 Error::handle(&error);
1301 return subnetMask;
1302 }
1303
1312 const char *getLocalGateway(uint32_t index) const {
1313 ob_error *error = nullptr;
1314 auto gateway = ob_device_list_get_device_local_gateway(impl_, index, &error);
1315 Error::handle(&error);
1316 return gateway;
1317 }
1318
1327 std::shared_ptr<Device> getDevice(uint32_t index) const {
1328 ob_error *error = nullptr;
1329 auto device = ob_device_list_get_device(impl_, index, &error);
1330 Error::handle(&error);
1331 return std::make_shared<Device>(device);
1332 }
1333
1342 std::shared_ptr<Device> getDeviceBySN(const char *serialNumber) const {
1343 ob_error *error = nullptr;
1344 auto device = ob_device_list_get_device_by_serial_number(impl_, serialNumber, &error);
1345 Error::handle(&error);
1346 return std::make_shared<Device>(device);
1347 }
1348
1361 std::shared_ptr<Device> getDeviceByUid(const char *uid) const {
1362 ob_error *error = nullptr;
1363 auto device = ob_device_list_get_device_by_uid(impl_, uid, &error);
1364 Error::handle(&error);
1365 return std::make_shared<Device>(device);
1366 }
1367
1368public:
1369 // The following interfaces are deprecated and are retained here for compatibility purposes.
1370 uint32_t deviceCount() const {
1371 return getCount();
1372 }
1373
1374 int pid(uint32_t index) const {
1375 return getPid(index);
1376 }
1377
1378 int vid(uint32_t index) const {
1379 return getVid(index);
1380 }
1381
1382 const char *uid(uint32_t index) const {
1383 return getUid(index);
1384 }
1385
1386 const char *serialNumber(uint32_t index) const {
1387 return getSerialNumber(index);
1388 }
1389
1390 const char *name(uint32_t index) const {
1391 return getName(index);
1392 }
1393
1394 const char *connectionType(uint32_t index) const {
1395 return getConnectionType(index);
1396 }
1397
1398 const char *ipAddress(uint32_t index) const {
1399 return getIpAddress(index);
1400 }
1401};
1402
1404private:
1405 ob_depth_work_mode_list_t *impl_ = nullptr;
1406
1407public:
1408 explicit OBDepthWorkModeList(ob_depth_work_mode_list_t *impl) : impl_(impl) {}
1410 ob_error *error = nullptr;
1411 ob_delete_depth_work_mode_list(impl_, &error);
1412 Error::handle(&error, false);
1413 }
1414
1420 uint32_t getCount() {
1421 ob_error *error = nullptr;
1422 auto count = ob_depth_work_mode_list_get_count(impl_, &error);
1423 Error::handle(&error);
1424 return count;
1425 }
1426
1434 ob_error *error = nullptr;
1435 auto mode = ob_depth_work_mode_list_get_item(impl_, index, &error);
1436 Error::handle(&error);
1437 return mode;
1438 }
1439
1446 OBDepthWorkMode operator[](uint32_t index) {
1447 return getOBDepthWorkMode(index);
1448 }
1449
1450public:
1451 // The following interfaces are deprecated and are retained here for compatibility purposes.
1452 uint32_t count() {
1453 return getCount();
1454 }
1455};
1456
1462private:
1463 ob_device_preset_list_t *impl_ = nullptr;
1464
1465public:
1466 explicit DevicePresetList(ob_device_preset_list_t *impl) : impl_(impl) {}
1468 ob_error *error = nullptr;
1469 ob_delete_preset_list(impl_, &error);
1470 Error::handle(&error, false);
1471 }
1472
1478 uint32_t getCount() {
1479 ob_error *error = nullptr;
1480 auto count = ob_device_preset_list_get_count(impl_, &error);
1481 Error::handle(&error);
1482 return count;
1483 }
1484
1491 const char *getName(uint32_t index) {
1492 ob_error *error = nullptr;
1493 const char *name = ob_device_preset_list_get_name(impl_, index, &error);
1494 Error::handle(&error);
1495 return name;
1496 }
1497
1503 bool hasPreset(const char *name) {
1504 ob_error *error = nullptr;
1505 auto result = ob_device_preset_list_has_preset(impl_, name, &error);
1506 Error::handle(&error);
1507 return result;
1508 }
1509
1510public:
1511 // The following interfaces are deprecated and are retained here for compatibility purposes.
1512 uint32_t count() {
1513 return getCount();
1514 }
1515};
1516
1521private:
1522 ob_camera_param_list_t *impl_ = nullptr;
1523
1524public:
1525 explicit CameraParamList(ob_camera_param_list_t *impl) : impl_(impl) {}
1526 ~CameraParamList() noexcept {
1527 ob_error *error = nullptr;
1528 ob_delete_camera_param_list(impl_, &error);
1529 Error::handle(&error, false);
1530 }
1531
1537 uint32_t getCount() {
1538 ob_error *error = nullptr;
1539 auto count = ob_camera_param_list_get_count(impl_, &error);
1540 Error::handle(&error);
1541 return count;
1542 }
1543
1551 ob_error *error = nullptr;
1552 auto param = ob_camera_param_list_get_param(impl_, index, &error);
1553 Error::handle(&error);
1554 return param;
1555 }
1556
1557public:
1558 // The following interfaces are deprecated and are retained here for compatibility purposes.
1559 uint32_t count() {
1560 return getCount();
1561 }
1562};
1563
1568private:
1569 ob_device_frame_interleave_list_t *impl_ = nullptr;
1570
1571public:
1572 explicit DeviceFrameInterleaveList(ob_device_frame_interleave_list_t *impl) : impl_(impl) {}
1574 ob_error *error = nullptr;
1575 ob_delete_frame_interleave_list(impl_, &error);
1576 Error::handle(&error, false);
1577 }
1578
1584 uint32_t getCount() {
1585 ob_error *error = nullptr;
1586 auto count = ob_device_frame_interleave_list_get_count(impl_, &error);
1587 Error::handle(&error);
1588 return count;
1589 }
1590
1597 const char *getName(uint32_t index) {
1598 ob_error *error = nullptr;
1599 const char *name = ob_device_frame_interleave_list_get_name(impl_, index, &error);
1600 Error::handle(&error);
1601 return name;
1602 }
1603
1609 bool hasFrameInterleave(const char *name) {
1610 ob_error *error = nullptr;
1611 auto result = ob_device_frame_interleave_list_has_frame_interleave(impl_, name, &error);
1612 Error::handle(&error);
1613 return result;
1614 }
1615};
1616
1621private:
1622 ob_preset_resolution_config_list_t *impl_ = nullptr;
1623
1624public:
1625 explicit PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl) : impl_(impl) {}
1627 ob_error *error = nullptr;
1629 Error::handle(&error, false);
1630 }
1631
1635 uint32_t getCount() {
1636 ob_error *error = nullptr;
1637 auto count = ob_device_preset_resolution_config_get_count(impl_, &error);
1638 Error::handle(&error);
1639 return count;
1640 }
1641
1642 /*
1643 * @brief Get the device preset resolution ratio at the specified index
1644 * @param index the index of the device preset resolution ratio
1645 * @return OBPresetResolutionConfig the corresponding device preset resolution ratio
1646 */
1648 ob_error *error = nullptr;
1649 auto config = ob_device_preset_resolution_config_list_get_item(impl_, index, &error);
1650 Error::handle(&error);
1651 return config;
1652 }
1653};
1654
1655} // namespace ob
OB_EXPORT const char * ob_device_get_current_preset_name(const ob_device *device, ob_error **error)
Get the current preset name.
OB_EXPORT bool ob_device_frame_interleave_list_has_frame_interleave(ob_device_frame_interleave_list *frame_interleave_list, const char *frame_interleave_name, ob_error **error)
Check if the interleave ae list has the interleave ae.
OB_EXPORT ob_status ob_device_switch_depth_work_mode(ob_device *device, const ob_depth_work_mode *work_mode, ob_error **error)
Switch the depth work mode by ob_depth_work_mode. Prefer to use ob_device_switch_depth_work_mode_by_n...
OB_EXPORT void ob_device_load_frame_interleave(ob_device *device, const char *frame_interleave_name, ob_error **error)
load the frame interleave mode according to frame interleavee name.
OB_EXPORT ob_depth_work_mode_list * ob_device_get_depth_work_mode_list(const ob_device *device, ob_error **error)
Request the list of supported depth work modes.
OB_EXPORT ob_preset_resolution_config_list * ob_device_get_available_preset_resolution_config_list(ob_device *device, ob_error **error)
OB_EXPORT uint32_t ob_device_preset_list_get_count(const ob_device_preset_list *preset_list, ob_error **error)
Get the number of preset in the preset list.
OB_EXPORT void ob_device_export_current_settings_as_preset_json_data(ob_device *device, const char *presetName, const uint8_t **data, uint32_t *dataSize, ob_error **error)
Export current device settings as a preset json data.
OB_EXPORT void ob_device_load_preset_from_json_file(ob_device *device, const char *json_file_path, ob_error **error)
Load preset from json string.
OB_EXPORT void ob_delete_preset_list(ob_device_preset_list *preset_list, ob_error **error)
Delete the available preset list.
OB_EXPORT void ob_device_export_current_settings_as_preset_json_file(ob_device *device, const char *json_file_path, ob_error **error)
Export current settings as a preset json file.
OB_EXPORT const char * ob_device_frame_interleave_list_get_name(ob_device_frame_interleave_list *frame_interleave_list, uint32_t index, ob_error **error)
Get the name of frame interleave in the frame interleave list.
OB_EXPORT ob_device_frame_interleave_list * ob_device_get_available_frame_interleave_list(ob_device *device, ob_error **error)
Get the available frame interleave list.
OB_EXPORT const char * ob_device_get_current_depth_work_mode_name(const ob_device *device, ob_error **error)
Get current depth mode name.
OB_EXPORT void ob_device_load_preset(ob_device *device, const char *preset_name, ob_error **error)
Get the available preset list.
OB_EXPORT bool ob_device_preset_list_has_preset(const ob_device_preset_list *preset_list, const char *preset_name, ob_error **error)
Check if the preset list has the preset.
OB_EXPORT uint32_t ob_device_frame_interleave_list_get_count(ob_device_frame_interleave_list *frame_interleave_list, ob_error **error)
Get the number of frame interleave in the frame interleave list.
OB_EXPORT OBPresetResolutionConfig ob_device_preset_resolution_config_list_get_item(const ob_preset_resolution_config_list *ob_preset_resolution_config_list, uint32_t index, ob_error **error)
Get the preset resolution in the preset resolution list.
OB_EXPORT ob_depth_work_mode ob_device_get_current_depth_work_mode(const ob_device *device, ob_error **error)
Get the current depth work mode.
OB_EXPORT bool ob_device_is_frame_interleave_supported(const ob_device *device, ob_error **error)
Check if the device supports the frame interleave feature.
OB_EXPORT void ob_delete_preset_resolution_config_list(ob_preset_resolution_config_list *ob_preset_resolution_config_list, ob_error **error)
Delete the available preset resolution list.
OB_EXPORT void ob_delete_frame_interleave_list(ob_device_frame_interleave_list *frame_interleave_list, ob_error **error)
Delete the available frame interleave list.
OB_EXPORT void ob_device_load_preset_from_json_data(ob_device *device, const char *presetName, const uint8_t *data, uint32_t size, ob_error **error)
Load custom preset from data.
OB_EXPORT uint32_t ob_depth_work_mode_list_get_count(const ob_depth_work_mode_list *work_mode_list, ob_error **error)
OB_EXPORT ob_depth_work_mode ob_depth_work_mode_list_get_item(const ob_depth_work_mode_list *work_mode_list, uint32_t index, ob_error **error)
Get the index target of ob_depth_work_mode from work_mode_list.
OB_EXPORT ob_status ob_device_switch_depth_work_mode_by_name(ob_device *device, const char *mode_name, ob_error **error)
Switch the depth work mode by work mode name.
OB_EXPORT void ob_delete_depth_work_mode_list(ob_depth_work_mode_list *work_mode_list, ob_error **error)
Free the resources of ob_depth_work_mode_list.
OB_EXPORT const char * ob_device_preset_list_get_name(const ob_device_preset_list *preset_list, uint32_t index, ob_error **error)
Get the name of the preset in the preset list.
OB_EXPORT ob_device_preset_list * ob_device_get_available_preset_list(const ob_device *device, ob_error **error)
Get the available preset list.
OB_EXPORT uint32_t ob_device_preset_resolution_config_get_count(ob_preset_resolution_config_list *ob_preset_resolution_config_list, ob_error **error)
Device-related functions, including operations such as obtaining and creating a device,...
OB_EXPORT const char * ob_device_list_get_device_local_ip(const ob_device_list *list, uint32_t index, ob_error **error)
Get the IP address of the host network interface corresponding to the network device.
OB_EXPORT ob_device * ob_device_list_get_device(const ob_device_list *list, uint32_t index, ob_error **error)
Create a device.
OB_EXPORT const char * ob_device_info_get_uid(const ob_device_info *info, ob_error **error)
Get device uid.
OB_EXPORT ob_device * ob_device_list_get_device_by_serial_number(const ob_device_list *list, const char *serial_number, ob_error **error)
Create a device.
OB_EXPORT uint32_t ob_device_list_get_count(const ob_device_list *list, ob_error **error)
Get the number of devices.
OB_EXPORT void ob_device_enable_heartbeat(ob_device *device, bool enable, ob_error **error)
Enable or disable the device heartbeat.
OB_EXPORT ob_property_item ob_device_get_supported_property_item(const ob_device *device, uint32_t index, ob_error **error)
Get the type of property supported by the device.
OB_EXPORT void ob_device_set_structured_data(ob_device *device, ob_property_id property_id, const uint8_t *data, uint32_t data_size, ob_error **error)
Set structured data.
OB_EXPORT void ob_device_reboot(ob_device *device, ob_error **error)
Device reboot.
OB_EXPORT void ob_device_set_int_property(ob_device *device, ob_property_id property_id, int32_t value, ob_error **error)
Set an integer type of device property.
OB_EXPORT const char * ob_device_list_get_device_subnet_mask(const ob_device_list *list, uint32_t index, ob_error **error)
Get device subnet mask.
OB_EXPORT int ob_device_info_get_vid(const ob_device_info *info, ob_error **error)
Get device vid.
OB_EXPORT ob_device_state ob_device_get_device_state(const ob_device *device, ob_error **error)
Get the current device status.
OB_EXPORT const char * ob_device_info_get_name(const ob_device_info *info, ob_error **error)
Get device name.
OB_EXPORT bool ob_device_is_global_timestamp_supported(const ob_device *device, ob_error **error)
Check if the device supports global timestamp.
OB_EXPORT const char * ob_device_info_get_subnet_mask(const ob_device_info *info, ob_error **error)
Get the network device subnet mask.
OB_EXPORT ob_float_property_range ob_device_get_float_property_range(ob_device *device, ob_property_id property_id, ob_error **error)
Get the float type of device property range.
OB_EXPORT const char * ob_device_info_get_asicName(const ob_device_info *info, ob_error **error)
Get the chip name.
OB_EXPORT const char * ob_device_info_get_supported_min_sdk_version(const ob_device_info *info, ob_error **error)
Get the minimum SDK version number supported by the device.
OB_EXPORT uint8_t ob_device_list_get_device_local_subnet_length(const ob_device_list *list, uint32_t index, ob_error **error)
Get the subnet length of the host network interface corresponding to the network device.
OB_EXPORT const char * ob_device_list_get_device_local_mac(const ob_device_list *list, uint32_t index, ob_error **error)
Get the MAC address of the host network interface corresponding to the network device.
OB_EXPORT bool ob_device_get_bool_property(ob_device *device, ob_property_id property_id, ob_error **error)
Get a boolean type of device property.
OB_EXPORT const char * ob_device_get_extension_info(const ob_device *device, const char *info_key, ob_error **error)
Get the device extension information.
OB_EXPORT uint32_t ob_device_get_supported_property_count(const ob_device *device, ob_error **error)
Get the number of properties supported by the device.
OB_EXPORT void ob_delete_device_info(ob_device_info *info, ob_error **error)
Delete device information.
OB_EXPORT const char * ob_device_info_get_connection_type(const ob_device_info *info, ob_error **error)
Get the device connection type.
OB_EXPORT int ob_device_list_get_device_vid(const ob_device_list *list, uint32_t index, ob_error **error)
Get the vid of the specified device.
OB_EXPORT const char * ob_device_list_get_device_name(const ob_device_list *list, uint32_t index, ob_error **error)
Get device name.
OB_EXPORT int ob_device_info_get_pid(const ob_device_info *info, ob_error **error)
Get device pid.
OB_EXPORT bool ob_device_is_property_supported(const ob_device *device, ob_property_id property_id, ob_permission_type permission, ob_error **error)
Check if a device property permission is supported.
OB_EXPORT void ob_device_set_float_property(ob_device *device, ob_property_id property_id, float value, ob_error **error)
Set a float type of device property.
OB_EXPORT ob_camera_param ob_camera_param_list_get_param(ob_camera_param_list *param_list, uint32_t index, ob_error **error)
Get camera parameters from the camera parameter list.
OB_EXPORT void ob_device_write_customer_data(ob_device *device, const void *data, uint32_t data_size, ob_error **error)
Set customer data.
OB_EXPORT ob_int_property_range ob_device_get_int_property_range(ob_device *device, ob_property_id property_id, ob_error **error)
Get the integer type of device property range.
OB_EXPORT ob_sensor * ob_device_get_sensor(ob_device *device, ob_sensor_type type, ob_error **error)
Get a device's sensor.
OB_EXPORT ob_camera_param_list * ob_device_get_calibration_camera_param_list(ob_device *device, ob_error **error)
Get the original parameter list of camera calibration saved on the device.
OB_EXPORT bool ob_device_is_extension_info_exist(const ob_device *device, const char *info_key, ob_error **error)
Check if the device extension information exists.
OB_EXPORT void ob_delete_camera_param_list(ob_camera_param_list *param_list, ob_error **error)
Delete the camera parameter list.
OB_EXPORT const char * ob_device_info_get_hardware_version(const ob_device_info *info, ob_error **error)
Get the hardware version number.
OB_EXPORT const char * ob_device_list_get_device_serial_number(const ob_device_list *list, uint32_t index, ob_error **error)
Get the serial number of the specified device.
OB_EXPORT void ob_device_send_and_receive_data(ob_device *device, const uint8_t *send_data, uint32_t send_data_size, uint8_t *receive_data, uint32_t *receive_data_size, ob_error **error)
Send data to the device and receive data from the device.
OB_EXPORT const char * ob_device_info_get_serial_number(const ob_device_info *info, ob_error **error)
Get device serial number.
OB_EXPORT ob_device_info * ob_device_get_device_info(const ob_device *device, ob_error **error)
Get device information.
OB_EXPORT void ob_device_enable_global_timestamp(ob_device *device, bool enable, ob_error **error)
Enable or disable global timestamp.
OB_EXPORT ob_device_type ob_device_info_get_device_type(const ob_device_info *info, ob_error **error)
Get the device type.
OB_EXPORT const char * ob_device_list_get_device_ip_address(const ob_device_list *list, uint32_t index, ob_error **error)
Get device ip address.
OB_EXPORT void ob_device_set_state_changed_callback(ob_device *device, ob_device_state_callback callback, void *user_data, ob_error **error)
Set the device state changed callback.
OB_EXPORT const char * ob_device_list_get_device_local_gateway(const ob_device_list *list, uint32_t index, ob_error **error)
Get the gateway of the host network interface corresponding to the network device.
OB_EXPORT void ob_device_update_optional_depth_presets(ob_device *device, const char file_path_list[][OB_PATH_MAX], uint8_t path_count, ob_device_fw_update_callback callback, void *user_data, ob_error **error)
Update the device optional depth presets.
OB_EXPORT ob_device * ob_device_list_get_device_by_uid(const ob_device_list *list, const char *uid, ob_error **error)
Create device by uid.
OB_EXPORT const char * ob_device_info_get_ip_address(const ob_device_info *info, ob_error **error)
Get the device IP address.
OB_EXPORT void ob_delete_device(ob_device *device, ob_error **error)
Delete a device.
OB_EXPORT void ob_device_get_structured_data(ob_device *device, ob_property_id property_id, uint8_t *data, uint32_t *data_size, ob_error **error)
Get structured data of a device property.
OB_EXPORT ob_sensor_list * ob_device_get_sensor_list(const ob_device *device, ob_error **error)
List all sensors.
OB_EXPORT int ob_device_list_get_device_pid(const ob_device_list *list, uint32_t index, ob_error **error)
Get the pid of the specified device.
OB_EXPORT float ob_device_get_float_property(ob_device *device, ob_property_id property_id, ob_error **error)
Get a float type of device property.
OB_EXPORT uint32_t ob_camera_param_list_get_count(ob_camera_param_list *param_list, ob_error **error)
Get the number of camera parameter lists.
OB_EXPORT const char * ob_device_info_get_gateway(const ob_device_info *info, ob_error **error)
Get the network device gateway address.
OB_EXPORT ob_bool_property_range ob_device_get_bool_property_range(ob_device *device, ob_property_id property_id, ob_error **error)
Get the boolean type of device property range.
OB_EXPORT void ob_device_update_firmware(ob_device *device, const char *path, ob_device_fw_update_callback callback, bool async, void *user_data, ob_error **error)
Update the device firmware.
OB_EXPORT void ob_device_read_customer_data(ob_device *device, void *data, uint32_t *data_size, ob_error **error)
Get customer data of a device property.
OB_EXPORT const char * ob_device_list_get_device_uid(const ob_device_list *list, uint32_t index, ob_error **error)
Get the uid of the specified device.
OB_EXPORT void ob_device_set_bool_property(ob_device *device, ob_property_id property_id, bool value, ob_error **error)
Set a boolean type of device property.
OB_EXPORT int32_t ob_device_get_int_property(ob_device *device, ob_property_id property_id, ob_error **error)
Get an integer type of device property.
OB_EXPORT void ob_device_update_firmware_from_data(ob_device *device, const uint8_t *data, uint32_t data_size, ob_device_fw_update_callback callback, bool async, void *user_data, ob_error **error)
Update the device firmware from data.
OB_EXPORT const char * ob_device_list_get_device_connection_type(const ob_device_list *list, uint32_t index, ob_error **error)
Get device connection type.
OB_EXPORT void ob_delete_device_list(ob_device_list *list, ob_error **error)
Delete a device list.
OB_EXPORT const char * ob_device_list_get_device_gateway(const ob_device_list *list, uint32_t index, ob_error **error)
Get device gateway.
OB_EXPORT const char * ob_device_info_get_firmware_version(const ob_device_info *info, ob_error **error)
Get the firmware version number.
This file defines the Error class, which describes abnormal errors within the SDK....
This file contains the Filter class, which is the processing unit of the SDK that can perform point c...
OB_EXPORT void ob_device_timer_sync_with_host(ob_device *device, ob_error **error)
synchronize the timer of the device with the host.
OB_EXPORT void ob_device_trigger_capture(ob_device *device, ob_error **error)
send the capture command to the device to trigger the capture.
OB_EXPORT ob_multi_device_sync_config ob_device_get_multi_device_sync_config(const ob_device *device, ob_error **error)
get the current multi device sync configuration of the device.
OB_EXPORT uint16_t ob_device_get_supported_multi_device_sync_mode_bitmap(const ob_device *device, ob_error **error)
Get the supported multi device sync mode bitmap of the device.
OB_EXPORT void ob_device_set_multi_device_sync_config(ob_device *device, const ob_multi_device_sync_config *config, ob_error **error)
set the multi device sync configuration of the device.
OB_EXPORT ob_device_timestamp_reset_config ob_device_get_timestamp_reset_config(ob_device *device, ob_error **error)
get the timestamp reset configuration of the device.
OB_EXPORT void ob_device_set_timestamp_reset_config(ob_device *device, const ob_device_timestamp_reset_config *config, ob_error **error)
set the timestamp reset configuration of the device.
OB_EXPORT void ob_device_timestamp_reset(ob_device *device, ob_error **error)
send the timestamp reset command to the device.
OBSensorType
Enumeration value describing the sensor type.
Definition ObTypes.h:128
OBStatus
error code
Definition ObTypes.h:75
uint64_t OBDeviceState
Device state.
Definition ObTypes.h:647
enum OBUpgradeState OBFwUpdateState
OBDeviceType
Enumeration for device types.
Definition ObTypes.h:679
struct ob_device_t ob_device
Definition ObTypes.h:23
enum OBUpgradeState ob_fw_update_state
struct ob_device_timestamp_reset_config OBDeviceTimestampResetConfig
struct ob_multi_device_sync_config OBMultiDeviceSyncConfig
OBPermissionType
the permission type of api or property
Definition ObTypes.h:63
#define OB_PATH_MAX
maximum path length
Definition ObTypes.h:58
Control command property list maintenance.
OBPropertyID
Enumeration value describing all attribute control commands of the device.
Definition Property.h:20
@ OB_PROP_DEVICE_REBOOT_DELAY_INT
Reboot device delay mode. Delay time unit: ms, range: [0, 8000).
Definition Property.h:383
Defines types related to sensors, which are used to obtain stream configurations, open and close stre...
Class representing a list of camera parameters.
Definition Device.hpp:1520
~CameraParamList() noexcept
Definition Device.hpp:1526
CameraParamList(ob_camera_param_list_t *impl)
Definition Device.hpp:1525
uint32_t getCount()
Get the number of camera parameters in the list.
Definition Device.hpp:1537
OBCameraParam getCameraParam(uint32_t index)
Get the camera parameters for the specified index.
Definition Device.hpp:1550
Class representing a list of device Frame Interleave.
Definition Device.hpp:1567
uint32_t getCount()
Get the number of device frame interleave in the list.
Definition Device.hpp:1584
DeviceFrameInterleaveList(ob_device_frame_interleave_list_t *impl)
Definition Device.hpp:1572
bool hasFrameInterleave(const char *name)
check if the frame interleave list contains the special name frame interleave.
Definition Device.hpp:1609
~DeviceFrameInterleaveList() noexcept
Definition Device.hpp:1573
const char * getName(uint32_t index)
Get the name of the device frame interleave at the specified index.
Definition Device.hpp:1597
DeviceStateChangedCallback deviceStateChangeCallback_
Definition Device.hpp:56
void deviceUpgradeFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
Definition Device.hpp:852
void updateFirmwareFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
Update the device firmware from data.
Definition Device.hpp:404
OBPropertyItem getSupportedProperty(uint32_t index) const
Get the supported properties of the device.
Definition Device.hpp:338
ob_device * impl_
Definition Device.hpp:55
std::shared_ptr< CameraParamList > getCalibrationCameraParamList()
Definition Device.hpp:856
const char * getCurrentPresetName() const
Get current preset name.
Definition Device.hpp:667
void timerSyncWithHost() const
synchronize the timer of the device with the host.
Definition Device.hpp:656
OBStatus switchDepthWorkMode(const char *modeName) const
Switch depth work mode by work mode name.
Definition Device.hpp:484
void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size)
Load custom preset from data.
Definition Device.hpp:727
Device(Device &&other) noexcept
Definition Device.hpp:65
void deviceUpgrade(const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
Definition Device.hpp:848
OBFloatPropertyRange getFloatPropertyRange(OBPropertyID propertyId) const
Get float type device property range((including current value and default value)
Definition Device.hpp:250
DeviceFwUpdateCallback fwUpdateCallback_
Definition Device.hpp:57
void readCustomerData(void *data, uint32_t *dataSize)
Get the customer data type of a device property.
Definition Device.hpp:314
OBDeviceTimestampResetConfig getTimestampResetConfig() const
get the timestamp reset configuration of the device.
Definition Device.hpp:616
bool isFrameInterleaveSupported() const
Check if the device supports the frame interleave feature.
Definition Device.hpp:796
void setIntProperty(OBPropertyID propertyId, int32_t value) const
Set int type of device property.
Definition Device.hpp:162
void triggerCapture() const
send the capture command to the device.
Definition Device.hpp:596
Device & operator=(const Device &)=delete
void timestampReset() const
send the timestamp reset command to the device.
Definition Device.hpp:634
void setStructuredData(OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const
Set the structured data type of a device property.
Definition Device.hpp:277
std::shared_ptr< SensorList > getSensorList() const
Get device sensor list.
Definition Device.hpp:136
Device(ob_device_t *impl)
Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
Definition Device.hpp:63
void getStructuredData(OBPropertyID propertyId, uint8_t *data, uint32_t *dataSize) const
Get the structured data type of a device property.
Definition Device.hpp:290
int getSupportedPropertyCount() const
Get the number of properties supported by the device.
Definition Device.hpp:325
OBBoolPropertyRange getBoolPropertyRange(OBPropertyID propertyId) const
Get bool type device property range (including current value and default value)
Definition Device.hpp:263
std::shared_ptr< OBDepthWorkModeList > getDepthWorkModeList() const
Request support depth work mode list.
Definition Device.hpp:495
Device(const Device &)=delete
void updateOptionalDepthPresets(const char filePathList[][OB_PATH_MAX], uint8_t pathCount, DeviceFwUpdateCallback callback)
Update the device optional depth presets.
Definition Device.hpp:418
void loadFrameInterleave(const char *frameInterleaveName) const
load the frame interleave according to frame interleave name.
Definition Device.hpp:808
std::function< void(OBDeviceState state, const char *message)> DeviceStateChangedCallback
Callback function for device status updates.
Definition Device.hpp:52
int32_t getIntProperty(OBPropertyID propertyId) const
Get int type of device property.
Definition Device.hpp:198
Device & operator=(Device &&other) noexcept
Definition Device.hpp:69
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.
Definition Device.hpp:785
bool isExtensionInfoExist(const std::string &infoKey) const
Check if the extension information is exist.
Definition Device.hpp:111
OBIntPropertyRange getIntPropertyRange(OBPropertyID propertyId) const
Get int type device property range (including current value and default value)
Definition Device.hpp:237
void setFloatProperty(OBPropertyID propertyId, float value) const
Set float type of device property.
Definition Device.hpp:174
void exportSettingsAsPresetJsonFile(const char *filePath) const
Export current device settings as a preset json file.
Definition Device.hpp:755
void updateFirmware(const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
Update the device firmware.
Definition Device.hpp:389
const char * getExtensionInfo(const std::string &infoKey) const
Get information about extensions obtained from SDK supported by the device.
Definition Device.hpp:124
OBStatus switchDepthWorkMode(const OBDepthWorkMode &workMode) const
Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to...
Definition Device.hpp:472
void reboot(uint32_t delayMs) const
Device restart delay mode.
Definition Device.hpp:521
const char * getCurrentDepthModeName()
Get current depth mode name.
Definition Device.hpp:460
std::shared_ptr< DeviceInfo > getDeviceInfo() const
Get device information.
Definition Device.hpp:98
float getFloatProperty(OBPropertyID propertyId) const
Get float type of device property.
Definition Device.hpp:211
ob_device_t * getImpl() const
Definition Device.hpp:89
virtual ~Device() noexcept
Definition Device.hpp:83
bool isGlobalTimestampSupported() const
Check if the global timestamp is supported for the device.
Definition Device.hpp:364
void setTimestampResetConfig(const OBDeviceTimestampResetConfig &config) const
set the timestamp reset configuration of the device.
Definition Device.hpp:605
OBMultiDeviceSyncConfig getMultiDeviceSyncConfig() const
get the multi device sync configuration of the device.
Definition Device.hpp:578
void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize)
Export current device settings as a preset json data.
Definition Device.hpp:743
void enableGlobalTimestamp(bool enable)
Enable or disable the global timestamp.
Definition Device.hpp:376
void loadPresetFromJsonFile(const char *filePath) const
Load custom preset from file.
Definition Device.hpp:710
bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission) const
Check if a property permission is supported.
Definition Device.hpp:352
OBDeviceState getDeviceState()
Get the current device status.
Definition Device.hpp:766
void loadDepthFilterConfig(const char *filePath)
Definition Device.hpp:863
bool getBoolProperty(OBPropertyID propertyId) const
Get bool type of device property.
Definition Device.hpp:224
std::shared_ptr< DevicePresetList > getAvailablePresetList() const
Get available preset list.
Definition Device.hpp:693
void reboot() const
Device restart.
Definition Device.hpp:507
void writeCustomerData(const void *data, uint32_t dataSize)
Set the customer data type of a device property.
Definition Device.hpp:302
void enableHeartbeat(bool enable) const
Enable or disable the device heartbeat.
Definition Device.hpp:534
void setBoolProperty(OBPropertyID propertyId, bool value) const
Set bool type of device property.
Definition Device.hpp:186
uint16_t getSupportedMultiDeviceSyncModeBitmap() const
Get the supported multi device sync mode bitmap of the device.
Definition Device.hpp:555
std::shared_ptr< DeviceFrameInterleaveList > getAvailableFrameInterleaveList() const
Get available frame interleave list.
Definition Device.hpp:819
OBDepthWorkMode getCurrentDepthWorkMode() const
Get current depth work mode.
Definition Device.hpp:448
std::function< void(OBFwUpdateState state, const char *message, uint8_t percent)> DeviceFwUpdateCallback
Callback function for device firmware update progress.
Definition Device.hpp:44
void setDeviceStateChangedCallback(DeviceStateChangedCallback callback)
Set the device state changed callbacks.
Definition Device.hpp:431
static void deviceStateChangedCallback(OBDeviceState state, const char *message, void *userData)
Definition Device.hpp:438
void setMultiDeviceSyncConfig(const OBMultiDeviceSyncConfig &config) const
set the multi device sync configuration of the device.
Definition Device.hpp:567
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 ...
Definition Device.hpp:149
void loadPreset(const char *presetName) const
load the preset according to the preset name.
Definition Device.hpp:680
std::shared_ptr< PresetResolutionConfigList > getAvailablePresetResolutionConfigList() const
Get the available preset resolution config list.
Definition Device.hpp:831
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:872
int vid() const
Definition Device.hpp:1065
const char * getDevicegateway() const
Get the gateway address of the device.
Definition Device.hpp:1048
const char * getSupportedMinSdkVersion() const
Get the minimum version number of the SDK supported by the device.
Definition Device.hpp:1000
const char * getHardwareVersion() const
Get the version number of the hardware.
Definition Device.hpp:988
const char * getDeviceSubnetMask() const
Get the subnet mask of the device.
Definition Device.hpp:1036
const char * getIpAddress() const
Get the IP address of the device.
Definition Device.hpp:976
DeviceInfo(ob_device_info_t *impl)
Definition Device.hpp:877
const char * getFirmwareVersion() const
Get the version number of the firmware.
Definition Device.hpp:949
OBDeviceType deviceType() const
Definition Device.hpp:1101
int getPid() const
Get the pid of the device.
Definition Device.hpp:901
const char * connectionType() const
Definition Device.hpp:1081
const char * uid() const
Definition Device.hpp:1069
const char * serialNumber() const
Definition Device.hpp:1073
const char * getAsicName() const
Get chip type name.
Definition Device.hpp:1012
int pid() const
Definition Device.hpp:1061
const char * ipAddress() const
Definition Device.hpp:1085
const char * firmwareVersion() const
Definition Device.hpp:1077
const char * hardwareVersion() const
Definition Device.hpp:1089
const char * name() const
Definition Device.hpp:1057
~DeviceInfo() noexcept
Definition Device.hpp:878
OBDeviceType getDeviceType() const
Get the device type.
Definition Device.hpp:1024
const char * asicName() const
Definition Device.hpp:1097
const char * getSerialNumber() const
Get the serial number of the device.
Definition Device.hpp:937
const char * supportedMinSdkVersion() const
Definition Device.hpp:1093
const char * getUid() const
Get system assigned uid for distinguishing between different devices.
Definition Device.hpp:925
int getVid() const
Get the vid of the device.
Definition Device.hpp:913
const char * getConnectionType() const
Get the connection type of the device.
Definition Device.hpp:962
const char * getName() const
Get device name.
Definition Device.hpp:889
const char * getLocalMacAddress(uint32_t index) const
Get the MAC address of the host network interface corresponding to the device at the specified index.
Definition Device.hpp:1267
const char * serialNumber(uint32_t index) const
Definition Device.hpp:1386
std::shared_ptr< Device > getDevice(uint32_t index) const
Get the device object at the specified index.
Definition Device.hpp:1327
const char * getIpAddress(uint32_t index) const
get the ip address of the device at the specified index
Definition Device.hpp:1222
uint8_t getLocalSubnetLength(uint32_t index) const
Get the subnet length of the host network interface corresponding to the device at the specified inde...
Definition Device.hpp:1297
const char * getGateway(uint32_t index) const
get the gateway of the device at the specified index
Definition Device.hpp:1252
int pid(uint32_t index) const
Definition Device.hpp:1374
const char * ipAddress(uint32_t index) const
Definition Device.hpp:1398
const char * uid(uint32_t index) const
Definition Device.hpp:1382
int vid(uint32_t index) const
Definition Device.hpp:1378
uint32_t getCount() const
Get the number of devices in the list.
Definition Device.hpp:1126
const char * getSubnetMask(uint32_t index) const
get the subnet mask of the device at the specified index
Definition Device.hpp:1237
const char * connectionType(uint32_t index) const
Definition Device.hpp:1394
uint32_t deviceCount() const
Definition Device.hpp:1370
const char * getLocalGateway(uint32_t index) const
Get the gateway of the host network interface corresponding to the device at the specified index.
Definition Device.hpp:1312
std::shared_ptr< Device > getDeviceBySN(const char *serialNumber) const
Get the device object with the specified serial number.
Definition Device.hpp:1342
const char * getUid(uint32_t index) const
Get the UID of the device at the specified index.
Definition Device.hpp:1165
~DeviceList() noexcept
Definition Device.hpp:1115
const char * getSerialNumber(uint32_t index) const
Get the serial number of the device at the specified index.
Definition Device.hpp:1178
int getPid(uint32_t index) const
Get the PID of the device at the specified index.
Definition Device.hpp:1139
const char * getConnectionType(uint32_t index) const
Get device connection type.
Definition Device.hpp:1207
std::shared_ptr< Device > getDeviceByUid(const char *uid) const
Get the specified device object from the device list by uid.
Definition Device.hpp:1361
int getVid(uint32_t index) const
Get the VID of the device at the specified index.
Definition Device.hpp:1152
const char * getLocalIP(uint32_t index) const
Get the IP address of the host network interface corresponding to the device at the specified index.
Definition Device.hpp:1282
DeviceList(ob_device_list_t *impl)
Definition Device.hpp:1114
const char * getName(uint32_t index) const
Get the name of the device at the specified index in the device list.
Definition Device.hpp:1194
const char * name(uint32_t index) const
Definition Device.hpp:1390
Class representing a list of device presets.
Definition Device.hpp:1461
DevicePresetList(ob_device_preset_list_t *impl)
Definition Device.hpp:1466
uint32_t getCount()
Get the number of device presets in the list.
Definition Device.hpp:1478
~DevicePresetList() noexcept
Definition Device.hpp:1467
const char * getName(uint32_t index)
Get the name of the device preset at the specified index.
Definition Device.hpp:1491
bool hasPreset(const char *name)
check if the preset list contains the special name preset.
Definition Device.hpp:1503
static void handle(ob_error **error, bool throw_exception=true)
A static function to handle the ob_error and throw an exception if needed.
Definition Error.hpp:38
uint32_t getCount()
Get the number of OBDepthWorkMode objects in the list.
Definition Device.hpp:1420
OBDepthWorkModeList(ob_depth_work_mode_list_t *impl)
Definition Device.hpp:1408
OBDepthWorkMode getOBDepthWorkMode(uint32_t index)
Get the OBDepthWorkMode object at the specified index.
Definition Device.hpp:1433
OBDepthWorkMode operator[](uint32_t index)
Get the OBDepthWorkMode object at the specified index.
Definition Device.hpp:1446
Class representing a list of preset resolution config list.
Definition Device.hpp:1620
uint32_t getCount()
Get the number of device preset resolution ratio in the list.
Definition Device.hpp:1635
OBPresetResolutionConfig getPresetResolutionRatioConfig(uint32_t index)
Definition Device.hpp:1647
PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl)
Definition Device.hpp:1625
Definition Context.hpp:19
Structure for boolean range.
Definition ObTypes.h:365
Structure for camera parameters.
Definition ObTypes.h:448
Depth work mode.
Definition ObTypes.h:978
Structure for float range.
Definition ObTypes.h:332
Structure for integer range.
Definition ObTypes.h:321
Used to describe the characteristics of each property.
Definition Property.h:910
The error class exposed by the SDK, users can get detailed error information according to the error.
Definition ObTypes.h:117