diff --git a/senseApis/livoxGen1/livoxGen1.cpp b/senseApis/livoxGen1/livoxGen1.cpp index 6ce2447..2ed6ddd 100644 --- a/senseApis/livoxGen1/livoxGen1.cpp +++ b/senseApis/livoxGen1/livoxGen1.cpp @@ -192,7 +192,18 @@ extern "C" int livoxGen1_attachDeviceReq( imuPort = static_cast( smo::device::DeviceAttachmentSpec ::parseRequiredParamAsInt(*desc, "imu-port")); - } else if (param.first == "smo-ip") { + } else if (param.first == "smo-ip") + { + if (param.second.empty()) + { + throw std::runtime_error( + std::string(__func__) + ": smo-ip parameter is empty"); + } + if (param.second.find('.') == std::string::npos) + { + throw std::runtime_error( + std::string(__func__) + ": smo-ip parameter is not an IPv4 address"); + } smoIp = param.second; } else