OrbbecSDK 2.6.3
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
112 bool isExtensionInfoExist(const std::string &infoKey) const {
113 ob_error *error = nullptr;
114 auto exist = ob_device_is_extension_info_exist(impl_, infoKey.c_str(), &error);
115 Error::handle(&error);
116 return exist;
117 }
118
126 const char *getExtensionInfo(const std::string &infoKey) const {
127 ob_error *error = nullptr;
128 const char *info = ob_device_get_extension_info(impl_, infoKey.c_str(), &error);
129 Error::handle(&error);
130 return info;
131 }
132
138 std::shared_ptr<SensorList> getSensorList() const {
139 ob_error *error = nullptr;
140 auto list = ob_device_get_sensor_list(impl_, &error);
141 Error::handle(&error);
142 return std::make_shared<SensorList>(list);
143 }
144
151 std::shared_ptr<Sensor> getSensor(OBSensorType type) const {
152 ob_error *error = nullptr;
153 auto sensor = ob_device_get_sensor(impl_, type, &error);
154 Error::handle(&error);
155 return std::make_shared<Sensor>(sensor);
156 }
157
164 void setIntProperty(OBPropertyID propertyId, int32_t value) const {
165 ob_error *error = nullptr;
166 ob_device_set_int_property(impl_, propertyId, value, &error);
167 Error::handle(&error);
168 }
169
176 void setFloatProperty(OBPropertyID propertyId, float value) const {
177 ob_error *error = nullptr;
178 ob_device_set_float_property(impl_, propertyId, value, &error);
179 Error::handle(&error);
180 }
181
188 void setBoolProperty(OBPropertyID propertyId, bool value) const {
189 ob_error *error = nullptr;
190 ob_device_set_bool_property(impl_, propertyId, value, &error);
191 Error::handle(&error);
192 }
193
201 int32_t getIntProperty(OBPropertyID propertyId) const {
202 ob_error *error = nullptr;
203 auto value = ob_device_get_int_property(impl_, propertyId, &error);
204 Error::handle(&error);
205 return value;
206 }
207
215 float getFloatProperty(OBPropertyID propertyId) const {
216 ob_error *error = nullptr;
217 auto value = ob_device_get_float_property(impl_, propertyId, &error);
218 Error::handle(&error);
219 return value;
220 }
221
229 bool getBoolProperty(OBPropertyID propertyId) const {
230 ob_error *error = nullptr;
231 auto value = ob_device_get_bool_property(impl_, propertyId, &error);
232 Error::handle(&error);
233 return value;
234 }
235
244 ob_error *error = nullptr;
245 auto range = ob_device_get_int_property_range(impl_, propertyId, &error);
246 Error::handle(&error);
247 return range;
248 }
249
258 ob_error *error = nullptr;
259 auto range = ob_device_get_float_property_range(impl_, propertyId, &error);
260 Error::handle(&error);
261 return range;
262 }
263
272 ob_error *error = nullptr;
273 auto range = ob_device_get_bool_property_range(impl_, propertyId, &error);
274 Error::handle(&error);
275 return range;
276 }
277
285 void setStructuredData(OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const {
286 ob_error *error = nullptr;
287 ob_device_set_structured_data(impl_, propertyId, data, dataSize, &error);
288 Error::handle(&error);
289 }
290
298 void getStructuredData(OBPropertyID propertyId, uint8_t *data, uint32_t *dataSize) const {
299 ob_error *error = nullptr;
300 ob_device_get_structured_data(impl_, propertyId, data, dataSize, &error);
301 Error::handle(&error);
302 }
303
310 void writeCustomerData(const void *data, uint32_t dataSize) {
311 ob_error *error = nullptr;
312 ob_device_write_customer_data(impl_, data, dataSize, &error);
313 Error::handle(&error);
314 }
315
322 void readCustomerData(void *data, uint32_t *dataSize) {
323 ob_error *error = nullptr;
324 ob_device_read_customer_data(impl_, data, dataSize, &error);
325 Error::handle(&error);
326 }
327
334 ob_error *error = nullptr;
335 auto count = ob_device_get_supported_property_count(impl_, &error);
336 Error::handle(&error);
337 return count;
338 }
339
347 OBPropertyItem getSupportedProperty(uint32_t index) const {
348 ob_error *error = nullptr;
349 auto item = ob_device_get_supported_property_item(impl_, index, &error);
350 Error::handle(&error);
351 return item;
352 }
353
362 bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission) const {
363 ob_error *error = nullptr;
364 auto result = ob_device_is_property_supported(impl_, propertyId, permission, &error);
365 Error::handle(&error);
366 return result;
367 }
368
375 ob_error *error = nullptr;
376 auto result = ob_device_is_global_timestamp_supported(impl_, &error);
377 Error::handle(&error);
378 return result;
379 }
380
386 void enableGlobalTimestamp(bool enable) {
387 ob_error *error = nullptr;
389 Error::handle(&error);
390 }
391
399 void updateFirmware(const char *filePath, DeviceFwUpdateCallback callback, bool async = true) {
400 ob_error *error = nullptr;
401 fwUpdateCallback_ = callback;
402 ob_device_update_firmware(impl_, filePath, &Device::firmwareUpdateCallback, async, this, &error);
403 Error::handle(&error);
404 }
405
414 void updateFirmwareFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async = true) {
415 ob_error *error = nullptr;
416 fwUpdateCallback_ = callback;
417 ob_device_update_firmware_from_data(impl_, firmwareData, firmwareDataSize, &Device::firmwareUpdateCallback, async, this, &error);
418 Error::handle(&error);
419 }
420
428 void updateOptionalDepthPresets(const char filePathList[][OB_PATH_MAX], uint8_t pathCount, DeviceFwUpdateCallback callback) {
429 ob_error *error = nullptr;
430 fwUpdateCallback_ = callback;
431 ob_device_update_optional_depth_presets(impl_, filePathList, pathCount, &Device::firmwareUpdateCallback, this, &error);
432 Error::handle(&error);
433 }
434
447
448 static void deviceStateChangedCallback(OBDeviceState state, const char *message, void *userData) {
449 auto device = static_cast<Device *>(userData);
450 device->deviceStateChangeCallback_(state, message);
451 }
452
459 ob_error *error = nullptr;
460 auto mode = ob_device_get_current_depth_work_mode(impl_, &error);
461 Error::handle(&error);
462 return mode;
463 }
464
472 ob_error *error = nullptr;
474 Error::handle(&error);
475 return name;
476 }
477
484 ob_error *error = nullptr;
485 auto status = ob_device_switch_depth_work_mode(impl_, &workMode, &error);
486 Error::handle(&error);
487 return status;
488 }
489
495 OBStatus switchDepthWorkMode(const char *modeName) const {
496 ob_error *error = nullptr;
497 auto status = ob_device_switch_depth_work_mode_by_name(impl_, modeName, &error);
498 Error::handle(&error);
499 return status;
500 }
501
507 std::shared_ptr<OBDepthWorkModeList> getDepthWorkModeList() const {
508 ob_error *error = nullptr;
509 auto list = ob_device_get_depth_work_mode_list(impl_, &error);
510 Error::handle(&error);
511 return std::make_shared<OBDepthWorkModeList>(list);
512 }
513
519 void reboot() const {
520 ob_error *error = nullptr;
521 ob_device_reboot(impl_, &error);
522 Error::handle(&error);
523 }
524
533 void reboot(uint32_t delayMs) const {
535 reboot();
536 }
537
546 void enableHeartbeat(bool enable) const {
547 ob_error *error = nullptr;
548 ob_device_enable_heartbeat(impl_, enable, &error);
549 Error::handle(&error);
550 }
551
568 ob_error *error = nullptr;
570 Error::handle(&error);
571 return mode;
572 }
573
580 ob_error *error = nullptr;
582 Error::handle(&error);
583 }
584
591 ob_error *error = nullptr;
592 auto config = ob_device_get_multi_device_sync_config(impl_, &error);
593 Error::handle(&error);
594 return config;
595 }
596
608 void triggerCapture() const {
609 ob_error *error = nullptr;
611 Error::handle(&error);
612 }
613
618 ob_error *error = nullptr;
620 Error::handle(&error);
621 }
622
629 ob_error *error = nullptr;
630 auto config = ob_device_get_timestamp_reset_config(impl_, &error);
631 Error::handle(&error);
632 return config;
633 }
634
646 void timestampReset() const {
647 ob_error *error = nullptr;
649 Error::handle(&error);
650 }
651
655 inline void timerReset() const {
657 }
658
670 void timerSyncWithHost() const {
671 ob_error *error = nullptr;
673 Error::handle(&error);
674 }
675
682 const char *getCurrentPresetName() const {
683 ob_error *error = nullptr;
684 const char *name = ob_device_get_current_preset_name(impl_, &error);
685 Error::handle(&error);
686 return name;
687 }
688
695 void loadPreset(const char *presetName) const {
696 ob_error *error = nullptr;
697 ob_device_load_preset(impl_, presetName, &error);
698 Error::handle(&error);
699 }
700
708 std::shared_ptr<DevicePresetList> getAvailablePresetList() const {
709 ob_error *error = nullptr;
710 auto list = ob_device_get_available_preset_list(impl_, &error);
711 Error::handle(&error);
712 return std::make_shared<DevicePresetList>(list);
713 }
714
725 void loadPresetFromJsonFile(const char *filePath) const {
726 ob_error *error = nullptr;
728 Error::handle(&error);
729 }
730
743 void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size) {
744 ob_error *error = nullptr;
745 ob_device_load_preset_from_json_data(impl_, presetName, data, size, &error);
746 }
747
760 void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize) {
761 ob_error *error = nullptr;
762 ob_device_export_current_settings_as_preset_json_data(impl_, presetName, data, dataSize, &error);
763 }
764
772 void exportSettingsAsPresetJsonFile(const char *filePath) const {
773 ob_error *error = nullptr;
775 Error::handle(&error);
776 }
777
784 OBDeviceState state = {};
785 ob_error *error = nullptr;
786 state = ob_device_get_device_state(impl_, &error);
787 return state;
788 }
789
802 void sendAndReceiveData(const uint8_t *sendData, uint32_t sendDataSize, uint8_t *receiveData, uint32_t *receiveDataSize) const {
803 ob_error *error = nullptr;
804 ob_device_send_and_receive_data(impl_, sendData, sendDataSize, receiveData, receiveDataSize, &error);
805 Error::handle(&error);
806 }
807
814 ob_error *error = nullptr;
816 Error::handle(&error);
817 return ret;
818 }
819
825 void loadFrameInterleave(const char *frameInterleaveName) const {
826 ob_error *error = nullptr;
827 ob_device_load_frame_interleave(impl_, frameInterleaveName, &error);
828 Error::handle(&error);
829 }
830
836 std::shared_ptr<DeviceFrameInterleaveList> getAvailableFrameInterleaveList() const {
837 ob_error *error = nullptr;
839 Error::handle(&error);
840 return std::make_shared<DeviceFrameInterleaveList>(list);
841 }
842
848 std::shared_ptr<PresetResolutionConfigList> getAvailablePresetResolutionConfigList() const {
849 ob_error *error = nullptr;
851 Error::handle(&error);
852 return std::make_shared<PresetResolutionConfigList>(list);
853 }
854
855private:
856 static void firmwareUpdateCallback(ob_fw_update_state state, const char *message, uint8_t percent, void *userData) {
857 auto device = static_cast<Device *>(userData);
858 if(device && device->fwUpdateCallback_) {
859 device->fwUpdateCallback_(state, message, percent);
860 }
861 }
862
863public:
864 // The following interfaces are deprecated and are retained here for compatibility purposes.
865 void deviceUpgrade(const char *filePath, DeviceFwUpdateCallback callback, bool async = true) {
866 updateFirmware(filePath, callback, async);
867 }
868
869 void deviceUpgradeFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async = true) {
870 updateFirmwareFromData(firmwareData, firmwareDataSize, callback, async);
871 }
872
873 std::shared_ptr<CameraParamList> getCalibrationCameraParamList() {
874 ob_error *error = nullptr;
876 Error::handle(&error);
877 return std::make_shared<CameraParamList>(impl);
878 }
879
880 void loadDepthFilterConfig(const char *filePath) {
881 // In order to compile, some high-version compilers will warn that the function parameters are not used.
882 (void)filePath;
883 }
884};
885
890private:
891 ob_device_info_t *impl_ = nullptr;
892
893public:
894 explicit DeviceInfo(ob_device_info_t *impl) : impl_(impl) {}
895 ~DeviceInfo() noexcept {
896 ob_error *error = nullptr;
897 ob_delete_device_info(impl_, &error);
898 Error::handle(&error, false);
899 }
900
906 const char *getName() const {
907 ob_error *error = nullptr;
908 const char *name = ob_device_info_get_name(impl_, &error);
909 Error::handle(&error);
910 return name;
911 }
912
918 int getPid() const {
919 ob_error *error = nullptr;
920 int pid = ob_device_info_get_pid(impl_, &error);
921 Error::handle(&error);
922 return pid;
923 }
924
930 int getVid() const {
931 ob_error *error = nullptr;
932 int vid = ob_device_info_get_vid(impl_, &error);
933 Error::handle(&error);
934 return vid;
935 }
936
942 const char *getUid() const {
943 ob_error *error = nullptr;
944 const char *uid = ob_device_info_get_uid(impl_, &error);
945 Error::handle(&error);
946 return uid;
947 }
948
954 const char *getSerialNumber() const {
955 ob_error *error = nullptr;
956 const char *sn = ob_device_info_get_serial_number(impl_, &error);
957 Error::handle(&error);
958 return sn;
959 }
960
966 const char *getFirmwareVersion() const {
967 ob_error *error = nullptr;
968 const char *version = ob_device_info_get_firmware_version(impl_, &error);
969 Error::handle(&error);
970 return version;
971 }
972
979 const char *getConnectionType() const {
980 ob_error *error = nullptr;
981 const char *type = ob_device_info_get_connection_type(impl_, &error);
982 Error::handle(&error);
983 return type;
984 }
985
993 const char *getIpAddress() const {
994 ob_error *error = nullptr;
995 const char *ip = ob_device_info_get_ip_address(impl_, &error);
996 Error::handle(&error);
997 return ip;
998 }
999
1005 const char *getHardwareVersion() const {
1006 ob_error *error = nullptr;
1007 const char *version = ob_device_info_get_hardware_version(impl_, &error);
1008 Error::handle(&error);
1009 return version;
1010 }
1011
1017 const char *getSupportedMinSdkVersion() const {
1018 ob_error *error = nullptr;
1019 const char *version = ob_device_info_get_supported_min_sdk_version(impl_, &error);
1020 Error::handle(&error);
1021 return version;
1022 }
1023
1029 const char *getAsicName() const {
1030 ob_error *error = nullptr;
1031 const char *name = ob_device_info_get_asicName(impl_, &error);
1032 Error::handle(&error);
1033 return name;
1034 }
1035
1042 ob_error *error = nullptr;
1043 OBDeviceType type = ob_device_info_get_device_type(impl_, &error);
1044 Error::handle(&error);
1045 return type;
1046 }
1047
1053 const char *getDeviceSubnetMask() const {
1054 ob_error *error = nullptr;
1055 const char *subnetMask = ob_device_info_get_subnet_mask(impl_, &error);
1056 Error::handle(&error);
1057 return subnetMask;
1058 }
1059
1065 const char *getDeviceGateway() const {
1066 ob_error *error = nullptr;
1067 const char *subnetMask = ob_device_info_get_gateway(impl_, &error);
1068 Error::handle(&error);
1069 return subnetMask;
1070 }
1071
1072public:
1073 // The following interfaces are deprecated and are retained here for compatibility purposes.
1074 const char *getDevicegateway() {
1075 return getDeviceGateway();
1076 }
1077
1078 const char *name() const {
1079 return getName();
1080 }
1081
1082 int pid() const {
1083 return getPid();
1084 }
1085
1086 int vid() const {
1087 return getVid();
1088 }
1089
1090 const char *uid() const {
1091 return getUid();
1092 }
1093
1094 const char *serialNumber() const {
1095 return getSerialNumber();
1096 }
1097
1098 const char *firmwareVersion() const {
1099 return getFirmwareVersion();
1100 }
1101
1102 const char *connectionType() const {
1103 return getConnectionType();
1104 }
1105
1106 const char *ipAddress() const {
1107 return getIpAddress();
1108 }
1109
1110 const char *hardwareVersion() const {
1111 return getHardwareVersion();
1112 }
1113
1114 const char *supportedMinSdkVersion() const {
1116 }
1117
1118 const char *asicName() const {
1119 return getAsicName();
1120 }
1121
1123 return getDeviceType();
1124 }
1125};
1126
1131private:
1132 ob_device_list_t *impl_ = nullptr;
1133
1134public:
1135 explicit DeviceList(ob_device_list_t *impl) : impl_(impl) {}
1136 ~DeviceList() noexcept {
1137 ob_error *error = nullptr;
1138 ob_delete_device_list(impl_, &error);
1139 Error::handle(&error, false);
1140 }
1141
1147 uint32_t getCount() const {
1148 ob_error *error = nullptr;
1149 auto count = ob_device_list_get_count(impl_, &error);
1150 Error::handle(&error);
1151 return count;
1152 }
1153
1161 int getPid(uint32_t index) const {
1162 ob_error *error = nullptr;
1163 auto pid = ob_device_list_get_device_pid(impl_, index, &error);
1164 Error::handle(&error);
1165 return pid;
1166 }
1167
1175 int getVid(uint32_t index) const {
1176 ob_error *error = nullptr;
1177 auto vid = ob_device_list_get_device_vid(impl_, index, &error);
1178 Error::handle(&error);
1179 return vid;
1180 }
1181
1189 const char *getUid(uint32_t index) const {
1190 ob_error *error = nullptr;
1191 auto uid = ob_device_list_get_device_uid(impl_, index, &error);
1192 Error::handle(&error);
1193 return uid;
1194 }
1195
1203 const char *getSerialNumber(uint32_t index) const {
1204 ob_error *error = nullptr;
1205 auto sn = ob_device_list_get_device_serial_number(impl_, index, &error);
1206 Error::handle(&error);
1207 return sn;
1208 }
1209
1220 const char *getName(uint32_t index) const {
1221 ob_error *error = nullptr;
1222 auto name = ob_device_list_get_device_name(impl_, index, &error);
1223 Error::handle(&error);
1224 return name;
1225 }
1226
1235 const char *getConnectionType(uint32_t index) const {
1236 ob_error *error = nullptr;
1237 auto type = ob_device_list_get_device_connection_type(impl_, index, &error);
1238 Error::handle(&error);
1239 return type;
1240 }
1241
1251 const char *getIpAddress(uint32_t index) const {
1252 ob_error *error = nullptr;
1253 auto ip = ob_device_list_get_device_ip_address(impl_, index, &error);
1254 Error::handle(&error);
1255 return ip;
1256 }
1257
1267 const char *getSubnetMask(uint32_t index) const {
1268 ob_error *error = nullptr;
1269 auto subnetMask = ob_device_list_get_device_subnet_mask(impl_, index, &error);
1270 Error::handle(&error);
1271 return subnetMask;
1272 }
1273
1283 const char *getGateway(uint32_t index) const {
1284 ob_error *error = nullptr;
1285 auto gateway = ob_device_list_get_device_gateway(impl_, index, &error);
1286 Error::handle(&error);
1287 return gateway;
1288 }
1289
1299 const char *getLocalMacAddress(uint32_t index) const {
1300 ob_error *error = nullptr;
1301 auto mac = ob_device_list_get_device_local_mac(impl_, index, &error);
1302 Error::handle(&error);
1303 return mac;
1304 }
1305
1315 const char *getLocalIP(uint32_t index) const {
1316 ob_error *error = nullptr;
1317 auto ip = ob_device_list_get_device_local_ip(impl_, index, &error);
1318 Error::handle(&error);
1319 return ip;
1320 }
1321
1331 uint8_t getLocalSubnetLength(uint32_t index) const {
1332 ob_error *error = nullptr;
1333 auto subnetMask = ob_device_list_get_device_local_subnet_length(impl_, index, &error);
1334 Error::handle(&error);
1335 return subnetMask;
1336 }
1337
1347 const char *getLocalGateway(uint32_t index) const {
1348 ob_error *error = nullptr;
1349 auto gateway = ob_device_list_get_device_local_gateway(impl_, index, &error);
1350 Error::handle(&error);
1351 return gateway;
1352 }
1353
1366 std::shared_ptr<Device> getDevice(uint32_t index, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
1367 ob_error *error = nullptr;
1368 auto device = ob_device_list_get_device_ex(impl_, index, accessMode, &error);
1369 Error::handle(&error);
1370 return std::make_shared<Device>(device);
1371 }
1372
1385 std::shared_ptr<Device> getDeviceBySN(const char *serialNumber, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
1386 ob_error *error = nullptr;
1387 auto device = ob_device_list_get_device_by_serial_number_ex(impl_, serialNumber, accessMode, &error);
1388 Error::handle(&error);
1389 return std::make_shared<Device>(device);
1390 }
1391
1408 std::shared_ptr<Device> getDeviceByUid(const char *uid, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
1409 ob_error *error = nullptr;
1410 auto device = ob_device_list_get_device_by_uid_ex(impl_, uid, accessMode, &error);
1411 Error::handle(&error);
1412 return std::make_shared<Device>(device);
1413 }
1414
1415public:
1416 // The following interfaces are deprecated and are retained here for compatibility purposes.
1417 uint32_t deviceCount() const {
1418 return getCount();
1419 }
1420
1421 int pid(uint32_t index) const {
1422 return getPid(index);
1423 }
1424
1425 int vid(uint32_t index) const {
1426 return getVid(index);
1427 }
1428
1429 const char *uid(uint32_t index) const {
1430 return getUid(index);
1431 }
1432
1433 const char *serialNumber(uint32_t index) const {
1434 return getSerialNumber(index);
1435 }
1436
1437 const char *name(uint32_t index) const {
1438 return getName(index);
1439 }
1440
1441 const char *connectionType(uint32_t index) const {
1442 return getConnectionType(index);
1443 }
1444
1445 const char *ipAddress(uint32_t index) const {
1446 return getIpAddress(index);
1447 }
1448};
1449
1451private:
1452 ob_depth_work_mode_list_t *impl_ = nullptr;
1453
1454public:
1455 explicit OBDepthWorkModeList(ob_depth_work_mode_list_t *impl) : impl_(impl) {}
1457 ob_error *error = nullptr;
1458 ob_delete_depth_work_mode_list(impl_, &error);
1459 Error::handle(&error, false);
1460 }
1461
1467 uint32_t getCount() {
1468 ob_error *error = nullptr;
1469 auto count = ob_depth_work_mode_list_get_count(impl_, &error);
1470 Error::handle(&error);
1471 return count;
1472 }
1473
1482 ob_error *error = nullptr;
1483 auto mode = ob_depth_work_mode_list_get_item(impl_, index, &error);
1484 Error::handle(&error);
1485 return mode;
1486 }
1487
1495 OBDepthWorkMode operator[](uint32_t index) {
1496 return getOBDepthWorkMode(index);
1497 }
1498
1499public:
1500 // The following interfaces are deprecated and are retained here for compatibility purposes.
1501 uint32_t count() {
1502 return getCount();
1503 }
1504};
1505
1511private:
1512 ob_device_preset_list_t *impl_ = nullptr;
1513
1514public:
1515 explicit DevicePresetList(ob_device_preset_list_t *impl) : impl_(impl) {}
1517 ob_error *error = nullptr;
1518 ob_delete_preset_list(impl_, &error);
1519 Error::handle(&error, false);
1520 }
1521
1527 uint32_t getCount() {
1528 ob_error *error = nullptr;
1529 auto count = ob_device_preset_list_get_count(impl_, &error);
1530 Error::handle(&error);
1531 return count;
1532 }
1533
1541 const char *getName(uint32_t index) {
1542 ob_error *error = nullptr;
1543 const char *name = ob_device_preset_list_get_name(impl_, index, &error);
1544 Error::handle(&error);
1545 return name;
1546 }
1547
1554 bool hasPreset(const char *name) {
1555 ob_error *error = nullptr;
1556 auto result = ob_device_preset_list_has_preset(impl_, name, &error);
1557 Error::handle(&error);
1558 return result;
1559 }
1560
1561public:
1562 // The following interfaces are deprecated and are retained here for compatibility purposes.
1563 uint32_t count() {
1564 return getCount();
1565 }
1566};
1567
1572private:
1573 ob_camera_param_list_t *impl_ = nullptr;
1574
1575public:
1576 explicit CameraParamList(ob_camera_param_list_t *impl) : impl_(impl) {}
1577 ~CameraParamList() noexcept {
1578 ob_error *error = nullptr;
1579 ob_delete_camera_param_list(impl_, &error);
1580 Error::handle(&error, false);
1581 }
1582
1588 uint32_t getCount() {
1589 ob_error *error = nullptr;
1590 auto count = ob_camera_param_list_get_count(impl_, &error);
1591 Error::handle(&error);
1592 return count;
1593 }
1594
1603 ob_error *error = nullptr;
1604 auto param = ob_camera_param_list_get_param(impl_, index, &error);
1605 Error::handle(&error);
1606 return param;
1607 }
1608
1609public:
1610 // The following interfaces are deprecated and are retained here for compatibility purposes.
1611 uint32_t count() {
1612 return getCount();
1613 }
1614};
1615
1620private:
1621 ob_device_frame_interleave_list_t *impl_ = nullptr;
1622
1623public:
1624 explicit DeviceFrameInterleaveList(ob_device_frame_interleave_list_t *impl) : impl_(impl) {}
1626 ob_error *error = nullptr;
1627 ob_delete_frame_interleave_list(impl_, &error);
1628 Error::handle(&error, false);
1629 }
1630
1636 uint32_t getCount() {
1637 ob_error *error = nullptr;
1638 auto count = ob_device_frame_interleave_list_get_count(impl_, &error);
1639 Error::handle(&error);
1640 return count;
1641 }
1642
1650 const char *getName(uint32_t index) {
1651 ob_error *error = nullptr;
1652 const char *name = ob_device_frame_interleave_list_get_name(impl_, index, &error);
1653 Error::handle(&error);
1654 return name;
1655 }
1656
1664 bool hasFrameInterleave(const char *name) {
1665 ob_error *error = nullptr;
1666 auto result = ob_device_frame_interleave_list_has_frame_interleave(impl_, name, &error);
1667 Error::handle(&error);
1668 return result;
1669 }
1670};
1671
1676private:
1677 ob_preset_resolution_config_list_t *impl_ = nullptr;
1678
1679public:
1680 explicit PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl) : impl_(impl) {}
1682 ob_error *error = nullptr;
1684 Error::handle(&error, false);
1685 }
1686
1690 uint32_t getCount() {
1691 ob_error *error = nullptr;
1692 auto count = ob_device_preset_resolution_config_get_count(impl_, &error);
1693 Error::handle(&error);
1694 return count;
1695 }
1696
1697 /*
1698 * @brief Get the device preset resolution ratio at the specified index
1699
1700 * @param[in] index the index of the device preset resolution ratio
1701 *
1702 * @return OBPresetResolutionConfig the corresponding device preset resolution ratio
1703 */
1705 ob_error *error = nullptr;
1706 auto config = ob_device_preset_resolution_config_list_get_item(impl_, index, &error);
1707 Error::handle(&error);
1708 return config;
1709 }
1710};
1711
1712} // 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)
Get the available preset resolution config list.
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)
Get the depth work mode count that ob_depth_work_mode_list hold.
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)
Get the number of preset resolution in the preset resolution list.
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 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_ex(const ob_device_list *list, const char *serial_number, ob_device_access_mode accessMode, 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 ob_device * ob_device_list_get_device_by_uid_ex(const ob_device_list *list, const char *uid, ob_device_access_mode accessMode, ob_error **error)
Create device by uid.
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_ex(const ob_device_list *list, uint32_t index, ob_device_access_mode accessMode, ob_error **error)
Create a device.
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:130
OBStatus
error code
Definition ObTypes.h:76
@ OB_DEVICE_DEFAULT_ACCESS
Default access: control access for capable devices, ignored otherwise.
Definition ObTypes.h:1822
uint64_t OBDeviceState
Device state.
Definition ObTypes.h:674
enum OBUpgradeState OBFwUpdateState
OBDeviceType
Enumeration for device types.
Definition ObTypes.h:706
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
enum ob_device_access_mode OBDeviceAccessMode
OBPermissionType
the permission type of api or property
Definition ObTypes.h:64
#define OB_PATH_MAX
maximum path length
Definition ObTypes.h:59
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:1571
~CameraParamList() noexcept
Definition Device.hpp:1577
CameraParamList(ob_camera_param_list_t *impl)
Definition Device.hpp:1576
uint32_t getCount()
Get the number of camera parameters in the list.
Definition Device.hpp:1588
OBCameraParam getCameraParam(uint32_t index)
Get the camera parameters for the specified index.
Definition Device.hpp:1602
Class representing a list of device Frame Interleave.
Definition Device.hpp:1619
uint32_t getCount()
Get the number of device frame interleave in the list.
Definition Device.hpp:1636
DeviceFrameInterleaveList(ob_device_frame_interleave_list_t *impl)
Definition Device.hpp:1624
bool hasFrameInterleave(const char *name)
check if the frame interleave list contains the special name frame interleave.
Definition Device.hpp:1664
~DeviceFrameInterleaveList() noexcept
Definition Device.hpp:1625
const char * getName(uint32_t index)
Get the name of the device frame interleave at the specified index.
Definition Device.hpp:1650
DeviceStateChangedCallback deviceStateChangeCallback_
Definition Device.hpp:56
void deviceUpgradeFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
Definition Device.hpp:869
void updateFirmwareFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
Update the device firmware from data.
Definition Device.hpp:414
OBPropertyItem getSupportedProperty(uint32_t index) const
Get the supported properties of the device.
Definition Device.hpp:347
ob_device * impl_
Definition Device.hpp:55
std::shared_ptr< CameraParamList > getCalibrationCameraParamList()
Definition Device.hpp:873
const char * getCurrentPresetName() const
Get current preset name.
Definition Device.hpp:682
void timerSyncWithHost() const
synchronize the timer of the device with the host.
Definition Device.hpp:670
OBStatus switchDepthWorkMode(const char *modeName) const
Switch depth work mode by work mode name.
Definition Device.hpp:495
void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size)
Load custom preset from data.
Definition Device.hpp:743
Device(Device &&other) noexcept
Definition Device.hpp:65
void deviceUpgrade(const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
Definition Device.hpp:865
OBFloatPropertyRange getFloatPropertyRange(OBPropertyID propertyId) const
Get float type device property range((including current value and default value)
Definition Device.hpp:257
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:322
OBDeviceTimestampResetConfig getTimestampResetConfig() const
get the timestamp reset configuration of the device.
Definition Device.hpp:628
bool isFrameInterleaveSupported() const
Check if the device supports the frame interleave feature.
Definition Device.hpp:813
void setIntProperty(OBPropertyID propertyId, int32_t value) const
Set int type of device property.
Definition Device.hpp:164
void triggerCapture() const
send the capture command to the device.
Definition Device.hpp:608
Device & operator=(const Device &)=delete
void timestampReset() const
send the timestamp reset command to the device.
Definition Device.hpp:646
void setStructuredData(OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const
Set the structured data type of a device property.
Definition Device.hpp:285
std::shared_ptr< SensorList > getSensorList() const
Get device sensor list.
Definition Device.hpp:138
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:298
int getSupportedPropertyCount() const
Get the number of properties supported by the device.
Definition Device.hpp:333
OBBoolPropertyRange getBoolPropertyRange(OBPropertyID propertyId) const
Get bool type device property range (including current value and default value)
Definition Device.hpp:271
std::shared_ptr< OBDepthWorkModeList > getDepthWorkModeList() const
Request support depth work mode list.
Definition Device.hpp:507
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:428
void loadFrameInterleave(const char *frameInterleaveName) const
load the frame interleave according to frame interleave name.
Definition Device.hpp:825
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:201
Device & operator=(Device &&other) noexcept
Definition Device.hpp:69
void timerReset() const
Alias for timestampReset() since it is more accurate.
Definition Device.hpp:655
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:802
bool isExtensionInfoExist(const std::string &infoKey) const
Check if the extension information is exist.
Definition Device.hpp:112
OBIntPropertyRange getIntPropertyRange(OBPropertyID propertyId) const
Get int type device property range (including current value and default value)
Definition Device.hpp:243
void setFloatProperty(OBPropertyID propertyId, float value) const
Set float type of device property.
Definition Device.hpp:176
void exportSettingsAsPresetJsonFile(const char *filePath) const
Export current device settings as a preset json file.
Definition Device.hpp:772
void updateFirmware(const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
Update the device firmware.
Definition Device.hpp:399
const char * getExtensionInfo(const std::string &infoKey) const
Get information about extensions obtained from SDK supported by the device.
Definition Device.hpp:126
OBStatus switchDepthWorkMode(const OBDepthWorkMode &workMode) const
Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to...
Definition Device.hpp:483
void reboot(uint32_t delayMs) const
Device restart delay mode.
Definition Device.hpp:533
const char * getCurrentDepthModeName()
Get current depth mode name.
Definition Device.hpp:471
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:215
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:374
void setTimestampResetConfig(const OBDeviceTimestampResetConfig &config) const
set the timestamp reset configuration of the device.
Definition Device.hpp:617
OBMultiDeviceSyncConfig getMultiDeviceSyncConfig() const
get the multi device sync configuration of the device.
Definition Device.hpp:590
void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize)
Export current device settings as a preset json data.
Definition Device.hpp:760
void enableGlobalTimestamp(bool enable)
Enable or disable the global timestamp.
Definition Device.hpp:386
void loadPresetFromJsonFile(const char *filePath) const
Load custom preset from file.
Definition Device.hpp:725
bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission) const
Check if a property permission is supported.
Definition Device.hpp:362
OBDeviceState getDeviceState()
Get the current device status.
Definition Device.hpp:783
void loadDepthFilterConfig(const char *filePath)
Definition Device.hpp:880
bool getBoolProperty(OBPropertyID propertyId) const
Get bool type of device property.
Definition Device.hpp:229
std::shared_ptr< DevicePresetList > getAvailablePresetList() const
Get available preset list.
Definition Device.hpp:708
void reboot() const
Device restart.
Definition Device.hpp:519
void writeCustomerData(const void *data, uint32_t dataSize)
Set the customer data type of a device property.
Definition Device.hpp:310
void enableHeartbeat(bool enable) const
Enable or disable the device heartbeat.
Definition Device.hpp:546
void setBoolProperty(OBPropertyID propertyId, bool value) const
Set bool type of device property.
Definition Device.hpp:188
uint16_t getSupportedMultiDeviceSyncModeBitmap() const
Get the supported multi device sync mode bitmap of the device.
Definition Device.hpp:567
std::shared_ptr< DeviceFrameInterleaveList > getAvailableFrameInterleaveList() const
Get available frame interleave list.
Definition Device.hpp:836
OBDepthWorkMode getCurrentDepthWorkMode() const
Get current depth work mode.
Definition Device.hpp:458
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:441
static void deviceStateChangedCallback(OBDeviceState state, const char *message, void *userData)
Definition Device.hpp:448
void setMultiDeviceSyncConfig(const OBMultiDeviceSyncConfig &config) const
set the multi device sync configuration of the device.
Definition Device.hpp:579
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:151
void loadPreset(const char *presetName) const
load the preset according to the preset name.
Definition Device.hpp:695
std::shared_ptr< PresetResolutionConfigList > getAvailablePresetResolutionConfigList() const
Get the available preset resolution config list.
Definition Device.hpp:848
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:889
int vid() const
Definition Device.hpp:1086
const char * getSupportedMinSdkVersion() const
Get the minimum version number of the SDK supported by the device.
Definition Device.hpp:1017
const char * getHardwareVersion() const
Get the version number of the hardware.
Definition Device.hpp:1005
const char * getDeviceSubnetMask() const
Get the subnet mask of the device.
Definition Device.hpp:1053
const char * getIpAddress() const
Get the IP address of the device.
Definition Device.hpp:993
DeviceInfo(ob_device_info_t *impl)
Definition Device.hpp:894
const char * getFirmwareVersion() const
Get the version number of the firmware.
Definition Device.hpp:966
OBDeviceType deviceType() const
Definition Device.hpp:1122
int getPid() const
Get the pid of the device.
Definition Device.hpp:918
const char * connectionType() const
Definition Device.hpp:1102
const char * uid() const
Definition Device.hpp:1090
const char * serialNumber() const
Definition Device.hpp:1094
const char * getDevicegateway()
Definition Device.hpp:1074
const char * getAsicName() const
Get chip type name.
Definition Device.hpp:1029
int pid() const
Definition Device.hpp:1082
const char * ipAddress() const
Definition Device.hpp:1106
const char * firmwareVersion() const
Definition Device.hpp:1098
const char * hardwareVersion() const
Definition Device.hpp:1110
const char * name() const
Definition Device.hpp:1078
~DeviceInfo() noexcept
Definition Device.hpp:895
OBDeviceType getDeviceType() const
Get the device type.
Definition Device.hpp:1041
const char * getDeviceGateway() const
Get the gateway address of the device.
Definition Device.hpp:1065
const char * asicName() const
Definition Device.hpp:1118
const char * getSerialNumber() const
Get the serial number of the device.
Definition Device.hpp:954
const char * supportedMinSdkVersion() const
Definition Device.hpp:1114
const char * getUid() const
Get system assigned uid for distinguishing between different devices.
Definition Device.hpp:942
int getVid() const
Get the vid of the device.
Definition Device.hpp:930
const char * getConnectionType() const
Get the connection type of the device.
Definition Device.hpp:979
const char * getName() const
Get device name.
Definition Device.hpp:906
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:1299
const char * serialNumber(uint32_t index) const
Definition Device.hpp:1433
const char * getIpAddress(uint32_t index) const
get the ip address of the device at the specified index
Definition Device.hpp:1251
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:1331
const char * getGateway(uint32_t index) const
get the gateway of the device at the specified index
Definition Device.hpp:1283
int pid(uint32_t index) const
Definition Device.hpp:1421
std::shared_ptr< Device > getDeviceByUid(const char *uid, OBDeviceAccessMode accessMode=OB_DEVICE_DEFAULT_ACCESS) const
Get the specified device object from the device list by uid.
Definition Device.hpp:1408
const char * ipAddress(uint32_t index) const
Definition Device.hpp:1445
const char * uid(uint32_t index) const
Definition Device.hpp:1429
int vid(uint32_t index) const
Definition Device.hpp:1425
uint32_t getCount() const
Get the number of devices in the list.
Definition Device.hpp:1147
const char * getSubnetMask(uint32_t index) const
get the subnet mask of the device at the specified index
Definition Device.hpp:1267
const char * connectionType(uint32_t index) const
Definition Device.hpp:1441
uint32_t deviceCount() const
Definition Device.hpp:1417
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:1347
const char * getUid(uint32_t index) const
Get the UID of the device at the specified index.
Definition Device.hpp:1189
~DeviceList() noexcept
Definition Device.hpp:1136
const char * getSerialNumber(uint32_t index) const
Get the serial number of the device at the specified index.
Definition Device.hpp:1203
int getPid(uint32_t index) const
Get the PID of the device at the specified index.
Definition Device.hpp:1161
const char * getConnectionType(uint32_t index) const
Get device connection type.
Definition Device.hpp:1235
std::shared_ptr< Device > getDevice(uint32_t index, OBDeviceAccessMode accessMode=OB_DEVICE_DEFAULT_ACCESS) const
Get the device object at the specified index.
Definition Device.hpp:1366
std::shared_ptr< Device > getDeviceBySN(const char *serialNumber, OBDeviceAccessMode accessMode=OB_DEVICE_DEFAULT_ACCESS) const
Get the device object with the specified serial number.
Definition Device.hpp:1385
int getVid(uint32_t index) const
Get the VID of the device at the specified index.
Definition Device.hpp:1175
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:1315
DeviceList(ob_device_list_t *impl)
Definition Device.hpp:1135
const char * getName(uint32_t index) const
Get the name of the device at the specified index in the device list.
Definition Device.hpp:1220
const char * name(uint32_t index) const
Definition Device.hpp:1437
Class representing a list of device presets.
Definition Device.hpp:1510
DevicePresetList(ob_device_preset_list_t *impl)
Definition Device.hpp:1515
uint32_t getCount()
Get the number of device presets in the list.
Definition Device.hpp:1527
~DevicePresetList() noexcept
Definition Device.hpp:1516
const char * getName(uint32_t index)
Get the name of the device preset at the specified index.
Definition Device.hpp:1541
bool hasPreset(const char *name)
check if the preset list contains the special name preset.
Definition Device.hpp:1554
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:1467
OBDepthWorkModeList(ob_depth_work_mode_list_t *impl)
Definition Device.hpp:1455
OBDepthWorkMode getOBDepthWorkMode(uint32_t index)
Get the OBDepthWorkMode object at the specified index.
Definition Device.hpp:1481
OBDepthWorkMode operator[](uint32_t index)
Get the OBDepthWorkMode object at the specified index.
Definition Device.hpp:1495
Class representing a list of preset resolution config list.
Definition Device.hpp:1675
uint32_t getCount()
Get the number of device preset resolution ratio in the list.
Definition Device.hpp:1690
OBPresetResolutionConfig getPresetResolutionRatioConfig(uint32_t index)
Definition Device.hpp:1704
PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl)
Definition Device.hpp:1680
Definition Context.hpp:22
Structure for boolean range.
Definition ObTypes.h:377
Structure for camera parameters.
Definition ObTypes.h:460
Depth work mode.
Definition ObTypes.h:1036
Structure for float range.
Definition ObTypes.h:344
Structure for integer range.
Definition ObTypes.h:333
Used to describe the characteristics of each property.
Definition Property.h:1010
The error class exposed by the SDK, users can get detailed error information according to the error.
Definition ObTypes.h:119