系统:增加vote运行状态
authorCaisking <3449750381@qq.com>
Mon, 4 Nov 2024 12:38:04 +0000 (20:38 +0800)
committerCaisking <3449750381@qq.com>
Mon, 4 Nov 2024 12:38:04 +0000 (20:38 +0800)
code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h
code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp
code/sdk/application/wstp/at_service/app/app_at_process.c
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 3be8b49..8720702 100644 (file)
@@ -46,6 +46,7 @@ namespace OHOS
         std::string get_popup_windows_log(void);
         std::string get_system_screen_time(void);
         std::string get_uart_at_status(void);
+        std::string get_current_vote_status(void);
 
       private:
         DebugOutputViewEventListener();
index 0f73037..6fedbaa 100644 (file)
@@ -149,6 +149,8 @@ namespace OHOS
         debugOutputItemInfo[index++] = {index, "current_screen_time"};
         //串口状态服务
         debugOutputItemInfo[index++] = {index, "uart_service_status"};
+        //Vote状态服务
+        debugOutputItemInfo[index++] = {index, "vote_service_status"};
         usedLen = index;
         /* -------------------------------- Add data -------------------------------- */
         for (uint8_t i = 0; i < usedLen; i++)
@@ -565,6 +567,13 @@ namespace OHOS
         bool status = logModel->get_uart_status();
         return std::string("uart_at_status:") + std::to_string(status);
     }
+    //获取vote状态
+    std::string DebugOutputViewEventListener::get_current_vote_status() {
+      // 获取系统日志实例
+      char buf[256];
+      get_vote_status(buf);
+      return std::string(buf);
+    }
     bool DebugOutputViewEventListener::OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event)
     {
         std::string viewId = view.GetViewId();
@@ -664,6 +673,9 @@ namespace OHOS
                 toggleButton->SetVisible(true);
                 }
               }
+              break;
+        case 14:
+            str = get_current_vote_status();
             break;
         default:
             str = "--";
index 8696c17..f045043 100755 (executable)
@@ -1274,7 +1274,6 @@ static void pm_print_veto_info(void)
     for (i = 0; i < PM_ID_MAX; i++) {\r
         // wstp_print("sub_counts[%d] = %d\r\n", i, pm_veto_ptr->veto_counts.sub_counts[i]);\r
         wstp_print("sub_counts[%d] %s = %d\r\n", i,get_pm_id_name(i), pm_veto_ptr->veto_counts.sub_counts[i]);\r
-\r
     }\r
 }\r
 \r
index 833419c..651145d 100644 (file)
@@ -24,6 +24,8 @@
 #include "power_display_service.h"
 #include "los_base.h"
 #include "tcxo.h"
+#include <stdint.h>
+#include "pm_veto.h"
 // #include "config/include/ConfigModelC.h"
 
 #ifdef SUPPORT_TCPIP
@@ -1285,6 +1287,25 @@ void uapi_set_screen_on_api(void) {
     // display_api->set_screen_set_keepon_timeout(5000);
 }
 
+//获取vote正在执行的状态
+errcode_t get_vote_status(char*str)
+{
+    uint8_t i = 0;
+    uint8_t falg = 0;
+    pm_veto_t *pm_veto_ptr = pm_veto_get_info();
+    for (i = 0; i < PM_ID_MAX; i++) {
+      if (pm_veto_ptr->veto_counts.sub_counts[i] == 1) {
+        sprintf(str, "%s %s", str, get_pm_id_name(i));
+        falg = 1;
+        }
+    }
+    if (falg==0) {
+      str = "没有正在进行的服务";
+      }
+    PRINT("***************get_vote_status***************\n %s\n", str);
+    return ERRCODE_SUCC; 
+}
+
 /*系统声音设置*/
 void uapi_systemVolumeSet(int32_t sounding)
 {
index 726ff86..6926468 100644 (file)
@@ -86,6 +86,8 @@ void print_current_time(void);
 errcode_t uapi_get_WeekStr(char *p_week);
 /*设置屏幕亮屏*/
 void uapi_set_screen_on_api(void);
+/*获取Vote状态*/
+errcode_t get_vote_status(char *str);
 
 /**
  * @brief 日期格式选项枚举