update service/src/device_manager/src/discovery_manager.cpp.

codecheck

Signed-off-by: LongestDistance <cdwango@isoftstone.com>
This commit is contained in:
LongestDistance 2024-11-13 09:46:47 +00:00 committed by Gitee
parent 816cc3bbae
commit c677e70d1b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -375,12 +375,12 @@ void DiscoveryManager::NotifyDeviceIsOnline(const DmDeviceInfo &dmDeviceInfo)
void DiscoveryManager::ParseDeviceInfo(const DmDeviceInfo &dmDevice, CastInnerRemoteDevice &castDevice)
{
CLOGD("dm device extraData parse, %s", dmDevice.extraData.c_str());
std::pair<std::string, std::string> ret = CastDeviceDataManager::GetInstance()
.GetDeviceNameByDeviceId(dmDevice.deviceId);
std::string deviceName = ret.first.empty() ? "" : ret.first;
std::string discoveryType = ret.second.empty() ? "" : ret.second;
json jsonObj = json::parse(dmDevice.extraData, nullptr, false);
if (jsonObj.is_discarded()) {
CLOGE("dm device extraData parse error, %s", dmDevice.extraData.c_str());
return;