OrbbecSDK 2.10.6
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;
30class ColorPresetList;
32class CameraParamList;
35
36class Device {
37public:
45 typedef std::function<void(OBFwUpdateState state, const char *message, uint8_t percent)> DeviceFwUpdateCallback;
46
53 typedef std::function<void(OBDeviceState state, const char *message)> DeviceStateChangedCallback;
54
55protected:
56 ob_device *impl_ = nullptr;
59
60public:
64 explicit Device(ob_device_t *impl) : impl_(impl) {}
65
66 Device(Device &&other) noexcept : impl_(other.impl_) {
67 other.impl_ = nullptr;
68 }
69
70 Device &operator=(Device &&other) noexcept {
71 if(this != &other) {
72 ob_error *error = nullptr;
73 ob_delete_device(impl_, &error);
74 Error::handle(&error);
75 impl_ = other.impl_;
76 other.impl_ = nullptr;
77 }
78 return *this;
79 }
80
81 Device(const Device &) = delete;
82 Device &operator=(const Device &) = delete;
83
84 virtual ~Device() noexcept {
85 ob_error *error = nullptr;
86 ob_delete_device(impl_, &error);
87 Error::handle(&error, false);
88 }
89
90 ob_device_t *getImpl() const {
91 return impl_;
92 }
93
99 std::shared_ptr<DeviceInfo> getDeviceInfo() const {
100 ob_error *error = nullptr;
101 auto info = ob_device_get_device_info(impl_, &error);
102 Error::handle(&error);
103 return std::make_shared<DeviceInfo>(info);
104 }
105
113 bool isExtensionInfoExist(const std::string &infoKey) const {
114 ob_error *error = nullptr;
115 auto exist = ob_device_is_extension_info_exist(impl_, infoKey.c_str(), &error);
116 Error::handle(&error);
117 return exist;
118 }
119
127 const char *getExtensionInfo(const std::string &infoKey) const {
128 ob_error *error = nullptr;
129 const char *info = ob_device_get_extension_info(impl_, infoKey.c_str(), &error);
130 Error::handle(&error);
131 return info;
132 }
133
139 std::shared_ptr<SensorList> getSensorList() const {
140 ob_error *error = nullptr;
141 auto list = ob_device_get_sensor_list(impl_, &error);
142 Error::handle(&error);
143 return std::make_shared<SensorList>(list);
144 }
145
152 std::shared_ptr<Sensor> getSensor(OBSensorType type) const {
153 ob_error *error = nullptr;
154 auto sensor = ob_device_get_sensor(impl_, type, &error);
155 Error::handle(&error);
156 return std::make_shared<Sensor>(sensor);
157 }
158
165 void setIntProperty(OBPropertyID propertyId, int32_t value) const {
166 ob_error *error = nullptr;
167 ob_device_set_int_property(impl_, propertyId, value, &error);
168 Error::handle(&error);
169 }
170
177 void setFloatProperty(OBPropertyID propertyId, float value) const {
178 ob_error *error = nullptr;
179 ob_device_set_float_property(impl_, propertyId, value, &error);
180 Error::handle(&error);
181 }
182
189 void setBoolProperty(OBPropertyID propertyId, bool value) const {
190 ob_error *error = nullptr;
191 ob_device_set_bool_property(impl_, propertyId, value, &error);
192 Error::handle(&error);
193 }
194
202 int32_t getIntProperty(OBPropertyID propertyId) const {
203 ob_error *error = nullptr;
204 auto value = ob_device_get_int_property(impl_, propertyId, &error);
205 Error::handle(&error);
206 return value;
207 }
208
216 float getFloatProperty(OBPropertyID propertyId) const {
217 ob_error *error = nullptr;
218 auto value = ob_device_get_float_property(impl_, propertyId, &error);
219 Error::handle(&error);
220 return value;
221 }
222
230 bool getBoolProperty(OBPropertyID propertyId) const {
231 ob_error *error = nullptr;
232 auto value = ob_device_get_bool_property(impl_, propertyId, &error);
233 Error::handle(&error);
234 return value;
235 }
236
245 ob_error *error = nullptr;
246 auto range = ob_device_get_int_property_range(impl_, propertyId, &error);
247 Error::handle(&error);
248 return range;
249 }
250
259 ob_error *error = nullptr;
260 auto range = ob_device_get_float_property_range(impl_, propertyId, &error);
261 Error::handle(&error);
262 return range;
263 }
264
273 ob_error *error = nullptr;
274 auto range = ob_device_get_bool_property_range(impl_, propertyId, &error);
275 Error::handle(&error);
276 return range;
277 }
278
286 void setStructuredData(OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const {
287 ob_error *error = nullptr;
288 ob_device_set_structured_data(impl_, propertyId, data, dataSize, &error);
289 Error::handle(&error);
290 }
291
299 void getStructuredData(OBPropertyID propertyId, uint8_t *data, uint32_t *dataSize) const {
300 ob_error *error = nullptr;
301 ob_device_get_structured_data(impl_, propertyId, data, dataSize, &error);
302 Error::handle(&error);
303 }
304
311 ob_error *error = nullptr;
313 Error::handle(&error);
314 return res;
315 }
316
322 void writeLicenseInfo(const std::string &licenseInfo) const {
323 ob_error *error = nullptr;
324 ob_device_write_license_info(impl_, licenseInfo.c_str(), static_cast<uint32_t>(licenseInfo.size()), &error);
325 Error::handle(&error);
326 }
327
331 void clearLicenseInfo() const {
332 ob_error *error = nullptr;
334 Error::handle(&error);
335 }
336
342 std::string readLicenseInfo() const {
343 ob_error *error = nullptr;
344 char buf[4096] = {};
345 ob_device_read_license_info(impl_, buf, sizeof(buf), &error);
346 Error::handle(&error);
347 return std::string(buf);
348 }
349
356 void writeCustomerData(const void *data, uint32_t dataSize) {
357 ob_error *error = nullptr;
358 ob_device_write_customer_data(impl_, data, dataSize, &error);
359 Error::handle(&error);
360 }
361
368 void readCustomerData(void *data, uint32_t *dataSize) {
369 ob_error *error = nullptr;
370 ob_device_read_customer_data(impl_, data, dataSize, &error);
371 Error::handle(&error);
372 }
373
380 ob_error *error = nullptr;
381 auto count = ob_device_get_supported_property_count(impl_, &error);
382 Error::handle(&error);
383 return count;
384 }
385
393 OBPropertyItem getSupportedProperty(uint32_t index) const {
394 ob_error *error = nullptr;
395 auto item = ob_device_get_supported_property_item(impl_, index, &error);
396 Error::handle(&error);
397 return item;
398 }
399
408 bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission) const {
409 ob_error *error = nullptr;
410 auto result = ob_device_is_property_supported(impl_, propertyId, permission, &error);
411 Error::handle(&error);
412 return result;
413 }
414
421 ob_error *error = nullptr;
422 auto result = ob_device_is_global_timestamp_supported(impl_, &error);
423 Error::handle(&error);
424 return result;
425 }
426
432 void enableGlobalTimestamp(bool enable) {
433 ob_error *error = nullptr;
435 Error::handle(&error);
436 }
437
447 void updateFirmware(const char *filePath, DeviceFwUpdateCallback callback, bool async = true) {
448 ob_error *error = nullptr;
449 fwUpdateCallback_ = callback;
450 ob_device_update_firmware(impl_, filePath, &Device::firmwareUpdateCallback, async, this, &error);
451 Error::handle(&error);
452 }
453
464 void updateFirmwareFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async = true) {
465 ob_error *error = nullptr;
466 fwUpdateCallback_ = callback;
467 ob_device_update_firmware_from_data(impl_, firmwareData, firmwareDataSize, &Device::firmwareUpdateCallback, async, this, &error);
468 Error::handle(&error);
469 }
470
480 void updateOptionalDepthPresets(const char filePathList[][OB_PATH_MAX], uint8_t pathCount, DeviceFwUpdateCallback callback) {
481 ob_error *error = nullptr;
482 fwUpdateCallback_ = callback;
483 ob_device_update_optional_depth_presets(impl_, filePathList, pathCount, &Device::firmwareUpdateCallback, this, &error);
484 Error::handle(&error);
485 }
486
495 void updateOptionalDepthPresets(const std::vector<std::vector<uint8_t>> &dataList, DeviceFwUpdateCallback callback) {
496 ob_error *error = nullptr;
497 std::vector<OBDataView> presets;
498 presets.reserve(dataList.size());
499 for(const auto &data: dataList) {
500 presets.push_back({data.data(), static_cast<uint32_t>(data.size())});
501 }
502 fwUpdateCallback_ = callback;
503 auto count = static_cast<uint8_t>(presets.size());
504 ob_device_update_optional_depth_presets_from_data(impl_, presets.data(), count, &Device::firmwareUpdateCallback, this, &error);
505 Error::handle(&error);
506 }
507
520
521 static void deviceStateChangedCallback(OBDeviceState state, const char *message, void *userData) {
522 auto device = static_cast<Device *>(userData);
523 device->deviceStateChangeCallback_(state, message);
524 }
525
532 ob_error *error = nullptr;
533 auto mode = ob_device_get_current_depth_work_mode(impl_, &error);
534 Error::handle(&error);
535 return mode;
536 }
537
545 ob_error *error = nullptr;
547 Error::handle(&error);
548 return name;
549 }
550
557 ob_error *error = nullptr;
558 auto status = ob_device_switch_depth_work_mode(impl_, &workMode, &error);
559 Error::handle(&error);
560 return status;
561 }
562
568 OBStatus switchDepthWorkMode(const char *modeName) const {
569 ob_error *error = nullptr;
570 auto status = ob_device_switch_depth_work_mode_by_name(impl_, modeName, &error);
571 Error::handle(&error);
572 return status;
573 }
574
580 std::shared_ptr<OBDepthWorkModeList> getDepthWorkModeList() const {
581 ob_error *error = nullptr;
582 auto list = ob_device_get_depth_work_mode_list(impl_, &error);
583 Error::handle(&error);
584 return std::make_shared<OBDepthWorkModeList>(list);
585 }
586
593 ob_error *error = nullptr;
594 auto result = ob_device_is_color_preset_supported(impl_, &error);
595 Error::handle(&error);
596 return result;
597 }
598
604 const char *getCurrentColorPresetName() const {
605 ob_error *error = nullptr;
606 const char *name = ob_device_get_current_color_preset_name(impl_, &error);
607 Error::handle(&error);
608 return name;
609 }
610
616 void switchColorPreset(const char *presetName) const {
617 ob_error *error = nullptr;
618 ob_device_switch_color_preset(impl_, presetName, &error);
619 Error::handle(&error);
620 }
621
627 std::shared_ptr<ColorPresetList> getColorPresetList() const {
628 ob_error *error = nullptr;
629 auto list = ob_device_get_color_preset_list(impl_, &error);
630 Error::handle(&error);
631 return std::make_shared<ColorPresetList>(list);
632 }
633
639 void reboot() const {
640 ob_error *error = nullptr;
641 ob_device_reboot(impl_, &error);
642 Error::handle(&error);
643 }
644
653 void reboot(uint32_t delayMs) const {
655 reboot();
656 }
657
663 bool syncDeviceHardwarePPSTime(uint64_t hardwarePPSTime) const {
664 ob_error *error = nullptr;
665 bool success = ob_device_sync_hardware_pps_time(impl_, hardwarePPSTime, &error);
666 Error::handle(&error);
667 return success;
668 }
669
680 void enableHeartbeat(bool enable) const {
681 ob_error *error = nullptr;
682 ob_device_enable_heartbeat(impl_, enable, &error);
683 Error::handle(&error);
684 }
685
691 void enableFirmwareLog(bool enable) const {
692 ob_error *error = nullptr;
693 ob_device_enable_firmware_log(impl_, enable, &error);
694 Error::handle(&error);
695 }
696
702 bool isFirmwareLogEnabled() const {
703 ob_error *error = nullptr;
704 bool enable = ob_device_is_firmware_log_enabled(impl_, &error);
705 Error::handle(&error);
706 return enable;
707 }
708
715 void setMonitorPollInterval(uint32_t intervalMs) const {
716 ob_error *error = nullptr;
717 ob_device_set_monitor_poll_interval(impl_, intervalMs, &error);
718 Error::handle(&error);
719 }
720
727 uint32_t getMonitorPollInterval() const {
728 ob_error *error = nullptr;
729 auto intervalMs = ob_device_get_monitor_poll_interval(impl_, &error);
730 Error::handle(&error);
731 return intervalMs;
732 }
733
750 ob_error *error = nullptr;
752 Error::handle(&error);
753 return mode;
754 }
755
762 ob_error *error = nullptr;
764 Error::handle(&error);
765 }
766
773 ob_error *error = nullptr;
774 auto config = ob_device_get_multi_device_sync_config(impl_, &error);
775 Error::handle(&error);
776 return config;
777 }
778
790 void triggerCapture() const {
791 ob_error *error = nullptr;
793 Error::handle(&error);
794 }
795
800 ob_error *error = nullptr;
802 Error::handle(&error);
803 }
804
811 ob_error *error = nullptr;
812 auto config = ob_device_get_timestamp_reset_config(impl_, &error);
813 Error::handle(&error);
814 return config;
815 }
816
828 void timestampReset() const {
829 ob_error *error = nullptr;
831 Error::handle(&error);
832 }
833
837 inline void timerReset() const {
839 }
840
852 void timerSyncWithHost() const {
853 ob_error *error = nullptr;
855 Error::handle(&error);
856 }
857
864 const char *getCurrentPresetName() const {
865 ob_error *error = nullptr;
866 const char *name = ob_device_get_current_preset_name(impl_, &error);
867 Error::handle(&error);
868 return name;
869 }
870
877 void loadPreset(const char *presetName) const {
878 ob_error *error = nullptr;
879 ob_device_load_preset(impl_, presetName, &error);
880 Error::handle(&error);
881 }
882
889 void loadPreset(const char *presetName, const char *version) const {
890 ob_error *error = nullptr;
891 ob_device_load_preset_by_depth_work_mode_version(impl_, presetName, version, &error);
892 Error::handle(&error);
893 }
894
902 ob_error *error = nullptr;
903 const char *version = ob_device_get_current_preset_depth_work_mode_version(impl_, &error);
904 Error::handle(&error);
905 return version;
906 }
907
915 std::shared_ptr<DevicePresetList> getAvailablePresetList() const {
916 ob_error *error = nullptr;
917 auto list = ob_device_get_available_preset_list(impl_, &error);
918 Error::handle(&error);
919 return std::make_shared<DevicePresetList>(list);
920 }
921
932 void loadPresetFromJsonFile(const char *filePath) const {
933 ob_error *error = nullptr;
935 Error::handle(&error);
936 }
937
950 void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size) {
951 ob_error *error = nullptr;
952 ob_device_load_preset_from_json_data(impl_, presetName, data, size, &error);
953 }
954
967 void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize) {
968 ob_error *error = nullptr;
969 ob_device_export_current_settings_as_preset_json_data(impl_, presetName, data, dataSize, &error);
970 }
971
979 void exportSettingsAsPresetJsonFile(const char *filePath) const {
980 ob_error *error = nullptr;
982 Error::handle(&error);
983 }
984
991 OBDeviceState state = {};
992 ob_error *error = nullptr;
993 state = ob_device_get_device_state(impl_, &error);
994 return state;
995 }
996
1009 void sendAndReceiveData(const uint8_t *sendData, uint32_t sendDataSize, uint8_t *receiveData, uint32_t *receiveDataSize) const {
1010 ob_error *error = nullptr;
1011 ob_device_send_and_receive_data(impl_, sendData, sendDataSize, receiveData, receiveDataSize, &error);
1012 Error::handle(&error);
1013 }
1014
1021 ob_error *error = nullptr;
1023 Error::handle(&error);
1024 return ret;
1025 }
1026
1032 void loadFrameInterleave(const char *frameInterleaveName) const {
1033 ob_error *error = nullptr;
1034 ob_device_load_frame_interleave(impl_, frameInterleaveName, &error);
1035 Error::handle(&error);
1036 }
1037
1049 OB_EXPORT const char *getCurrentFrameInterleaveName() const {
1050 ob_error *error = nullptr;
1052 Error::handle(&error);
1053 return name;
1054 }
1055
1061 std::shared_ptr<DeviceFrameInterleaveList> getAvailableFrameInterleaveList() const {
1062 ob_error *error = nullptr;
1064 Error::handle(&error);
1065 return std::make_shared<DeviceFrameInterleaveList>(list);
1066 }
1067
1073 std::shared_ptr<PresetResolutionConfigList> getAvailablePresetResolutionConfigList() const {
1074 ob_error *error = nullptr;
1076 Error::handle(&error);
1077 return std::make_shared<PresetResolutionConfigList>(list);
1078 }
1079
1080private:
1081 static void firmwareUpdateCallback(ob_fw_update_state state, const char *message, uint8_t percent, void *userData) {
1082 auto device = static_cast<Device *>(userData);
1083 if(device && device->fwUpdateCallback_) {
1084 device->fwUpdateCallback_(state, message, percent);
1085 }
1086 }
1087
1088public:
1089 // The following interfaces are deprecated and are retained here for compatibility purposes.
1090 void deviceUpgrade(const char *filePath, DeviceFwUpdateCallback callback, bool async = true) {
1091 updateFirmware(filePath, callback, async);
1092 }
1093
1094 void deviceUpgradeFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async = true) {
1095 updateFirmwareFromData(firmwareData, firmwareDataSize, callback, async);
1096 }
1097
1098 std::shared_ptr<CameraParamList> getCalibrationCameraParamList() {
1099 ob_error *error = nullptr;
1101 Error::handle(&error);
1102 return std::make_shared<CameraParamList>(impl);
1103 }
1104
1105 void loadDepthFilterConfig(const char *filePath) {
1106 // In order to compile, some high-version compilers will warn that the function parameters are not used.
1107 (void)filePath;
1108 }
1109};
1110
1115private:
1116 ob_device_info_t *impl_ = nullptr;
1117
1118public:
1119 explicit DeviceInfo(ob_device_info_t *impl) : impl_(impl) {}
1120 ~DeviceInfo() noexcept {
1121 ob_error *error = nullptr;
1122 ob_delete_device_info(impl_, &error);
1123 Error::handle(&error, false);
1124 }
1125
1131 const char *getName() const {
1132 ob_error *error = nullptr;
1133 const char *name = ob_device_info_get_name(impl_, &error);
1134 Error::handle(&error);
1135 return name;
1136 }
1137
1143 int getPid() const {
1144 ob_error *error = nullptr;
1145 int pid = ob_device_info_get_pid(impl_, &error);
1146 Error::handle(&error);
1147 return pid;
1148 }
1149
1155 int getVid() const {
1156 ob_error *error = nullptr;
1157 int vid = ob_device_info_get_vid(impl_, &error);
1158 Error::handle(&error);
1159 return vid;
1160 }
1161
1167 const char *getUid() const {
1168 ob_error *error = nullptr;
1169 const char *uid = ob_device_info_get_uid(impl_, &error);
1170 Error::handle(&error);
1171 return uid;
1172 }
1173
1179 const char *getSerialNumber() const {
1180 ob_error *error = nullptr;
1181 const char *sn = ob_device_info_get_serial_number(impl_, &error);
1182 Error::handle(&error);
1183 return sn;
1184 }
1185
1191 const char *getFirmwareVersion() const {
1192 ob_error *error = nullptr;
1193 const char *version = ob_device_info_get_firmware_version(impl_, &error);
1194 Error::handle(&error);
1195 return version;
1196 }
1197
1204 const char *getConnectionType() const {
1205 ob_error *error = nullptr;
1206 const char *type = ob_device_info_get_connection_type(impl_, &error);
1207 Error::handle(&error);
1208 return type;
1209 }
1210
1218 const char *getIpAddress() const {
1219 ob_error *error = nullptr;
1220 const char *ip = ob_device_info_get_ip_address(impl_, &error);
1221 Error::handle(&error);
1222 return ip;
1223 }
1224
1230 const char *getHardwareVersion() const {
1231 ob_error *error = nullptr;
1232 const char *version = ob_device_info_get_hardware_version(impl_, &error);
1233 Error::handle(&error);
1234 return version;
1235 }
1236
1242 const char *getSupportedMinSdkVersion() const {
1243 ob_error *error = nullptr;
1244 const char *version = ob_device_info_get_supported_min_sdk_version(impl_, &error);
1245 Error::handle(&error);
1246 return version;
1247 }
1248
1254 const char *getAsicName() const {
1255 ob_error *error = nullptr;
1256 const char *name = ob_device_info_get_asicName(impl_, &error);
1257 Error::handle(&error);
1258 return name;
1259 }
1260
1267 ob_error *error = nullptr;
1268 OBDeviceType type = ob_device_info_get_device_type(impl_, &error);
1269 Error::handle(&error);
1270 return type;
1271 }
1272
1278 const char *getDeviceSubnetMask() const {
1279 ob_error *error = nullptr;
1280 const char *subnetMask = ob_device_info_get_subnet_mask(impl_, &error);
1281 Error::handle(&error);
1282 return subnetMask;
1283 }
1284
1290 const char *getDeviceGateway() const {
1291 ob_error *error = nullptr;
1292 const char *subnetMask = ob_device_info_get_gateway(impl_, &error);
1293 Error::handle(&error);
1294 return subnetMask;
1295 }
1296
1297public:
1298 // The following interfaces are deprecated and are retained here for compatibility purposes.
1299 const char *getDevicegateway() {
1300 return getDeviceGateway();
1301 }
1302
1303 const char *name() const {
1304 return getName();
1305 }
1306
1307 int pid() const {
1308 return getPid();
1309 }
1310
1311 int vid() const {
1312 return getVid();
1313 }
1314
1315 const char *uid() const {
1316 return getUid();
1317 }
1318
1319 const char *serialNumber() const {
1320 return getSerialNumber();
1321 }
1322
1323 const char *firmwareVersion() const {
1324 return getFirmwareVersion();
1325 }
1326
1327 const char *connectionType() const {
1328 return getConnectionType();
1329 }
1330
1331 const char *ipAddress() const {
1332 return getIpAddress();
1333 }
1334
1335 const char *hardwareVersion() const {
1336 return getHardwareVersion();
1337 }
1338
1339 const char *supportedMinSdkVersion() const {
1341 }
1342
1343 const char *asicName() const {
1344 return getAsicName();
1345 }
1346
1348 return getDeviceType();
1349 }
1350};
1351
1356private:
1357 ob_device_list_t *impl_ = nullptr;
1358
1359public:
1360 explicit DeviceList(ob_device_list_t *impl) : impl_(impl) {}
1361 ~DeviceList() noexcept {
1362 ob_error *error = nullptr;
1363 ob_delete_device_list(impl_, &error);
1364 Error::handle(&error, false);
1365 }
1366
1372 uint32_t getCount() const {
1373 ob_error *error = nullptr;
1374 auto count = ob_device_list_get_count(impl_, &error);
1375 Error::handle(&error);
1376 return count;
1377 }
1378
1386 int getPid(uint32_t index) const {
1387 ob_error *error = nullptr;
1388 auto pid = ob_device_list_get_device_pid(impl_, index, &error);
1389 Error::handle(&error);
1390 return pid;
1391 }
1392
1400 int getVid(uint32_t index) const {
1401 ob_error *error = nullptr;
1402 auto vid = ob_device_list_get_device_vid(impl_, index, &error);
1403 Error::handle(&error);
1404 return vid;
1405 }
1406
1414 const char *getUid(uint32_t index) const {
1415 ob_error *error = nullptr;
1416 auto uid = ob_device_list_get_device_uid(impl_, index, &error);
1417 Error::handle(&error);
1418 return uid;
1419 }
1420
1428 const char *getSerialNumber(uint32_t index) const {
1429 ob_error *error = nullptr;
1430 auto sn = ob_device_list_get_device_serial_number(impl_, index, &error);
1431 Error::handle(&error);
1432 return sn;
1433 }
1434
1445 const char *getName(uint32_t index) const {
1446 ob_error *error = nullptr;
1447 auto name = ob_device_list_get_device_name(impl_, index, &error);
1448 Error::handle(&error);
1449 return name;
1450 }
1451
1460 const char *getConnectionType(uint32_t index) const {
1461 ob_error *error = nullptr;
1462 auto type = ob_device_list_get_device_connection_type(impl_, index, &error);
1463 Error::handle(&error);
1464 return type;
1465 }
1466
1476 const char *getIpAddress(uint32_t index) const {
1477 ob_error *error = nullptr;
1478 auto ip = ob_device_list_get_device_ip_address(impl_, index, &error);
1479 Error::handle(&error);
1480 return ip;
1481 }
1482
1492 const char *getSubnetMask(uint32_t index) const {
1493 ob_error *error = nullptr;
1494 auto subnetMask = ob_device_list_get_device_subnet_mask(impl_, index, &error);
1495 Error::handle(&error);
1496 return subnetMask;
1497 }
1498
1508 const char *getGateway(uint32_t index) const {
1509 ob_error *error = nullptr;
1510 auto gateway = ob_device_list_get_device_gateway(impl_, index, &error);
1511 Error::handle(&error);
1512 return gateway;
1513 }
1514
1524 const char *getLocalMacAddress(uint32_t index) const {
1525 ob_error *error = nullptr;
1526 auto mac = ob_device_list_get_device_local_mac(impl_, index, &error);
1527 Error::handle(&error);
1528 return mac;
1529 }
1530
1540 const char *getLocalIP(uint32_t index) const {
1541 ob_error *error = nullptr;
1542 auto ip = ob_device_list_get_device_local_ip(impl_, index, &error);
1543 Error::handle(&error);
1544 return ip;
1545 }
1546
1556 uint8_t getLocalSubnetLength(uint32_t index) const {
1557 ob_error *error = nullptr;
1558 auto subnetMask = ob_device_list_get_device_local_subnet_length(impl_, index, &error);
1559 Error::handle(&error);
1560 return subnetMask;
1561 }
1562
1572 const char *getLocalGateway(uint32_t index) const {
1573 ob_error *error = nullptr;
1574 auto gateway = ob_device_list_get_device_local_gateway(impl_, index, &error);
1575 Error::handle(&error);
1576 return gateway;
1577 }
1578
1588 const char *getLocalNetInterfaceName(uint32_t index) const {
1589 ob_error *error = nullptr;
1590 auto netItfName = ob_device_list_get_device_local_net_if_name(impl_, index, &error);
1591 Error::handle(&error);
1592 return netItfName;
1593 }
1594
1604 OBIpSourceType getIpSourceType(uint32_t index) const {
1605 ob_error *error = nullptr;
1606 auto ipSrcType = ob_device_list_get_device_ip_source_type(impl_, index, &error);
1607 Error::handle(&error);
1608 return ipSrcType;
1609 }
1610
1620 const char *getUserName(uint32_t index) const {
1621 ob_error *error = nullptr;
1622 auto userName = ob_device_list_get_device_user_name(impl_, index, &error);
1623 Error::handle(&error);
1624 return userName;
1625 }
1626
1642 ob_error *error = nullptr;
1643 auto state = ob_device_list_query_device_access_state(impl_, index, &error);
1644 Error::handle(&error);
1645 return state;
1646 }
1647
1664 ob_error *error = nullptr;
1666 Error::handle(&error);
1667 return state;
1668 }
1669
1682 std::shared_ptr<Device> getDevice(uint32_t index, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
1683 ob_error *error = nullptr;
1684 auto device = ob_device_list_get_device_ex(impl_, index, accessMode, &error);
1685 Error::handle(&error);
1686 return std::make_shared<Device>(device);
1687 }
1688
1701 std::shared_ptr<Device> getDeviceBySN(const char *serialNumber, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
1702 ob_error *error = nullptr;
1703 auto device = ob_device_list_get_device_by_serial_number_ex(impl_, serialNumber, accessMode, &error);
1704 Error::handle(&error);
1705 return std::make_shared<Device>(device);
1706 }
1707
1724 std::shared_ptr<Device> getDeviceByUid(const char *uid, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
1725 ob_error *error = nullptr;
1726 auto device = ob_device_list_get_device_by_uid_ex(impl_, uid, accessMode, &error);
1727 Error::handle(&error);
1728 return std::make_shared<Device>(device);
1729 }
1730
1731public:
1732 // The following interfaces are deprecated and are retained here for compatibility purposes.
1733 uint32_t deviceCount() const {
1734 return getCount();
1735 }
1736
1737 int pid(uint32_t index) const {
1738 return getPid(index);
1739 }
1740
1741 int vid(uint32_t index) const {
1742 return getVid(index);
1743 }
1744
1745 const char *uid(uint32_t index) const {
1746 return getUid(index);
1747 }
1748
1749 const char *serialNumber(uint32_t index) const {
1750 return getSerialNumber(index);
1751 }
1752
1753 const char *name(uint32_t index) const {
1754 return getName(index);
1755 }
1756
1757 const char *connectionType(uint32_t index) const {
1758 return getConnectionType(index);
1759 }
1760
1761 const char *ipAddress(uint32_t index) const {
1762 return getIpAddress(index);
1763 }
1764};
1765
1767private:
1768 ob_depth_work_mode_list_t *impl_ = nullptr;
1769
1770public:
1771 explicit OBDepthWorkModeList(ob_depth_work_mode_list_t *impl) : impl_(impl) {}
1773 ob_error *error = nullptr;
1774 ob_delete_depth_work_mode_list(impl_, &error);
1775 Error::handle(&error, false);
1776 }
1777
1783 uint32_t getCount() {
1784 ob_error *error = nullptr;
1785 auto count = ob_depth_work_mode_list_get_count(impl_, &error);
1786 Error::handle(&error);
1787 return count;
1788 }
1789
1798 ob_error *error = nullptr;
1799 auto mode = ob_depth_work_mode_list_get_item(impl_, index, &error);
1800 Error::handle(&error);
1801 return mode;
1802 }
1803
1811 OBDepthWorkMode operator[](uint32_t index) {
1812 return getOBDepthWorkMode(index);
1813 }
1814
1815public:
1816 // The following interfaces are deprecated and are retained here for compatibility purposes.
1817 uint32_t count() {
1818 return getCount();
1819 }
1820};
1821
1827private:
1828 ob_device_preset_list_t *impl_ = nullptr;
1829
1830public:
1831 explicit DevicePresetList(ob_device_preset_list_t *impl) : impl_(impl) {}
1833 ob_error *error = nullptr;
1834 ob_delete_preset_list(impl_, &error);
1835 Error::handle(&error, false);
1836 }
1837
1843 uint32_t getCount() {
1844 ob_error *error = nullptr;
1845 auto count = ob_device_preset_list_get_count(impl_, &error);
1846 Error::handle(&error);
1847 return count;
1848 }
1849
1857 const char *getName(uint32_t index) {
1858 ob_error *error = nullptr;
1859 const char *name = ob_device_preset_list_get_name(impl_, index, &error);
1860 Error::handle(&error);
1861 return name;
1862 }
1863
1872 const char *getDepthWorkModeVersion(uint32_t index) {
1873 ob_error *error = nullptr;
1874 const char *version = ob_device_preset_list_get_depth_work_mode_version(impl_, index, &error);
1875 Error::handle(&error);
1876 return version;
1877 }
1878
1885 bool hasPreset(const char *name) {
1886 ob_error *error = nullptr;
1887 auto result = ob_device_preset_list_has_preset(impl_, name, &error);
1888 Error::handle(&error);
1889 return result;
1890 }
1891
1892public:
1893 // The following interfaces are deprecated and are retained here for compatibility purposes.
1894 uint32_t count() {
1895 return getCount();
1896 }
1897};
1898
1903private:
1904 ob_color_preset_list *impl_ = nullptr;
1905
1906public:
1907 explicit ColorPresetList(ob_color_preset_list *impl) : impl_(impl) {}
1908 ~ColorPresetList() noexcept {
1909 ob_error *error = nullptr;
1910 ob_delete_color_preset_list(impl_, &error);
1911 Error::handle(&error, false);
1912 }
1913
1914 uint32_t getCount() const {
1915 ob_error *error = nullptr;
1916 auto count = ob_color_preset_list_get_count(impl_, &error);
1917 Error::handle(&error);
1918 return count;
1919 }
1920
1921 const char *getName(uint32_t index) const {
1922 ob_error *error = nullptr;
1923 const char *name = ob_color_preset_list_get_name(impl_, index, &error);
1924 Error::handle(&error);
1925 return name;
1926 }
1927};
1928
1933private:
1934 ob_camera_param_list_t *impl_ = nullptr;
1935
1936public:
1937 explicit CameraParamList(ob_camera_param_list_t *impl) : impl_(impl) {}
1938 ~CameraParamList() noexcept {
1939 ob_error *error = nullptr;
1940 ob_delete_camera_param_list(impl_, &error);
1941 Error::handle(&error, false);
1942 }
1943
1949 uint32_t getCount() {
1950 ob_error *error = nullptr;
1951 auto count = ob_camera_param_list_get_count(impl_, &error);
1952 Error::handle(&error);
1953 return count;
1954 }
1955
1964 ob_error *error = nullptr;
1965 auto param = ob_camera_param_list_get_param(impl_, index, &error);
1966 Error::handle(&error);
1967 return param;
1968 }
1969
1970public:
1971 // The following interfaces are deprecated and are retained here for compatibility purposes.
1972 uint32_t count() {
1973 return getCount();
1974 }
1975};
1976
1981private:
1982 ob_device_frame_interleave_list_t *impl_ = nullptr;
1983
1984public:
1985 explicit DeviceFrameInterleaveList(ob_device_frame_interleave_list_t *impl) : impl_(impl) {}
1987 ob_error *error = nullptr;
1988 ob_delete_frame_interleave_list(impl_, &error);
1989 Error::handle(&error, false);
1990 }
1991
1997 uint32_t getCount() {
1998 ob_error *error = nullptr;
1999 auto count = ob_device_frame_interleave_list_get_count(impl_, &error);
2000 Error::handle(&error);
2001 return count;
2002 }
2003
2011 const char *getName(uint32_t index) {
2012 ob_error *error = nullptr;
2013 const char *name = ob_device_frame_interleave_list_get_name(impl_, index, &error);
2014 Error::handle(&error);
2015 return name;
2016 }
2017
2025 bool hasFrameInterleave(const char *name) {
2026 ob_error *error = nullptr;
2027 auto result = ob_device_frame_interleave_list_has_frame_interleave(impl_, name, &error);
2028 Error::handle(&error);
2029 return result;
2030 }
2031};
2032
2037private:
2038 ob_preset_resolution_config_list_t *impl_ = nullptr;
2039
2040public:
2041 explicit PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl) : impl_(impl) {}
2043 ob_error *error = nullptr;
2045 Error::handle(&error, false);
2046 }
2047
2051 uint32_t getCount() {
2052 ob_error *error = nullptr;
2053 auto count = ob_device_preset_resolution_config_get_count(impl_, &error);
2054 Error::handle(&error);
2055 return count;
2056 }
2057
2058 /*
2059 * @brief Get the device preset resolution ratio at the specified index
2060
2061 * @param[in] index the index of the device preset resolution ratio
2062 *
2063 * @return OBPresetResolutionConfig the corresponding device preset resolution ratio
2064 */
2066 ob_error *error = nullptr;
2067 auto config = ob_device_preset_resolution_config_list_get_item(impl_, index, &error);
2068 Error::handle(&error);
2069 return config;
2070 }
2071};
2072
2073} // 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 const char * ob_device_get_current_frame_interleave_name(const ob_device *device, ob_error **error)
Get current frame interleave name.
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 interleave 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 const char * ob_device_preset_list_get_depth_work_mode_version(const ob_device_preset_list *preset_list, uint32_t index, ob_error **error)
Get the target depth work mode version of the preset at the specified index.
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 const char * ob_color_preset_list_get_name(const ob_color_preset_list *list, uint32_t index, ob_error **error)
Get the name of color preset at the specified index.
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 uint32_t ob_color_preset_list_get_count(const ob_color_preset_list *list, ob_error **error)
Get the number of color preset in the list.
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 const char * ob_device_get_current_preset_depth_work_mode_version(const ob_device *device, ob_error **error)
Get the version of the current depth work mode.
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 void ob_delete_color_preset_list(ob_color_preset_list *list, ob_error **error)
Delete the color preset 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_color_preset_supported(const ob_device *device, ob_error **error)
Check if the device supports color preset.
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_by_depth_work_mode_version(ob_device *device, const char *preset_name, const char *version, ob_error **error)
Load the preset by preset name and the target depth work mode version. When multiple presets share th...
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 void ob_device_switch_color_preset(ob_device *device, const char *preset_name, ob_error **error)
Switch the color preset by name.
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 const char * ob_device_get_current_color_preset_name(const ob_device *device, ob_error **error)
Get the current color preset name.
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 ob_color_preset_list * ob_device_get_color_preset_list(const ob_device *device, ob_error **error)
Get the available color preset 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 uint32_t ob_device_get_monitor_poll_interval(ob_device *device, ob_error **error)
Get the device monitor polling interval.
OB_EXPORT ob_ip_source_type ob_device_list_get_device_ip_source_type(const ob_device_list *list, uint32_t index, ob_error **error)
Get the current GVCP IP configuration status of the device at the specified index.
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 const char * ob_device_list_get_device_local_net_if_name(const ob_device_list *list, uint32_t index, ob_error **error)
Get the name of the host network interface corresponding to 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 void ob_device_set_monitor_poll_interval(ob_device *device, uint32_t interval_ms, ob_error **error)
Set the device monitor polling interval.
OB_EXPORT ob_device_access_state ob_device_list_query_device_access_state(const ob_device_list *list, uint32_t index, ob_error **error)
Query the current device access state without opening the device.
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 bool ob_device_is_firmware_log_enabled(ob_device *device, ob_error **error)
Check whether the device firmware log is enabled.
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 bool ob_device_is_license_authorization_supported(const ob_device *device, ob_error **error)
Check whether the device supports license authorization.
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_enable_firmware_log(ob_device *device, bool enable, ob_error **error)
Enable or disable the device firmware log. If the device does not support firmware log,...
OB_EXPORT void ob_device_update_optional_depth_presets_from_data(ob_device *device, const ob_data_view *data_list, uint8_t count, ob_device_fw_update_callback callback, void *user_data, ob_error **error)
Update the device optional depth presets from data loaded in memory.
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 ob_device_access_state ob_device_list_query_device_access_state_by_serial_number(const ob_device_list *list, const char *serial_number, ob_error **error)
Query the current device access state by serial number without opening the device.
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_read_license_info(const ob_device *device, char *license_info_json, uint32_t license_info_json_size, ob_error **error)
Read signed device license information as SDK license_info JSON.
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 void ob_device_write_license_info(ob_device *device, const char *license_info_json, uint32_t license_info_json_size, ob_error **error)
Write signed device license information.
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 bool ob_device_sync_hardware_pps_time(ob_device *device, uint64_t hardware_pps_time, ob_error **error)
Synchronize the device time (synchronize hardwarePPS time to device).
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 const char * ob_device_list_get_device_user_name(const ob_device_list *list, uint32_t index, ob_error **error)
Get the user-defined name of the device at the specified index.
OB_EXPORT void ob_delete_device_list(ob_device_list *list, ob_error **error)
Delete a device list.
OB_EXPORT void ob_device_clear_license_info(ob_device *device, ob_error **error)
Clear license information stored on the device.
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:182
OBStatus
error code
Definition ObTypes.h:78
@ OB_DEVICE_DEFAULT_ACCESS
Default access: control access for capable devices, ignored otherwise.
Definition ObTypes.h:2060
uint64_t OBDeviceState
Device state.
Definition ObTypes.h:741
enum OBUpgradeState OBFwUpdateState
enum ob_device_access_state OBDeviceAccessState
OBDeviceType
Enumeration for device types.
Definition ObTypes.h:806
struct ob_device_t ob_device
Definition ObTypes.h:23
enum ob_ip_source_type OBIpSourceType
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:66
#define OB_PATH_MAX
maximum path length
Definition ObTypes.h:61
struct ob_color_preset_list_t ob_color_preset_list
Definition ObTypes.h:44
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:393
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:1932
~CameraParamList() noexcept
Definition Device.hpp:1938
CameraParamList(ob_camera_param_list_t *impl)
Definition Device.hpp:1937
uint32_t getCount()
Get the number of camera parameters in the list.
Definition Device.hpp:1949
OBCameraParam getCameraParam(uint32_t index)
Get the camera parameters for the specified index.
Definition Device.hpp:1963
Class representing a list of color presets.
Definition Device.hpp:1902
ColorPresetList(ob_color_preset_list *impl)
Definition Device.hpp:1907
~ColorPresetList() noexcept
Definition Device.hpp:1908
uint32_t getCount() const
Definition Device.hpp:1914
const char * getName(uint32_t index) const
Definition Device.hpp:1921
Class representing a list of device Frame Interleave.
Definition Device.hpp:1980
uint32_t getCount()
Get the number of device frame interleave in the list.
Definition Device.hpp:1997
DeviceFrameInterleaveList(ob_device_frame_interleave_list_t *impl)
Definition Device.hpp:1985
bool hasFrameInterleave(const char *name)
check if the frame interleave list contains the special name frame interleave.
Definition Device.hpp:2025
~DeviceFrameInterleaveList() noexcept
Definition Device.hpp:1986
const char * getName(uint32_t index)
Get the name of the device frame interleave at the specified index.
Definition Device.hpp:2011
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:1114
int vid() const
Definition Device.hpp:1311
const char * getSupportedMinSdkVersion() const
Get the minimum version number of the SDK supported by the device.
Definition Device.hpp:1242
const char * getHardwareVersion() const
Get the version number of the hardware.
Definition Device.hpp:1230
const char * getDeviceSubnetMask() const
Get the subnet mask of the device.
Definition Device.hpp:1278
const char * getIpAddress() const
Get the IP address of the device.
Definition Device.hpp:1218
DeviceInfo(ob_device_info_t *impl)
Definition Device.hpp:1119
const char * getFirmwareVersion() const
Get the version number of the firmware.
Definition Device.hpp:1191
OBDeviceType deviceType() const
Definition Device.hpp:1347
int getPid() const
Get the pid of the device.
Definition Device.hpp:1143
const char * connectionType() const
Definition Device.hpp:1327
const char * uid() const
Definition Device.hpp:1315
const char * serialNumber() const
Definition Device.hpp:1319
const char * getDevicegateway()
Definition Device.hpp:1299
const char * getAsicName() const
Get chip type name.
Definition Device.hpp:1254
int pid() const
Definition Device.hpp:1307
const char * ipAddress() const
Definition Device.hpp:1331
const char * firmwareVersion() const
Definition Device.hpp:1323
const char * hardwareVersion() const
Definition Device.hpp:1335
const char * name() const
Definition Device.hpp:1303
~DeviceInfo() noexcept
Definition Device.hpp:1120
OBDeviceType getDeviceType() const
Get the device type.
Definition Device.hpp:1266
const char * getDeviceGateway() const
Get the gateway address of the device.
Definition Device.hpp:1290
const char * asicName() const
Definition Device.hpp:1343
const char * getSerialNumber() const
Get the serial number of the device.
Definition Device.hpp:1179
const char * supportedMinSdkVersion() const
Definition Device.hpp:1339
const char * getUid() const
Get system assigned uid for distinguishing between different devices.
Definition Device.hpp:1167
int getVid() const
Get the vid of the device.
Definition Device.hpp:1155
const char * getConnectionType() const
Get the connection type of the device.
Definition Device.hpp:1204
const char * getName() const
Get device name.
Definition Device.hpp:1131
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:1524
const char * serialNumber(uint32_t index) const
Definition Device.hpp:1749
OBDeviceAccessState queryDeviceAccessState(uint32_t index) const
Query the current device access state without opening the device.
Definition Device.hpp:1641
OBDeviceAccessState queryDeviceAccessStateBySN(const char *serialNumber) const
Query the current device access state by serial number without opening the device.
Definition Device.hpp:1663
const char * getIpAddress(uint32_t index) const
get the ip address of the device at the specified index
Definition Device.hpp:1476
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:1556
const char * getGateway(uint32_t index) const
get the gateway of the device at the specified index
Definition Device.hpp:1508
int pid(uint32_t index) const
Definition Device.hpp:1737
OBIpSourceType getIpSourceType(uint32_t index) const
Get the current IP configuration mode of the device at the specified index.
Definition Device.hpp:1604
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:1724
const char * ipAddress(uint32_t index) const
Definition Device.hpp:1761
const char * uid(uint32_t index) const
Definition Device.hpp:1745
int vid(uint32_t index) const
Definition Device.hpp:1741
uint32_t getCount() const
Get the number of devices in the list.
Definition Device.hpp:1372
const char * getSubnetMask(uint32_t index) const
get the subnet mask of the device at the specified index
Definition Device.hpp:1492
const char * connectionType(uint32_t index) const
Definition Device.hpp:1757
const char * getUserName(uint32_t index) const
Get the user-defined name of the device at the specified index.
Definition Device.hpp:1620
uint32_t deviceCount() const
Definition Device.hpp:1733
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:1572
const char * getUid(uint32_t index) const
Get the UID of the device at the specified index.
Definition Device.hpp:1414
~DeviceList() noexcept
Definition Device.hpp:1361
const char * getSerialNumber(uint32_t index) const
Get the serial number of the device at the specified index.
Definition Device.hpp:1428
int getPid(uint32_t index) const
Get the PID of the device at the specified index.
Definition Device.hpp:1386
const char * getConnectionType(uint32_t index) const
Get device connection type.
Definition Device.hpp:1460
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:1682
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:1701
int getVid(uint32_t index) const
Get the VID of the device at the specified index.
Definition Device.hpp:1400
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:1540
const char * getLocalNetInterfaceName(uint32_t index) const
Get the name of the host network interface corresponding to the device at the specified index.
Definition Device.hpp:1588
DeviceList(ob_device_list_t *impl)
Definition Device.hpp:1360
const char * getName(uint32_t index) const
Get the name of the device at the specified index in the device list.
Definition Device.hpp:1445
const char * name(uint32_t index) const
Definition Device.hpp:1753
Class representing a list of device presets.
Definition Device.hpp:1826
DevicePresetList(ob_device_preset_list_t *impl)
Definition Device.hpp:1831
const char * getDepthWorkModeVersion(uint32_t index)
Get the depth work mode version of the preset at the specified index.
Definition Device.hpp:1872
uint32_t getCount()
Get the number of device presets in the list.
Definition Device.hpp:1843
~DevicePresetList() noexcept
Definition Device.hpp:1832
const char * getName(uint32_t index)
Get the name of the device preset at the specified index.
Definition Device.hpp:1857
bool hasPreset(const char *name)
check if the preset list contains the special name preset.
Definition Device.hpp:1885
void loadPreset(const char *presetName, const char *version) const
load the preset by preset name and the target depth work mode version. The version is forwarded to th...
Definition Device.hpp:889
void setMonitorPollInterval(uint32_t intervalMs) const
Set the device monitor polling interval.
Definition Device.hpp:715
DeviceStateChangedCallback deviceStateChangeCallback_
Definition Device.hpp:57
void deviceUpgradeFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
Definition Device.hpp:1094
void updateFirmwareFromData(const uint8_t *firmwareData, uint32_t firmwareDataSize, DeviceFwUpdateCallback callback, bool async=true)
Update the device firmware from data.
Definition Device.hpp:464
OBPropertyItem getSupportedProperty(uint32_t index) const
Get the supported properties of the device.
Definition Device.hpp:393
ob_device * impl_
Definition Device.hpp:56
std::shared_ptr< CameraParamList > getCalibrationCameraParamList()
Definition Device.hpp:1098
const char * getCurrentPresetName() const
Get current preset name.
Definition Device.hpp:864
void timerSyncWithHost() const
synchronize the timer of the device with the host.
Definition Device.hpp:852
OBStatus switchDepthWorkMode(const char *modeName) const
Switch depth work mode by work mode name.
Definition Device.hpp:568
void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size)
Load custom preset from data.
Definition Device.hpp:950
Device(Device &&other) noexcept
Definition Device.hpp:66
void deviceUpgrade(const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
Definition Device.hpp:1090
OBFloatPropertyRange getFloatPropertyRange(OBPropertyID propertyId) const
Get float type device property range((including current value and default value).
Definition Device.hpp:258
DeviceFwUpdateCallback fwUpdateCallback_
Definition Device.hpp:58
void readCustomerData(void *data, uint32_t *dataSize)
Get the customer data type of a device property.
Definition Device.hpp:368
OBDeviceTimestampResetConfig getTimestampResetConfig() const
get the timestamp reset configuration of the device.
Definition Device.hpp:810
bool isFrameInterleaveSupported() const
Check if the device supports the frame interleave feature.
Definition Device.hpp:1020
void setIntProperty(OBPropertyID propertyId, int32_t value) const
Set int type of device property.
Definition Device.hpp:165
const char * getCurrentPresetDepthWorkModeVersion() const
Get the version of the current depth work mode.
Definition Device.hpp:901
void triggerCapture() const
send the capture command to the device.
Definition Device.hpp:790
Device & operator=(const Device &)=delete
void timestampReset() const
send the timestamp reset command to the device.
Definition Device.hpp:828
void setStructuredData(OBPropertyID propertyId, const uint8_t *data, uint32_t dataSize) const
Set the structured data type of a device property.
Definition Device.hpp:286
std::shared_ptr< SensorList > getSensorList() const
Get device sensor list.
Definition Device.hpp:139
Device(ob_device_t *impl)
Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
Definition Device.hpp:64
void getStructuredData(OBPropertyID propertyId, uint8_t *data, uint32_t *dataSize) const
Get the structured data type of a device property.
Definition Device.hpp:299
int getSupportedPropertyCount() const
Get the number of properties supported by the device.
Definition Device.hpp:379
void clearLicenseInfo() const
Clear license information stored on the device.
Definition Device.hpp:331
OBBoolPropertyRange getBoolPropertyRange(OBPropertyID propertyId) const
Get bool type device property range (including current value and default value).
Definition Device.hpp:272
std::shared_ptr< OBDepthWorkModeList > getDepthWorkModeList() const
Request support depth work mode list.
Definition Device.hpp:580
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:480
void loadFrameInterleave(const char *frameInterleaveName) const
load the frame interleave according to frame interleave name.
Definition Device.hpp:1032
std::function< void(OBDeviceState state, const char *message)> DeviceStateChangedCallback
Callback function for device status updates.
Definition Device.hpp:53
int32_t getIntProperty(OBPropertyID propertyId) const
Get int type of device property.
Definition Device.hpp:202
Device & operator=(Device &&other) noexcept
Definition Device.hpp:70
void timerReset() const
Alias for timestampReset() since it is more accurate.
Definition Device.hpp:837
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:1009
bool isExtensionInfoExist(const std::string &infoKey) const
Check if the extension information is exist.
Definition Device.hpp:113
OBIntPropertyRange getIntPropertyRange(OBPropertyID propertyId) const
Get int type device property range (including current value and default value).
Definition Device.hpp:244
void setFloatProperty(OBPropertyID propertyId, float value) const
Set float type of device property.
Definition Device.hpp:177
void exportSettingsAsPresetJsonFile(const char *filePath) const
Export current device settings as a preset json file.
Definition Device.hpp:979
void updateFirmware(const char *filePath, DeviceFwUpdateCallback callback, bool async=true)
Update the device firmware.
Definition Device.hpp:447
const char * getExtensionInfo(const std::string &infoKey) const
Get information about extensions obtained from SDK supported by the device.
Definition Device.hpp:127
void switchColorPreset(const char *presetName) const
Switch the color preset by name.
Definition Device.hpp:616
OBStatus switchDepthWorkMode(const OBDepthWorkMode &workMode) const
Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to...
Definition Device.hpp:556
bool isColorPresetSupported() const
Check if the device supports color preset.
Definition Device.hpp:592
void reboot(uint32_t delayMs) const
Device restart delay mode.
Definition Device.hpp:653
const char * getCurrentDepthModeName()
Get current depth mode name.
Definition Device.hpp:544
std::shared_ptr< DeviceInfo > getDeviceInfo() const
Get device information.
Definition Device.hpp:99
uint32_t getMonitorPollInterval() const
Get the device monitor polling interval.
Definition Device.hpp:727
float getFloatProperty(OBPropertyID propertyId) const
Get float type of device property.
Definition Device.hpp:216
ob_device_t * getImpl() const
Definition Device.hpp:90
virtual ~Device() noexcept
Definition Device.hpp:84
bool isGlobalTimestampSupported() const
Check if the global timestamp is supported for the device.
Definition Device.hpp:420
void setTimestampResetConfig(const OBDeviceTimestampResetConfig &config) const
set the timestamp reset configuration of the device.
Definition Device.hpp:799
OBMultiDeviceSyncConfig getMultiDeviceSyncConfig() const
get the multi device sync configuration of the device.
Definition Device.hpp:772
void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize)
Export current device settings as a preset json data.
Definition Device.hpp:967
void updateOptionalDepthPresets(const std::vector< std::vector< uint8_t > > &dataList, DeviceFwUpdateCallback callback)
Update the device optional depth presets from data loaded in memory.
Definition Device.hpp:495
void enableGlobalTimestamp(bool enable)
Enable or disable the global timestamp.
Definition Device.hpp:432
void loadPresetFromJsonFile(const char *filePath) const
Load custom preset from file.
Definition Device.hpp:932
bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission) const
Check if a property permission is supported.
Definition Device.hpp:408
void writeLicenseInfo(const std::string &licenseInfo) const
Write signed device license information.
Definition Device.hpp:322
OBDeviceState getDeviceState()
Get the current device status.
Definition Device.hpp:990
void loadDepthFilterConfig(const char *filePath)
Definition Device.hpp:1105
bool getBoolProperty(OBPropertyID propertyId) const
Get bool type of device property.
Definition Device.hpp:230
std::shared_ptr< DevicePresetList > getAvailablePresetList() const
Get available preset list.
Definition Device.hpp:915
void reboot() const
Device restart.
Definition Device.hpp:639
bool isFirmwareLogEnabled() const
Check whether the device firmware log is enabled.
Definition Device.hpp:702
void writeCustomerData(const void *data, uint32_t dataSize)
Set the customer data type of a device property.
Definition Device.hpp:356
void enableHeartbeat(bool enable) const
Enable or disable the device heartbeat.
Definition Device.hpp:680
void setBoolProperty(OBPropertyID propertyId, bool value) const
Set bool type of device property.
Definition Device.hpp:189
uint16_t getSupportedMultiDeviceSyncModeBitmap() const
Get the supported multi device sync mode bitmap of the device.
Definition Device.hpp:749
OB_EXPORT const char * getCurrentFrameInterleaveName() const
Get current frame interleave name.
Definition Device.hpp:1049
std::shared_ptr< DeviceFrameInterleaveList > getAvailableFrameInterleaveList() const
Get available frame interleave list.
Definition Device.hpp:1061
bool isLicenseAuthorizationSupported() const
Check whether the device supports license authorization.
Definition Device.hpp:310
OBDepthWorkMode getCurrentDepthWorkMode() const
Get current depth work mode.
Definition Device.hpp:531
std::function< void(OBFwUpdateState state, const char *message, uint8_t percent)> DeviceFwUpdateCallback
Callback function for device firmware update progress.
Definition Device.hpp:45
void setDeviceStateChangedCallback(DeviceStateChangedCallback callback)
Set the device state changed callbacks.
Definition Device.hpp:514
void enableFirmwareLog(bool enable) const
Enable or disable the device firmware log. If the device does not support firmware log,...
Definition Device.hpp:691
std::shared_ptr< ColorPresetList > getColorPresetList() const
Get the available color preset list.
Definition Device.hpp:627
bool syncDeviceHardwarePPSTime(uint64_t hardwarePPSTime) const
synchronization the device time (synchronize hardwarePPS time to device)
Definition Device.hpp:663
static void deviceStateChangedCallback(OBDeviceState state, const char *message, void *userData)
Definition Device.hpp:521
void setMultiDeviceSyncConfig(const OBMultiDeviceSyncConfig &config) const
set the multi device sync configuration of the device.
Definition Device.hpp:761
std::string readLicenseInfo() const
Read signed device license information as SDK license_info JSON.
Definition Device.hpp:342
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:152
void loadPreset(const char *presetName) const
load the preset according to the preset name.
Definition Device.hpp:877
const char * getCurrentColorPresetName() const
Get the current color preset name.
Definition Device.hpp:604
std::shared_ptr< PresetResolutionConfigList > getAvailablePresetResolutionConfigList() const
Get the available preset resolution config list.
Definition Device.hpp:1073
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:1783
OBDepthWorkModeList(ob_depth_work_mode_list_t *impl)
Definition Device.hpp:1771
OBDepthWorkMode getOBDepthWorkMode(uint32_t index)
Get the OBDepthWorkMode object at the specified index.
Definition Device.hpp:1797
OBDepthWorkMode operator[](uint32_t index)
Get the OBDepthWorkMode object at the specified index.
Definition Device.hpp:1811
Class representing a list of preset resolution config list.
Definition Device.hpp:2036
uint32_t getCount()
Get the number of device preset resolution ratio in the list.
Definition Device.hpp:2051
OBPresetResolutionConfig getPresetResolutionRatioConfig(uint32_t index)
Definition Device.hpp:2065
PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl)
Definition Device.hpp:2041
Structure for boolean range.
Definition ObTypes.h:443
Structure for camera parameters.
Definition ObTypes.h:526
Depth work mode.
Definition ObTypes.h:1136
Structure for float range.
Definition ObTypes.h:410
Structure for integer range.
Definition ObTypes.h:399
Used to describe the characteristics of each property.
Definition Property.h:1215
The error class exposed by the SDK, users can get detailed error information according to the error.
Definition ObTypes.h:162