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
@@ -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
*