From 5416b92c652d9aa49fd18f7de6b665d3a4ead66b Mon Sep 17 00:00:00 2001 From: zhuzhihui7 Date: Sat, 26 Apr 2025 15:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E4=BD=BF=E8=83=BD=E9=85=8D?= =?UTF-8?q?=E7=BD=AE5.0=E4=B8=8E5.1=E4=B8=8D=E5=85=BC=E5=AE=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuzhihui7 --- .../src/resourcemanager/meta_capability_info.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/meta_capability_info.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/meta_capability_info.cpp index 72d5de8a..b0f33f0f 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!"); -- Gitee