mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-09 14:27:02 +08:00
fix: conditionally set IP address for network devices in getDeviceIdentity
This commit is contained in:
@@ -420,8 +420,10 @@ DeviceIdentity getDeviceIdentity(const std::shared_ptr<ob::DeviceInfo> &device_i
|
||||
DeviceIdentity identity;
|
||||
identity.serial_number = safeString(device_info->getSerialNumber());
|
||||
identity.uid = safeString(device_info->getUid());
|
||||
identity.ip_address = safeString(device_info->getIpAddress());
|
||||
identity.is_network = safeString(device_info->getConnectionType()) == "Ethernet";
|
||||
if (identity.is_network) {
|
||||
identity.ip_address = safeString(device_info->getIpAddress());
|
||||
}
|
||||
return identity;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user