Signed-off-by: wangbaidong <wangbaidong@huawei.com>
This commit is contained in:
wangbaidong 2024-09-05 15:34:44 +08:00
parent d2bcf9cb62
commit d3cfaf5e92

View File

@ -139,6 +139,7 @@ ErrCode DpShellCommand::GetDeviceCommand()
int32_t ret = GetAllNodeDeviceInfo("dp", &info, &infoNum);
if (ret != ERR_OK) {
resultReceiver_.append("get remote device list error\n");
FreeNodeInfo(info);
return ret;
}
for (int32_t i = 0; i < infoNum; i++) {
@ -155,10 +156,12 @@ ErrCode DpShellCommand::GetDeviceCommand()
ret = GetLocalNodeDeviceInfo("dp", &localInfo);
if (ret != ERR_OK) {
resultReceiver_.append("get local device error\n");
FreeNodeInfo(info);
return ret;
}
resultReceiver_.append("networkId: " + std::string(localInfo.networkId)
+ " deviceName:" + std::string(localInfo.deviceName) + "\n");
FreeNodeInfo(info);
return ERR_OK;
}