From a2ed8361b50ea419009dc31671a8cb346bc9cd01 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Mon, 26 Aug 2024 19:52:39 +0800 Subject: [PATCH] =?utf8?q?=E8=8E=B7=E5=8F=96=E8=A1=A8=E7=9B=98id=E4=BF=AE?= =?utf8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/set_dial/src/SetDialModel.cpp | 7 ++++++- .../wearable/service/ble_service/blemoder/bletest.cpp | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp index caf65d91f..15f835f24 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp @@ -186,7 +186,12 @@ namespace OHOS int length = 0; for (const auto &entry : registeredDials) { - memcpy_s(allidStr + length, 512, &entry.first, 2); + uint16_t id=entry.first; + if(id<=5) + { + id--; + } + memcpy_s(allidStr + length, 512, &id, 2); length += 2; } diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index 81dc5c9a9..25dce2b94 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -698,7 +698,14 @@ void ble_get_custom_dial(uint16_t id,char *buf) uint16_t ble_get_dial_id(void) { #ifdef FD230 - return OHOS::SetDialModel::GetInstance().GetCurrentDialID(); + + + uint16_t id= OHOS::SetDialModel::GetInstance().GetCurrentDialID(); + if(id<=5) + { + id--; + } + return id; #else return 0; #endif -- 2.17.1