debug界面增加cywee日志log,去除蓝牙开启日志 1626/1 1626/head
authorpenglei <1624952103@qq.com>
Fri, 10 Jan 2025 10:10:16 +0000 (18:10 +0800)
committerpenglei <1624952103@qq.com>
Fri, 10 Jan 2025 10:10:16 +0000 (18:10 +0800)
code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp
code/sdk/drivers/peripheral/cywee/service/cywee_ble_Service.c

index 414dce2..f1e084d 100644 (file)
@@ -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<DebugOutputItemView *>(&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;
index cda7cd4..f489d7c 100644 (file)
@@ -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);
     /*****参考结束****/
 }