mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-21 05:45:23 -04:00
Description: adapting to special peripherals
Match-id-bab91f702220d1c54456820132b3ce16a652d629
This commit is contained in:
@@ -129,16 +129,17 @@ std::string GetNodeDesc(std::string parameters)
|
||||
{
|
||||
nlohmann::json parObj = nlohmann::json::parse(parameters);
|
||||
std::string nodeName = "N/A";
|
||||
std::string location = "N/A";
|
||||
std::string physicalPath = "N/A";
|
||||
int32_t classes = -1;
|
||||
|
||||
if (parObj.find("name") != parObj.end() && parObj.find("location") != parObj.end() &&
|
||||
if (parObj.find("name") != parObj.end() && parObj.find("physicalPath") != parObj.end() &&
|
||||
parObj.find("classes") != parObj.end()) {
|
||||
nodeName = parObj.at("name").get<std::string>();
|
||||
location = parObj.at("location").get<std::string>();
|
||||
physicalPath = parObj.at("physicalPath").get<std::string>();
|
||||
classes = parObj.at("classes").get<int32_t>();
|
||||
}
|
||||
return "{ nodeName: " + nodeName + ", location: " + location + ", classes: " + std::to_string(classes) + " }";
|
||||
return "{ nodeName: " + nodeName + ", physicalPath: " + physicalPath + ", classes: " +
|
||||
std::to_string(classes) + " }";
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
|
||||
Reference in New Issue
Block a user