diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/meta_capability_info.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/meta_capability_info.cpp index 72d5de8a5e9438d06ed504dcad1da4831933afdf..b0f33f0fd3558253ce1ef6bf768012b33e604c5f 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/meta_capability_info.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/meta_capability_info.cpp @@ -174,6 +174,7 @@ void ToJson(cJSON *jsonObject, const MetaCapabilityInfo &metaCapInfo) cJSON_AddStringToObject(jsonObject, DH_ATTRS.c_str(), metaCapInfo.GetDHAttrs().c_str()); cJSON_AddStringToObject(jsonObject, DH_SUBTYPE.c_str(), metaCapInfo.GetDHSubtype().c_str()); cJSON_AddStringToObject(jsonObject, DEV_UDID_HASH.c_str(), metaCapInfo.GetUdidHash().c_str()); + cJSON_AddStringToObject(jsonObject, SINK_VER.c_str(), metaCapInfo.GetSinkVersion().c_str()); cJSON *jsonObjCompVersion = cJSON_CreateObject(); if (jsonObjCompVersion == NULL) { DHLOGE("Failed to create cJSON object."); @@ -246,6 +247,13 @@ void FromJsonContinue(const cJSON *jsonObject, MetaCapabilityInfo &metaCapInfo) } metaCapInfo.SetUdidHash(udidHashJson->valuestring); + cJSON *sinkVerJson = cJSON_GetObjectItem(jsonObject, SINK_VER.c_str()); + if (!IsString(sinkVerJson)) { + DHLOGE("SINK_VER is invalid!"); + return; + } + metaCapInfo.SetSinkVersion(sinkVerJson->valuestring); + cJSON *compVersionJson = cJSON_GetObjectItem(jsonObject, COMP_VER.c_str()); if (compVersionJson == nullptr) { DHLOGE("CompVersion is invalid!");