From d9f3f85a1af9af414a5b3ff4f204a94bb51ad92d Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Fri, 10 Jan 2025 18:10:16 +0800 Subject: [PATCH] =?utf8?q?debug=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0cywee?= =?utf8?q?=E6=97=A5=E5=BF=97log=EF=BC=8C=E5=8E=BB=E9=99=A4=E8=93=9D?= =?utf8?q?=E7=89=99=E5=BC=80=E5=90=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../debug_output_notification.cpp | 32 +++++++++++++++++++ .../cywee/service/cywee_ble_Service.c | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 414dce23f..f1e084db4 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -62,6 +62,8 @@ #include "diag_log.h" #include "ConfigModelC.h" + +#include "cywee_hal.h" namespace OHOS { /**************************************************************************************************** */ @@ -172,6 +174,7 @@ namespace OHOS debugOutputItemInfo[index++] = {index, "save_runtime_log"}; + debugOutputItemInfo[index++] = {index, "cwm_runtime_log"}; usedLen = index; /* -------------------------------- Add data -------------------------------- */ @@ -926,6 +929,24 @@ namespace OHOS // } // } } + else if (viewId == "cwm_ble_switch") + { + if (toggleButtonOffline) { + if (toggleButtonOffline->GetState() == false) { + // send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_CLOSE_HRS_BLE); + cywee_log_switch(0); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"cwm_ble_switch false"); + } + else { + // send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_OPEN_HRS_BLE); + cywee_log_switch(1); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"cwm_ble_switch true"); + } + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"组件不存在"); + } + return true; //进行UI刷新 + } else // 如果点击的是列表中的itemview { DebugOutputItemView *debugOutputItemView = static_cast(&view); @@ -1044,6 +1065,17 @@ namespace OHOS } } break; + case 20: + str = ""; + if(toggleButtonOffline) + { + if(toggleButtonOffline->IsVisible() == false) + { + toggleButtonOffline->SetViewId("cwm_ble_switch"); + toggleButtonOffline->SetVisible(true); + } + } + break; default: str = "--"; break; diff --git a/code/sdk/drivers/peripheral/cywee/service/cywee_ble_Service.c b/code/sdk/drivers/peripheral/cywee/service/cywee_ble_Service.c index cda7cd4d1..f489d7c8f 100644 --- a/code/sdk/drivers/peripheral/cywee/service/cywee_ble_Service.c +++ b/code/sdk/drivers/peripheral/cywee/service/cywee_ble_Service.c @@ -161,7 +161,7 @@ void cywee_recv_cmd_data(uint8_t *buf, uint16_t event_size,uint16_t handle) if(buf != NULL) printf("cywee_recv_cmd_data len %d , handle 0x%X ,*buf 0x%02X\r\n",event_size,handle,*buf); /****此处为接收指令,处理后反馈结果的参考**/ - cywee_log_switch(*buf); + // cywee_log_switch(*buf); /*****参考结束****/ } -- 2.17.1