diff --git a/orbbec_camera/SDK/include/libobsensor/h/Context.h b/orbbec_camera/SDK/include/libobsensor/h/Context.h index e0c0535d..1758bc14 100644 --- a/orbbec_camera/SDK/include/libobsensor/h/Context.h +++ b/orbbec_camera/SDK/include/libobsensor/h/Context.h @@ -63,6 +63,16 @@ OB_EXPORT ob_device_list *ob_query_device_list(ob_context *context, ob_error **e */ OB_EXPORT void ob_enable_net_device_enumeration(ob_context *context, bool enable, ob_error **error); +/** + * @brief Changes the IP configuration of a network device. + * + * @param[in] deviceUid The unique device ID (MAC address). obtained via @ref ob_device_info_get_uid. + * @param[in] config The new IP configuration to apply. + * @param[out] error Pointer to an error object that will be populated if an error occurs. + * @return bool true if the configuration command was processed successfully, false otherwise. + */ +OB_EXPORT bool ob_change_net_device_ip_config(const char *deviceUid, ob_net_ip_config config, ob_error **error); + /** * @brief Create a network device object * diff --git a/orbbec_camera/SDK/include/libobsensor/h/Device.h b/orbbec_camera/SDK/include/libobsensor/h/Device.h index 1c14efba..3b1074ca 100644 --- a/orbbec_camera/SDK/include/libobsensor/h/Device.h +++ b/orbbec_camera/SDK/include/libobsensor/h/Device.h @@ -422,6 +422,24 @@ OB_EXPORT const char *ob_device_info_get_connection_type(const ob_device_info *i */ OB_EXPORT const char *ob_device_info_get_ip_address(const ob_device_info *info, ob_error **error); +/** + * @brief Get the network device subnet mask + * + * @param[in] info Device information + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const char* The subnet mask, such as "255.255.255.0" + */ +OB_EXPORT const char *ob_device_info_get_subnet_mask(const ob_device_info *info, ob_error **error); + +/** + * @brief Get the network device gateway address + * + * @param[in] info Device information + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const char* The gateway address, such as "192.168.1.1" + */ +OB_EXPORT const char *ob_device_info_get_gateway(const ob_device_info *info, ob_error **error); + /** * @brief Get the hardware version number * @@ -570,17 +588,77 @@ OB_EXPORT const char *ob_device_list_get_device_connection_type(const ob_device_ OB_EXPORT const char *ob_device_list_get_device_ip_address(const ob_device_list *list, uint32_t index, ob_error **error); /** - * @brief Get device local mac address + * @brief Get device subnet mask * - * @attention Only valid for network devices, otherwise it will return "0:0:0:0:0:0". + * @attention Only valid for network devices, otherwise it will return "0.0.0.0". + * + * @param[in] list Device list object + * @param[in] index Device index + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const char* returns the device subnet mask, such as "255.255.255.0" + */ +OB_EXPORT const char *ob_device_list_get_device_subnet_mask(const ob_device_list *list, uint32_t index, ob_error **error); + +/** + * @brief Get device gateway + * + * @attention Only valid for network devices, otherwise it will return "0.0.0.0". + * + * @param[in] list Device list object + * @param[in] index Device index + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const char* returns the device gateway, such as "192.168.1.1" + */ +OB_EXPORT const char *ob_device_list_get_device_gateway(const ob_device_list *list, uint32_t index, ob_error **error); + +/** + * @brief Get the MAC address of the host network interface corresponding to the network device. + * + * @attention Only valid for network devices. Returns "0:0:0:0:0:0" for non-network devices. * * @param list Device list object * @param index Device index * @param error Pointer to an error object that will be set if an error occurs. - * @return const char* returns the device mac address + * @return const char* The MAC address of the host network interface associated with the device. */ OB_EXPORT const char *ob_device_list_get_device_local_mac(const ob_device_list *list, uint32_t index, ob_error **error); +/** + * @brief Get the IP address of the host network interface corresponding to the network device. + * + * @attention Only valid for network devices. Returns "0.0.0.0" for non-network devices. + * + * @param[in] list Device list object + * @param[in] index Device index + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const char* The IP address of the host network interface associated with the device. + */ +OB_EXPORT const char *ob_device_list_get_device_local_ip(const ob_device_list *list, uint32_t index, ob_error **error); + +/** + * @brief Get the subnet length of the host network interface corresponding to the network device. + * + * @attention Only valid for network devices. Returns 0 for non-network devices. + * + * @param[in] list Device list object + * @param[in] index Device index + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const uint8_t The subnet length (0~32) of the host network interface associated with 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); + +/** + * @brief Get the gateway of the host network interface corresponding to the network device. + * + * @attention Only valid for network devices. Returns "0.0.0.0" for non-network devices. + * + * @param[in] list Device list object + * @param[in] index Device index + * @param[out] error Pointer to an error object that will be set if an error occurs. + * @return const char* The gateway of the host network interface associated with the device. + */ +OB_EXPORT const char *ob_device_list_get_device_local_gateway(const ob_device_list *list, uint32_t index, ob_error **error); + /** * @brief Create a device. * @@ -688,4 +766,3 @@ OB_EXPORT void ob_delete_camera_param_list(ob_camera_param_list *param_list, ob_ #ifdef __cplusplus } #endif - diff --git a/orbbec_camera/SDK/include/libobsensor/hpp/Context.hpp b/orbbec_camera/SDK/include/libobsensor/hpp/Context.hpp index 259b5209..f2f75ecb 100644 --- a/orbbec_camera/SDK/include/libobsensor/hpp/Context.hpp +++ b/orbbec_camera/SDK/include/libobsensor/hpp/Context.hpp @@ -97,6 +97,20 @@ public: Error::handle(&error); } + /** + * @brief Changes the IP configuration of a network device. + * + * @param[in] deviceUid The device unique ID, which is the network device MAC address. It can be obtained through the @ref DeviceList::uid() function. + * @param[in] config The new IP configuration. + * @return bool true if the configuration command was processed successfully, false otherwise. + */ + bool changeNetDeviceIpConfig(const char *deviceUid, const OBNetIpConfig &config) { + ob_error *error = nullptr; + auto res = ob_change_net_device_ip_config(deviceUid, config, &error); + Error::handle(&error); + return res; + } + /** * @brief Creates a network device with the specified IP address and port. * diff --git a/orbbec_camera/SDK/include/libobsensor/hpp/Device.hpp b/orbbec_camera/SDK/include/libobsensor/hpp/Device.hpp index 10af3c67..a026d536 100644 --- a/orbbec_camera/SDK/include/libobsensor/hpp/Device.hpp +++ b/orbbec_camera/SDK/include/libobsensor/hpp/Device.hpp @@ -1028,6 +1028,30 @@ public: return type; } + /** + * @brief Get the subnet mask of the device + * + * @return const char* the subnet mask of the device, such as "255.255.255.0" + */ + const char *getDeviceSubnetMask() const { + ob_error *error = nullptr; + const char *subnetMask = ob_device_info_get_subnet_mask(impl_, &error); + Error::handle(&error); + return subnetMask; + } + + /** + * @brief Get the gateway address of the device + * + * @return const char* the gateway address of the device, such as "192.168.1.1" + */ + const char *getDevicegateway() const { + ob_error *error = nullptr; + const char *subnetMask = ob_device_info_get_gateway(impl_, &error); + Error::handle(&error); + return subnetMask; + } + public: // The following interfaces are deprecated and are retained here for compatibility purposes. const char *name() const { @@ -1203,20 +1227,95 @@ public: } /** - * @brief get the local mac address of the device at the specified index + * @brief get the subnet mask of the device at the specified index + * + * @attention Only valid for network devices, otherwise it will return "0.0.0.0". + * + * @param index the index of the device + * @return const char* the subnet mask of the device + */ + const char *getSubnetMask(uint32_t index) const { + ob_error *error = nullptr; + auto subnetMask = ob_device_list_get_device_subnet_mask(impl_, index, &error); + Error::handle(&error); + return subnetMask; + } + + /** + * @brief get the gateway of the device at the specified index + * + * @attention Only valid for network devices, otherwise it will return "0.0.0.0". + * + * @param index the index of the device + * @return const char* the gateway of the device + */ + const char *getGateway(uint32_t index) const { + ob_error *error = nullptr; + auto gateway = ob_device_list_get_device_gateway(impl_, index, &error); + Error::handle(&error); + return gateway; + } + + /** + * @brief Get the MAC address of the host network interface corresponding to the device at the specified index * * @attention Only valid for network devices, otherwise it will return "0:0:0:0:0:0". * * @param index the index of the device - * @return const char* the local mac address of the device + * @return const char* The MAC address of the host network interface associated with the device. */ const char *getLocalMacAddress(uint32_t index) const { ob_error *error = nullptr; - auto mac = ob_device_list_get_device_local_mac(impl_, index, &error); + auto mac = ob_device_list_get_device_local_mac(impl_, index, &error); Error::handle(&error); return mac; } + /** + * @brief Get the IP address of the host network interface corresponding to the device at the specified index + * + * @attention Only valid for network devices, otherwise it will return "0.0.0.0". + * + * @param index The index of the device + * @return const char* The IP address of the host network interface associated with the device. + */ + const char *getLocalIP(uint32_t index) const { + ob_error *error = nullptr; + auto ip = ob_device_list_get_device_local_ip(impl_, index, &error); + Error::handle(&error); + return ip; + } + + /** + * @brief Get the subnet length of the host network interface corresponding to the device at the specified index + * + * @attention Only valid for network devices, otherwise it will return 0. + * + * @param index The index of the device + * @return uint8_t The subnet length (0~32) of the host network interface associated with the device. + */ + uint8_t getLocalSubnetLength(uint32_t index) const { + ob_error *error = nullptr; + auto subnetMask = ob_device_list_get_device_local_subnet_length(impl_, index, &error); + Error::handle(&error); + return subnetMask; + } + + /** + * @brief Get the gateway of the host network interface corresponding to the device at the specified index + * + * @attention Only valid for network devices, otherwise it will return "0.0.0.0". + * + * @param index The index of the device + * @return const char* The gateway of the host network interface associated with the device. + */ + const char *getLocalGateway(uint32_t index) const { + ob_error *error = nullptr; + auto gateway = ob_device_list_get_device_local_gateway(impl_, index, &error); + Error::handle(&error); + return gateway; + } + /** * @brief Get the device object at the specified index * diff --git a/orbbec_camera/SDK/lib/arm64/OrbbecSDKConfig-release.cmake b/orbbec_camera/SDK/lib/arm64/OrbbecSDKConfig-release.cmake index b87f3d80..ebbeff73 100644 --- a/orbbec_camera/SDK/lib/arm64/OrbbecSDKConfig-release.cmake +++ b/orbbec_camera/SDK/lib/arm64/OrbbecSDKConfig-release.cmake @@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1) # Import target "ob::OrbbecSDK" for configuration "Release" set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(ob::OrbbecSDK PROPERTIES - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.1" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.2" IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2" ) list(APPEND _cmake_import_check_targets ob::OrbbecSDK ) -list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.1" ) +list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.2" ) # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) diff --git a/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2 b/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2 index c7fdc908..a7ca5b02 120000 --- a/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2 +++ b/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2 @@ -1 +1 @@ -libOrbbecSDK.so.2.5.1 \ No newline at end of file +libOrbbecSDK.so.2.5.2 \ No newline at end of file diff --git a/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2.5.1 b/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2.5.2 similarity index 64% rename from orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2.5.1 rename to orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2.5.2 index ec38421d..a4db171e 100644 Binary files a/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2.5.1 and b/orbbec_camera/SDK/lib/arm64/libOrbbecSDK.so.2.5.2 differ diff --git a/orbbec_camera/SDK/lib/x64/OrbbecSDKConfig-release.cmake b/orbbec_camera/SDK/lib/x64/OrbbecSDKConfig-release.cmake index b87f3d80..ebbeff73 100644 --- a/orbbec_camera/SDK/lib/x64/OrbbecSDKConfig-release.cmake +++ b/orbbec_camera/SDK/lib/x64/OrbbecSDKConfig-release.cmake @@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1) # Import target "ob::OrbbecSDK" for configuration "Release" set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(ob::OrbbecSDK PROPERTIES - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.1" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.2" IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2" ) list(APPEND _cmake_import_check_targets ob::OrbbecSDK ) -list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.1" ) +list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.5.2" ) # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) diff --git a/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2 b/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2 index c7fdc908..a7ca5b02 120000 --- a/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2 +++ b/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2 @@ -1 +1 @@ -libOrbbecSDK.so.2.5.1 \ No newline at end of file +libOrbbecSDK.so.2.5.2 \ No newline at end of file diff --git a/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2.5.1 b/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2.5.2 similarity index 65% rename from orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2.5.1 rename to orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2.5.2 index af8ca11b..87435c25 100644 Binary files a/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2.5.1 and b/orbbec_camera/SDK/lib/x64/libOrbbecSDK.so.2.5.2 differ diff --git a/orbbec_camera/config/OrbbecSDKConfig_v2.0.xml b/orbbec_camera/config/OrbbecSDKConfig_v2.0.xml index cd880236..476a5cad 100644 --- a/orbbec_camera/config/OrbbecSDKConfig_v2.0.xml +++ b/orbbec_camera/config/OrbbecSDKConfig_v2.0.xml @@ -66,7 +66,7 @@ - false + true 100 - + 640 @@ -1200,7 +1200,7 @@ Y8 - + @@ -1217,12 +1217,12 @@ 100 - + false true - + 0