Update OrbbecSDK to version 2.5.2

This commit is contained in:
obyalian
2025-09-10 17:52:02 +08:00
parent 6cc731e387
commit 626ded8b5a
13 changed files with 221 additions and 21 deletions
@@ -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
*
@@ -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
@@ -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.
*
@@ -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
*