From dad298003280b7bdedfe5d6f1c8eb4e95e15728b Mon Sep 17 00:00:00 2001 From: Caisking Date: Thu, 22 May 2025 09:55:06 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=B7=B2?= =?utf8?q?=E5=AE=89=E8=A3=85app=E5=BA=94=E7=94=A8=E7=9A=84=E8=BF=94?= =?utf8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/fd230/service/app_store/app_store.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp b/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp index 21b36cba2..d04b3529b 100644 --- a/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp +++ b/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp @@ -213,13 +213,20 @@ cJSON* ble_get_pkg_list() { goto CLEANUP; } - // 添加 "name" 字段 - if (cJSON_AddStringToObject(jsonObject, "name", bundleInfos[i].bundleName) == NULL) { + // 添加 "pakgname" 字段 + if (cJSON_AddStringToObject(jsonObject, "packageName", bundleInfos[i].bundleName) == NULL) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_BLE, "Failed to add 'name' field for package at index %d", i); cJSON_Delete(jsonObject); goto CLEANUP; } + // 添加应用名称 + if (cJSON_AddStringToObject(jsonObject, "appName", bundleInfos[i].label) == NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_BLE, "Failed to add 'label' field for package at index %d", i); + cJSON_Delete(jsonObject); + goto CLEANUP; + } + // 将对象添加到数组 if (cJSON_AddItemToArray(jsonArray, jsonObject) != 1) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_BLE, "Failed to add package at index %d to JSON array", i); -- 2.17.1